Skip to content

pdparchitect/agentos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentOS

A Go application that mounts multiple FUSE filesystems based on a configuration file. Each service (Notion, Gmail, etc.) is mounted under its own directory, allowing filesystem-based access to cloud services.

Features

  • Multi-service FUSE mounting: Mount multiple services simultaneously under different mount points
  • Extensible architecture: Easy to add new services through a registry pattern
  • Configuration-driven: Simple YAML configuration file
  • Graceful shutdown: Clean unmounting on SIGINT/SIGTERM

Currently Supported Services

  • Notion: Access Notion workspaces and pages as files
  • Gmail: Access Gmail labels and emails as files
  • Website: Mount any website as a filesystem with routes as files and markdown versions

Building

go build -o agentos ./cmd/agentos

Running

# Run directly with go run
go run ./cmd/agentos

# Run with a specific config file
go run ./cmd/agentos --config config.yaml

# List available services
go run ./cmd/agentos --list-services

# Force unmount stale mount points before mounting (useful after crashes)
go run ./cmd/agentos --force

# Or build and run the binary
go build -o agentos ./cmd/agentos
./agentos

Configuration

Create a config.yaml file (see config.example.yaml for a template):

services:
  - type: notion
    mount_point: /tmp/agentos/notion
    options:
      # api_token: "your-notion-api-token"

  - type: gmail
    mount_point: /tmp/agentos/gmail
    options:
      # client_id: "your-client-id"

  - type: website
    mount_point: /tmp/agentos/website
    options:
      base_url: "https://example.com"

Usage

# List available services
./agentos --list-services

# Mount services from config
./agentos --config config.yaml

# Use default config.yaml in current directory
./agentos

Press Ctrl+C to unmount all services and exit.

Troubleshooting

Stuck Mount Points

If the application crashes or is forcefully terminated, FUSE mount points may remain active and prevent remounting. You'll see errors like:

failed to mount gmail at /tmp/agentos/gmail: failed to create mount point: mkdir /tmp/agentos/gmail: file exists

Or when trying to delete:

rm: cannot remove './agentos/gmail': Is a directory

Solution: Manually unmount the stuck mount point:

# Unmount a specific mount point
fusermount3 -u /tmp/agentos/gmail

# Or use sudo if needed
sudo umount /tmp/agentos/gmail

# Then clean up the directory
rm -rf /tmp/agentos

To check active FUSE mounts:

mount | grep fuse

Adding New Services

To add a new service:

  1. Create a new package under internal/services/<servicename>/
  2. Implement the mount.Service interface:
package myservice

import (
    "github.com/hanwen/go-fuse/v2/fs"
    "github.com/pdparchitect/agentos/internal/mount"
)

func init() {
    mount.Register("myservice", func() mount.Service {
        return &Service{}
    })
}

type Service struct{}

func (s *Service) Name() string {
    return "myservice"
}

func (s *Service) CreateRoot(options map[string]interface{}) (fs.InodeEmbedder, error) {
    return &MyRootNode{}, nil
}
  1. Import the service package in cmd/agentos/main.go:
import (
    _ "github.com/pdparchitect/agentos/internal/services/myservice"
)
  1. Rebuild the application

Project Structure

.
├── cmd/agentos/         # Main application entry point
├── internal/
│   ├── config/          # Configuration loading and parsing
│   ├── mount/           # FUSE mounting infrastructure and service registry
│   └── services/        # Service implementations
│       ├── notion/      # Notion filesystem service
│       ├── gmail/       # Gmail filesystem service
│       └── website/     # Website filesystem service
├── config.example.yaml  # Example configuration
└── README.md

Requirements

  • Go 1.21+
  • FUSE (Linux) or macFUSE (macOS)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors