Usage Guide
Installation
# Install the CLI globally
npm install -g @aigne/afs-cli
# Or use in a project
pnpm add @aigne/afs
CLI Quick Start
# Mount a local directory
afs mount add /src fs:///path/to/project
# Mount a Git repository
afs mount add /repo git://https://github.com/user/repo
# Mount a SQLite database
afs mount add /db sqlite:///path/to/data.db
# Mount a Cloudflare account
afs mount add /cf cloudflare://account-id?token=xxx
# List everything
afs ls /
# Read a file
afs read /src/README.md
# Write content
afs write /db/users/42 '{"name": "Alice"}'
# Execute an action
afs exec /cf/workers/my-app/.actions/deploy
# Interactive explorer
afs explore
SDK Usage
import { AFS } from "@aigne/afs";
import { AFSFS } from "@aigne/afs-fs";
import { AFSSQLite } from "@aigne/afs-sqlite";
const afs = new AFS();
// Mount providers
afs.mount(new AFSFS({
localPath: "./data",
description: "Local data files",
}));
afs.mount(new AFSSQLite({
filePath: "./app.db",
description: "Application database",
}));
// Unified API across all providers
const files = await afs.list("/fs");
const content = await afs.read("/fs/config.json");
const rows = await afs.list("/sqlite/users");
const user = await afs.read("/sqlite/users/42");
// Execute provider actions
await afs.exec("/sqlite/users/.actions/insert", {
name: "Bob",
email: "bob@example.com",
});
// Search across providers
const results = await afs.search("/", {
pattern: "TODO",
type: "content",
});
Provider Catalog
| Provider | URI Scheme | Description |
| Filesystem | fs:// | Local directories and files |
| Git | git:// | Git branches, commits, and files |
| GitHub | github:// | Issues, PRs, and discussions |
| SQLite | sqlite:// | Database tables and rows |
| JSON | json:// | JSON/YAML as virtual FS |
| TOML | toml:// | TOML config as virtual FS |
| S3 | s3:// | AWS S3 buckets and objects |
| GCS | gcs:// | Google Cloud Storage |
| Cloudflare | cloudflare:// | Workers, KV, Pages, Zones |
| MCP | mcp:// | MCP Server tool bridge |
| HTTP | http:// | Remote AFS over HTTP |
| Sandbox | sandbox:// | Isolated in-memory FS |