agent-fs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseagent-fs CLI
agent-fs CLI
agent-fs is an agent-first filesystem with full versioning, full-text search (FTS5), and semantic search. It provides a CLI that outputs JSON, making it ideal for agent workflows. Files are organized in drives within orgs.
agent-fs 是一款面向Agent的文件系统,具备完整版本控制、全文搜索(FTS5)和语义搜索功能。它提供的CLI输出JSON格式内容,非常适合Agent工作流。文件在组织(org)内的驱动器(drive)中进行管理。
Storage Backends
存储后端
agent-fs stores file bytes in a pluggable storage backend. The durable value — version history, comments, and search — lives in SQLite and works identically on every backend.
| Backend | Setup | Versioning tier | |
|---|---|---|---|
| S3 / MinIO (default) | | Full — | Real presigned URL (public, time-limited) |
| Local filesystem | | Full — | Falls back to an authenticated in-app link (requires sign-in; does not expire) |
Both backends are full-tier: every op — including and historical — works. Future backends may be basic-tier (no object versioning): on those, and historical are unavailable and fail cleanly with an error (HTTP 422) rather than a raw storage error — current content, listing, comments, and search keep working. Check a backend's capabilities before relying on versioning if you're unsure which backend a drive uses.
revertdiffrevertdiffUNSUPPORTED_OPERATIONagent-fs 采用可插拔存储后端存储文件字节。版本历史、评论和搜索等持久化数据存储在SQLite中,且在所有后端中的工作方式完全一致。
| 后端 | 配置方式 | 版本控制层级 | |
|---|---|---|---|
| S3 / MinIO(默认) | | 完整层级 — 支持通过S3对象版本实现 | 生成真实的预签名URL(公开、限时) |
| 本地文件系统 | | 完整层级 — 通过磁盘上的内容寻址Blob实现 | 回退到带认证的应用内链接(需登录,永不过期) |
两种后端均为完整层级:所有操作(包括和历史)均可正常运行。未来的后端可能为基础层级(无对象版本控制):在此类后端上,和历史不可用,会返回错误(HTTP 422)而非原始存储错误,但当前内容、文件列表、评论和搜索功能仍可正常使用。若不确定驱动器使用的后端类型,请在依赖版本控制功能前检查后端的能力。
revertdiffrevertdiffUNSUPPORTED_OPERATIONQuick Start
快速开始
bash
undefinedbash
undefined1. Set up (local MinIO — requires Docker)
1. 配置(本地MinIO — 需要Docker)
agent-fs onboard -y
agent-fs onboard -y
...or with no Docker/S3 at all — store bytes on the local filesystem:
...或完全不使用Docker/S3 — 将字节存储在本地文件系统:
agent-fs onboard --filesystem # uses ~/.agent-fs/storage
agent-fs onboard --filesystem --storage-root /data/agent-fs # custom dir
agent-fs onboard --filesystem # 使用 ~/.agent-fs/storage
agent-fs onboard --filesystem --storage-root /data/agent-fs # 自定义目录
2. Optionally start the daemon (CLI auto-detects and works without it)
2. 可选:启动守护进程(CLI会自动检测,无需手动操作也可运行)
agent-fs daemon start
agent-fs daemon start
3. Start using it
3. 开始使用
echo "hello world" | agent-fs write docs/readme.txt -m "initial version"
agent-fs cat docs/readme.txt
For custom S3 (AWS, R2, etc.), use flags: `agent-fs onboard --s3-endpoint <url> --s3-bucket <name> --s3-access-key <key> --s3-secret-key <key>`.
The local-filesystem backend (`--filesystem`, equivalently `--storage local`) needs no Docker and no S3 — bytes are stored under `--storage-root` (default `~/.agent-fs/storage`), with every version content-addressed so `revert` and historical `diff` work the same as on S3.echo "hello world" | agent-fs write docs/readme.txt -m "initial version"
agent-fs cat docs/readme.txt
对于自定义S3(AWS、R2等),使用参数:`agent-fs onboard --s3-endpoint <url> --s3-bucket <name> --s3-access-key <key> --s3-secret-key <key>`。
本地文件系统后端(`--filesystem`,等同于`--storage local`)无需Docker和S3,字节存储在`--storage-root`指定的目录下(默认`~/.agent-fs/storage`),每个版本均采用内容寻址,因此`revert`和历史`diff`功能与S3后端完全一致。just-bash Adapter
just-bash 适配器
Use when a environment needs to
read and write through agent-fs as its implementation.
@desplega.ai/agent-fs-just-bashjust-bashfsts
import { Bash } from "just-bash";
import { AgentFsFileSystem } from "@desplega.ai/agent-fs-just-bash";
const fs = new AgentFsFileSystem({
baseUrl: process.env.AGENT_FS_API_URL,
apiKey: process.env.AGENT_FS_API_KEY,
orgId: "org_...",
driveId: "drive_...",
});
const bash = new Bash({ fs, cwd: "/" });The adapter uses for byte-safe reads/writes and for listing and
metadata. Empty directories are represented by a hidden marker;
symlinks are unsupported and throw .
/raw/ops.agent-fs-dirEPERM当环境需要通过agent-fs作为其实现来读写文件时,使用。
just-bashfs@desplega.ai/agent-fs-just-bashts
import { Bash } from "just-bash";
import { AgentFsFileSystem } from "@desplega.ai/agent-fs-just-bash";
const fs = new AgentFsFileSystem({
baseUrl: process.env.AGENT_FS_API_URL,
apiKey: process.env.AGENT_FS_API_KEY,
orgId: "org_...",
driveId: "drive_...",
});
const bash = new Bash({ fs, cwd: "/" });该适配器使用进行字节安全读写,使用进行文件列表和元数据操作。空目录通过隐藏的标记表示;不支持符号链接,会抛出错误。
/raw/ops.agent-fs-dirEPERMEssential Patterns
核心使用模式
-
Use JSON for machine output — passwhen parsing CLI output (except
--jsonwithoutdownload, which writes raw bytes to stdout;-oanddaemon statusprint human-readable text).auth register -
Auto-detection — the CLI automatically detects whether the daemon is running. If it is, commands go via HTTP; otherwise, they use embedded mode directly. No user action needed.
-
Stdin and file upload —accepts raw bytes from stdin or
write, and text from--file;--contentaccepts text via stdin orappend:--contentbash# Preferred for multi-line text echo "content here" | agent-fs write path/to/file.txt # Inline for short content agent-fs write path/to/file.txt --content "short text" # Binary-safe upload agent-fs write assets/screenshot.png --file ./screenshot.png -
Paths — forward-slash separated, no leading slash required. Example:
docs/notes/meeting.md -
Version messages — optional but recommended for auditability:bash
agent-fs write docs/spec.md --content "..." -m "added API section" -
Optimistic concurrency — useon
--expected-versionto prevent conflicts:writebashagent-fs write config.json --content '{}' --expected-version 3 # Fails if file is not at version 3
-
使用JSON作为机器输出 — 解析CLI输出时添加参数(除了不带
--json的-o命令会将原始字节写入标准输出;download和daemon status命令输出人类可读文本)。auth register -
自动检测 — CLI会自动检测守护进程是否运行。若已运行,命令通过HTTP发送;否则直接使用嵌入式模式。无需用户手动干预。
-
标准输入与文件上传 —命令接受来自标准输入或
write的原始字节,以及来自--file的文本;--content命令接受来自标准输入或append的文本:--contentbash# 多行文本推荐方式 echo "content here" | agent-fs write path/to/file.txt # 短内容可直接内联 agent-fs write path/to/file.txt --content "short text" # 二进制安全上传 agent-fs write assets/screenshot.png --file ./screenshot.png -
路径格式 — 使用斜杠分隔,无需前置斜杠。示例:
docs/notes/meeting.md -
版本信息 — 可选但推荐添加,便于审计:bash
agent-fs write docs/spec.md --content "..." -m "added API section" -
乐观并发控制 — 在命令中使用
write参数防止冲突:--expected-versionbashagent-fs write config.json --content '{}' --expected-version 3 # 若文件版本不是3则执行失败
Command Quick Reference
命令速查
File Operations
文件操作
| Command | Usage | Description |
|---|---|---|
| | Write text or binary bytes |
| | Read text file content |
| | Find-and-replace in file |
| | Append to file (stdin or --content) |
| | Last N lines (default: 20) |
| | List directory contents (defaults to /) |
| | Show file metadata (size, version, timestamps) |
| | Recursive directory listing |
| | Find files by pattern ( |
| | Delete a file |
| | Move or rename a file |
| | Copy a file |
| | Generate a download URL. On S3/MinIO: a presigned URL (default 24h, max 7 days, |
| | Download raw bytes |
| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 写入文本或二进制字节 |
| | 读取文本文件内容 |
| | 文件内容查找替换 |
| | 向文件追加内容(标准输入或--content) |
| | 查看文件最后N行(默认20行) |
| | 列出目录内容(默认根目录) |
| | 显示文件元数据(大小、版本、时间戳) |
| | 递归列出目录结构 |
| | 按模式查找文件(如 |
| | 删除文件 |
| | 移动或重命名文件 |
| | 复制文件 |
| | 生成下载URL。在S3/MinIO后端:预签名URL(默认24小时,最长7天, |
| | 下载原始字节 |
Versioning
版本控制
| Command | Usage | Description |
|---|---|---|
| | Show version history |
| | Diff between versions |
| | Revert to a previous version |
logrevertdiffrevertdiffUNSUPPORTED_OPERATIONdiff| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 查看版本历史 |
| | 对比两个版本的差异 |
| | 恢复到指定版本 |
logrevertdiffrevertdiffUNSUPPORTED_OPERATIONdiffSearch & Discovery
搜索与发现
| Command | Usage | Description |
|---|---|---|
| | Regex search in file content |
| | Full-text search (FTS5) across all files |
| | Hybrid search (semantic + keyword, best for general queries) |
| | Vector-only semantic search using embeddings |
| | Recent activity (e.g., |
| | Re-index files with failed/missing embeddings |
When to use which:
- — you know the exact pattern and path (regex)
grep - — keyword search across all files (fast, FTS5-based)
fts - — general-purpose search combining keywords and meaning (recommended default)
search - — pure semantic search when you want conceptual matches only
vec-search
| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 在文件内容中进行正则搜索 |
| | 对所有文件进行全文搜索(基于FTS5) |
| | 混合搜索(语义+关键词,适用于通用查询) |
| | 纯向量语义搜索(使用嵌入模型) |
| | 查看近期活动(如 |
| | 重新索引嵌入失败或缺失的文件 |
各搜索方式适用场景:
- — 知道精确匹配模式和文件路径时使用(正则表达式)
grep - — 对所有文件进行关键词搜索(快速,基于FTS5)
fts - — 通用搜索,结合关键词和语义理解(推荐默认使用)
search - — 纯语义搜索,仅匹配概念相关内容
vec-search
SQL Queries (DuckDB)
SQL查询(DuckDB)
| Command | Usage | Description |
|---|---|---|
| | Run DuckDB SQL over stored documents |
Supported formats: csv, tsv, parquet, xlsx, json, ndjson/jsonl (each also except parquet/xlsx), sqlite (//), and . Reference file-format documents directly by quoted drive path inside the query, or bind any document to a table name with . SQLite/DuckDB databases require a binding and expose their tables as . Append to a binding to query documents with non-standard extensions (e.g. ). Queries are sandboxed — no host filesystem or network access. Results cap at (default 1000, max 10000); in JSON output signals more rows exist.
.gz.db.sqlite.sqlite3.duckdb-t-t<name>.<table>:format-t logs=/raw/data.txt:csv--max-rowstruncated: true| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 对存储的文档运行DuckDB SQL查询 |
支持的格式:csv、tsv、parquet、xlsx、json、ndjson/jsonl(除parquet/xlsx外均支持压缩)、sqlite(//)以及。可在查询中通过带引号的驱动器路径直接引用指定格式的文档,或使用参数将任意文档绑定到表名。SQLite/DuckDB数据库需要使用参数绑定,其表会以形式暴露。在绑定参数后追加可查询非标准扩展名的文档(如)。查询处于沙箱环境中——无法访问主机文件系统或网络。结果行数上限为(默认1000,最大10000);若JSON输出中包含则表示存在更多结果行。
.gz.db.sqlite.sqlite3.duckdb-t-t<name>.<table>:format-t logs=/raw/data.txt:csv--max-rowstruncated: trueComments
评论功能
| Command | Usage | Description |
|---|---|---|
| | Add a comment to a file |
| | Reply to a comment |
| | List comments (with inline replies) |
| | Get a comment with its replies |
| | Update a comment (author only) |
| | Soft-delete a comment (author only) |
| | Resolve a comment |
| | List comment notifications for the current user in the active drive |
| | Mark selected notification event IDs, or all active-drive notifications, as read |
| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 为文件添加评论 |
| | 回复评论 |
| | 列出评论(包含嵌套回复) |
| | 获取单条评论及其回复 |
| | 更新评论(仅作者可操作) |
| | 软删除评论(仅作者可操作) |
| | 标记评论为已解决 |
| | 列出当前用户在活动驱动器中的评论通知 |
| | 将指定通知事件ID或活动驱动器中的所有通知标记为已读 |
Setup & Auth
配置与认证
| Command | Usage | Description |
|---|---|---|
| | Set up agent-fs (storage backend + database + user). |
| | Alias for |
| | Register a new user |
| | Show current user info |
| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 配置agent-fs(存储后端+数据库+用户)。 |
| | |
| | 注册新用户 |
| | 显示当前用户信息 |
Member Management
成员管理
| Command | Usage | Description |
|---|---|---|
| | List org members (use |
| | Invite user to org (viewer/editor/admin) |
| | Update org role (use |
| | Remove from org (use |
The flag is a global option — place it before the subcommand: .
--driveagent-fs --drive <id> member listMember commands are admin-gated: org-scoped commands require org ; drive-scoped commands () require drive or admin of the owning org, and the drive must belong to the current org. Non-admins get a permission error; org/drive IDs outside your memberships return "not found".
admin--drive <id>admin| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 列出组织成员(使用 |
| | 邀请用户加入组织(角色:viewer/editor/admin) |
| | 更新组织用户角色(使用 |
| | 将用户从组织移除(使用 |
--driveagent-fs --drive <id> member list成员管理命令需管理员权限:组织级命令需要组织角色;驱动器级命令()需要驱动器角色或所属组织的管理员权限,且驱动器必须属于当前组织。非管理员用户会收到权限错误;不属于当前用户成员关系的组织/驱动器ID会返回「未找到」。
admin--drive <id>adminDrive Management
驱动器管理
| Command | Usage | Description |
|---|---|---|
| | List drives in current org |
| | Create a new drive (requires org admin) |
| | Show current drive context |
| | Invite user (viewer/editor/admin) |
Drive membership is explicit: shows only drives you're a member of. Creating a drive automatically grants you admin membership on it; other users must be invited per drive (or via org invite, which grants access to the default drive).
drive list| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 列出当前组织中用户所属的驱动器 |
| | 创建新驱动器(需组织管理员权限) |
| | 显示当前驱动器上下文 |
| | 邀请用户加入驱动器(角色:viewer/editor/admin) |
驱动器成员关系为显式设置:仅显示用户所属的驱动器。创建驱动器会自动为创建者赋予管理员权限;其他用户需通过驱动器邀请(或组织邀请,组织邀请会授予默认驱动器访问权限)加入。
drive listConfig & Daemon
配置与守护进程
| Command | Usage | Description |
|---|---|---|
| | Get config value (dot notation: |
| | Set config value |
| | Show all configuration |
| | Check S3, database, auth, embeddings health |
| | Start the background daemon |
| | Stop the daemon |
| | Check if daemon is running |
| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 获取配置值(支持点符号: |
| | 设置配置值 |
| | 显示所有配置项 |
| | 检查S3、数据库、认证、嵌入服务的健康状态 |
| | 启动后台守护进程 |
| | 停止守护进程 |
| | 检查守护进程是否运行 |
FUSE Mount (Linux only)
FUSE挂载(仅Linux)
Expose all org drives as a Linux FUSE filesystem so agents can use plain shell verbs (, , , ) against agent-fs content. Requires and cap; not available on macOS or in gVisor-based sandboxes.
catgrepmvrm/dev/fuseSYS_ADMINTwo topologies are supported:
- Local mode (default): helper talks to a local daemon over a Unix socket. Daemon must be running and have an S3 backend configured.
- Remote mode (): helper talks directly to a remote agent-fs HTTP API. No local daemon required — ideal for sandboxes (sprite, E2B, Hetzner VMs, GitHub Actions runners) that can reach a hosted agent-fs but can't run the full daemon stack.
--remote
FUSE writes require the role or better on the drive — on drives where you're a , the mount is read-only for file writes (writes fail with ; check for the record).
editorviewerEACCES<mount>/.agent-fs/errors.ndjsonPERMISSION_DENIED| Command | Usage | Description |
|---|---|---|
| | Mount drives at |
| | Mount against a remote agent-fs HTTP API. Reads |
| | Unmount the FUSE mountpoint. |
| | Show whether a mount is active and where. |
将所有组织驱动器暴露为Linux FUSE文件系统,使Agent可使用普通Shell命令(、、、)操作agent-fs中的内容。需要设备和权限;macOS或基于gVisor的沙箱环境不支持。
catgrepmvrm/dev/fuseSYS_ADMIN支持两种拓扑结构:
- 本地模式(默认):辅助进程通过Unix套接字与本地守护进程通信。守护进程必须已运行且配置了S3后端。
- 远程模式():辅助进程直接与远程agent-fs HTTP API通信。无需本地守护进程——非常适合可访问托管agent-fs但无法运行完整守护进程栈的沙箱环境(sprite、E2B、Hetzner虚拟机、GitHub Actions运行器等)。
--remote
FUSE写入操作需要驱动器的或更高角色——若用户仅为驱动器的,挂载后的文件系统为只读(写入会返回错误;可查看中的记录)。
editorviewerEACCES<mount>/.agent-fs/errors.ndjsonPERMISSION_DENIED| 命令 | 使用方式 | 描述 |
|---|---|---|
| | 通过本地守护进程将驱动器挂载到 |
| | 挂载远程agent-fs HTTP API。若未指定参数,会从 |
| | 卸载FUSE挂载点。 |
| | 显示挂载是否活跃及挂载位置。 |
Common Workflows
常见工作流
Store and retrieve a document
存储与检索文档
bash
undefinedbash
undefinedWrite a document (multi-line via stdin)
写入文档(通过标准输入传入多行内容)
cat <<'EOF' | agent-fs write reports/q1-summary.md -m "Q1 summary draft"
cat <<'EOF' | agent-fs write reports/q1-summary.md -m "Q1 summary draft"
Q1 Summary
Q1 Summary
Revenue grew 15% quarter over quarter.
EOF
Revenue grew 15% quarter over quarter.
EOF
Read it back
读取文档
agent-fs cat reports/q1-summary.md
agent-fs cat reports/q1-summary.md
Check metadata
查看元数据
agent-fs stat reports/q1-summary.md
undefinedagent-fs stat reports/q1-summary.md
undefinedSearch across files
文件搜索
bash
undefinedbash
undefinedRegex search within a specific path
在指定路径内进行正则搜索
agent-fs grep "revenue|growth" reports/
agent-fs grep "revenue|growth" reports/
Full-text search across all files (FTS5 — fast keyword matching)
对所有文件进行全文搜索(FTS5 — 快速关键词匹配)
agent-fs fts "quarterly revenue"
agent-fs fts "quarterly revenue"
Hybrid search (combines keyword + semantic matching — recommended default)
混合搜索(结合关键词+语义匹配 — 推荐默认使用)
agent-fs search "financial performance metrics" --limit 5
agent-fs search "financial performance metrics" --limit 5
Vector-only semantic search (conceptual matches only)
纯向量语义搜索(仅匹配概念相关内容)
agent-fs vec-search "financial performance metrics" --limit 5
undefinedagent-fs vec-search "financial performance metrics" --limit 5
undefinedQuery data files with SQL
使用SQL查询数据文件
bash
undefinedbash
undefinedQuery a CSV directly by path
通过路径直接查询CSV文件
agent-fs sql "SELECT category, sum(amount) AS total FROM '/finance/2026.csv' GROUP BY category" --json
agent-fs sql "SELECT category, sum(amount) AS total FROM '/finance/2026.csv' GROUP BY category" --json
Join documents of different formats
合并不同格式的文档
agent-fs sql "SELECT s.name, t.tag FROM sales s JOIN tags t ON s.id = t.id"
-t sales=/data/sales.csv -t tags=/data/tags.parquet
-t sales=/data/sales.csv -t tags=/data/tags.parquet
agent-fs sql "SELECT s.name, t.tag FROM sales s JOIN tags t ON s.id = t.id"
-t sales=/data/sales.csv -t tags=/data/tags.parquet
-t sales=/data/sales.csv -t tags=/data/tags.parquet
Query a stored SQLite database (tables exposed as app.<table>)
查询存储的SQLite数据库(表以app.<table>形式暴露)
agent-fs sql "SELECT count(*) FROM app.users" -t app=/backups/app.db
agent-fs sql "SELECT count(*) FROM app.users" -t app=/backups/app.db
Pipe a query via stdin
通过标准输入传入查询语句
echo "SELECT count(*) FROM '/data/events.ndjson'" | agent-fs sql
undefinedecho "SELECT count(*) FROM '/data/events.ndjson'" | agent-fs sql
undefinedReview and revert changes
查看与恢复更改
bash
undefinedbash
undefinedView version history
查看版本历史
agent-fs log docs/spec.md --limit 10
agent-fs log docs/spec.md --limit 10
Compare two versions
对比两个版本的差异
agent-fs diff docs/spec.md --v1 2 --v2 5
agent-fs diff docs/spec.md --v1 2 --v2 5
Revert to version 2
恢复到版本2
agent-fs revert docs/spec.md --version 2
undefinedagent-fs revert docs/spec.md --version 2
undefinedComments and collaboration
评论与协作
bash
undefinedbash
undefinedAdd a comment to a file
为文件添加评论
agent-fs comment add docs/spec.md --body "Needs more detail on auth"
agent-fs comment add docs/spec.md --body "Needs more detail on auth"
Reply to a comment
回复评论
agent-fs comment reply <comment-id> --body "Added in v3"
agent-fs comment reply <comment-id> --body "Added in v3"
List comments
列出评论
agent-fs comment list docs/spec.md
agent-fs comment list docs/spec.md
Check unread notifications (the returned IDs are notification event IDs)
查看未读通知(返回的ID为通知事件ID)
agent-fs comment notifications --unread --limit 20
agent-fs comment notifications --unread --limit 20
Mark selected notifications as read
将指定通知标记为已读
agent-fs comment read <notification-id> [<notification-id>...]
agent-fs comment read <notification-id> [<notification-id>...]
Or acknowledge every notification in the active drive
或标记活动驱动器中的所有通知为已读
agent-fs comment read --all
agent-fs comment read --all
Resolve a comment
标记评论为已解决
agent-fs comment resolve <comment-id>
undefinedagent-fs comment resolve <comment-id>
undefinedSet up a new drive and invite users
创建新驱动器并邀请用户
bash
undefinedbash
undefinedCreate a shared drive
创建共享驱动器
agent-fs drive create "team-docs"
agent-fs drive create "team-docs"
Invite a teammate
邀请团队成员
agent-fs drive invite alice@company.com --role editor
agent-fs drive invite alice@company.com --role editor
Check current drive context
查看当前驱动器上下文
agent-fs drive current
undefinedagent-fs drive current
undefinedManage members
成员管理
bash
undefinedbash
undefinedList org members
列出组织成员
agent-fs member list
agent-fs member list
List drive members
列出驱动器成员
agent-fs --drive <driveId> member list
agent-fs --drive <driveId> member list
Invite a user
邀请用户
agent-fs member invite alice@company.com --role editor
agent-fs member invite alice@company.com --role editor
Change role
更新角色
agent-fs member update-role alice@company.com --role admin
agent-fs member update-role alice@company.com --role admin
Remove from org (cascades to all drives)
从组织移除用户(会同步从所有驱动器移除)
agent-fs member remove alice@company.com
agent-fs member remove alice@company.com
Remove from a specific drive only (keeps org membership)
仅从指定驱动器移除用户(保留组织成员身份)
agent-fs --drive <driveId> member remove alice@company.com
undefinedagent-fs --drive <driveId> member remove alice@company.com
undefinedCheck recent activity
查看近期活动
bash
undefinedbash
undefinedWhat changed in the last hour?
查看过去1小时内的更改
agent-fs recent --since 1h
agent-fs recent --since 1h
Recent changes under a specific path
查看指定路径下过去24小时内的近期更改
agent-fs recent docs/ --since 24h --limit 20
undefinedagent-fs recent docs/ --since 24h --limit 20
undefinedGenerate a shareable download link
生成可共享的下载链接
bash
undefinedbash
undefinedDefault expiry (24 hours)
默认过期时间(24小时)
agent-fs signed-url docs/report.pdf
agent-fs signed-url docs/report.pdf
Custom expiry (1 hour)
自定义过期时间(1小时)
agent-fs signed-url docs/report.pdf --expires-in 3600
agent-fs signed-url docs/report.pdf --expires-in 3600
JSON output (useful for agents)
JSON输出(适合Agent使用)
agent-fs signed-url docs/report.pdf --json
agent-fs signed-url docs/report.pdf --json
→ { "url": "https://...", "path": "/docs/report.pdf", "expiresIn": 86400, "expiresAt": "2026-03-20T..." }
→ { "url": "https://...", "path": "/docs/report.pdf", "expiresIn": 86400, "expiresAt": "2026-03-20T..." }
On an S3/MinIO backend (`kind: "presigned"`) the URL requires no authentication — anyone with the link can download the file until it expires. Access is RBAC-checked only at generation time (viewer-or-better on the drive); after that the URL is a bearer secret. Don't log it or paste it anywhere you wouldn't paste a credential, and prefer the shortest workable `--expires-in`. Signed URLs serve the correct `Content-Type` header based on file extension (e.g., `application/pdf` for `.pdf`, `image/png` for `.png`), so browsers render them natively.
On a backend without presigned URLs (the local-filesystem backend), `signed-url` does **not** fail — it falls back to an authenticated in-app link (`kind: "app"`, `expiresIn: 0`) of the form `<appUrl>/file/~/<org>/<drive>/<path>`. Unlike a presigned URL this link is **not** a public bearer secret: the daemon's `/raw` route and the web viewer require sign-in, so the recipient must be an authenticated member of the drive. Set `AGENT_FS_APP_URL` (or `appUrl` in config) so the link points at your deployment.
**MIME types on upload:** `write`, `edit`, `append`, and `revert` automatically detect and set the correct `Content-Type` on S3 objects based on file extension. The content type is also stored in the database and visible in `stat` output via the `contentType` field. Raw stdin and `--file` uploads preserve bytes exactly; text search/indexing is applied only when the payload is valid, indexable UTF-8 text.
在S3/MinIO后端(`kind: "presigned"`)生成的URL无需认证——任何人持有链接均可下载文件,直到链接过期。仅在生成URL时会进行RBAC权限检查(需驱动器的viewer或更高角色);生成后URL即为公开密钥。请勿记录或粘贴到任何可能泄露凭证的地方,建议使用尽可能短的`--expires-in`时间。预签名URL会根据文件扩展名设置正确的`Content-Type`头(如`.pdf`对应`application/pdf`,`.png`对应`image/png`),因此浏览器可直接渲染文件。
在不支持预签名URL的后端(本地文件系统后端),`signed-url`命令不会失败——会回退到带认证的应用内链接(`kind: "app"`,`expiresIn: 0`),格式为`<appUrl>/file/~/<org>/<drive>/<path>`。与预签名URL不同,此链接**不是**公开密钥:守护进程的`/raw`路由和Web查看器需要登录,因此接收者必须是驱动器的已认证成员。设置`AGENT_FS_APP_URL`(或配置中的`appUrl`)可使链接指向你的部署实例。
**上传时的MIME类型:** `write`、`edit`、`append`和`revert`命令会根据文件扩展名自动检测并设置S3对象的正确`Content-Type`。内容类型也会存储在数据库中,可通过`stat`输出的`contentType`字段查看。通过标准输入和`--file`上传的原始字节会被精确保留;仅当内容为有效的可索引UTF-8文本时才会应用文本搜索和索引。App URL in responses
响应中的应用URL
When is set (e.g., ), file-related ops automatically include an field pointing to the file in the live web app:
AGENT_FS_APP_URLhttps://live.agent-fs.devappUrlbash
AGENT_FS_APP_URL=https://live.agent-fs.dev agent-fs stat docs/report.pdf --json当设置(如)时,文件相关操作会自动包含字段,指向Web应用中的文件:
AGENT_FS_APP_URLhttps://live.agent-fs.devappUrlbash
AGENT_FS_APP_URL=https://live.agent-fs.dev agent-fs stat docs/report.pdf --json→ { ..., "appUrl": "https://live.agent-fs.dev/file/~/org-id/drive-id/docs/report.pdf" }
→ { ..., "appUrl": "https://live.agent-fs.dev/file/~/org-id/drive-id/docs/report.pdf" }
This applies to any op that returns a `path` or `to` field (write, stat, edit, append, rm, cp, mv, signed-url, etc.).
此规则适用于所有返回`path`或`to`字段的操作(write、stat、edit、append、rm、cp、mv、signed-url等)。Validate your setup
验证配置
bash
agent-fs config validatebash
agent-fs config validateMount a remote drive from a sandbox
从沙箱挂载远程驱动器
Use when the agent is running in a Linux sandbox (sprite, E2B, Hetzner VM, GitHub Actions runner, etc.) that can reach a hosted agent-fs HTTP API but cannot run the full daemon + S3 stack locally.
--remotebash
undefined当Agent运行在可访问托管agent-fs HTTP API但无法在本地运行完整守护进程+S3栈的Linux沙箱环境(sprite、E2B、Hetzner虚拟机、GitHub Actions运行器等)时,使用参数。
--remotebash
undefinedLinux prereqs (run once per sandbox)
Linux前置依赖(每个沙箱运行一次)
sudo apt-get install -y fuse3
sudo chmod 666 /dev/fuse
sudo ln -sf /proc/mounts /etc/mtab
echo user_allow_other | sudo tee -a /etc/fuse.conf
sudo apt-get install -y fuse3
sudo chmod 666 /dev/fuse
sudo ln -sf /proc/mounts /etc/mtab
echo user_allow_other | sudo tee -a /etc/fuse.conf
Auth — either env vars or ~/.agent-fs/config.json
认证 — 使用环境变量或~/.agent-fs/config.json
export AGENT_FS_API_URL=https://agent-fs.example.com
export AGENT_FS_API_KEY=<key>
export AGENT_FS_API_URL=https://agent-fs.example.com
export AGENT_FS_API_KEY=<key>
Mount — no local daemon needed
挂载 — 无需本地守护进程
mkdir -p ~/mnt
agent-fs mount ~/mnt --remote
mkdir -p ~/mnt
agent-fs mount ~/mnt --remote
Use plain shell verbs against remote content
使用普通Shell命令操作远程内容
ls ~/mnt
cat ~/mnt/current/docs/spec.md
echo "edit from sandbox $(date)" > ~/mnt/current/notes.txt
ls ~/mnt
cat ~/mnt/current/docs/spec.md
echo "edit from sandbox $(date)" > ~/mnt/current/notes.txt
Unmount
卸载
fusermount3 -u ~/mnt
See `docs/mounting/` for per-environment guides (sprite, E2B, Hetzner).fusermount3 -u ~/mnt
更多环境相关指南请查看`docs/mounting/`目录(sprite、E2B、Hetzner)。