# @agentdocumentformat/cli 中文文档

规范地址：https://npmcn.com/package/%40agentdocumentformat/cli/

版本：0\.8\.8
npm 元数据更新时间：2026-11-05T22:33:21.171Z
中文译文更新时间：2026-11-08T09:33:03.762Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40agentdocumentformat/cli
原文对照：https://npmcn.com/package/%40agentdocumentformat/cli/?lang=original
项目主页：https://github.com/christianbalevski/adf#readme
源码仓库：https://github.com/christianbalevski/adf

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：45.8 MB，240 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：^22\.23\.4 \|\| ^24\.22\.1 \|\| ^26\.12\.1
- 运行依赖：8 个
- 首次发布：2026-09-29T03:04:17.010Z
- 最新版本发布：2026-11-05T22:33:20.841Z
- 近 30 天下载量：1832（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：16（近 12 个月 16 个）

## 中文简介

ADF CLI: ADF(代理文档格式)守护进程,命令行和终端应用. 运行您的特工无头: `adf daemon`,则 `adf`。 。 。 .

## 安装

```sh
npm install @agentdocumentformat/cli
```

也可以使用：`pnpm add @agentdocumentformat/cli`、`yarn add @agentdocumentformat/cli`、`bun add @agentdocumentformat/cli`

## README

# @ agentdocumentformat/ cli (英语)

这个 **民主同盟军CLI**: 从终端运行 ADF (代理文档格式) 代理服务器, 并 没有桌面应用程序 。 一个ADF代理是单一的 `.adf` 文件: 配置、 内存、 文件 和一个便携式文件中的历史。 关于桌面应用程序,ADF Studio,参见 页:1 [释放](https://github.com/christianbalevski/adf/releases)。 。 。 .

-   `adf`页:1 **终端应用程序**。您在一个屏幕中的代理机群:与 任何代理或任何循环,批准工具呼叫,编辑文件,时间表 内环(边环),看活事件.
-   `adf web`数字 : **浏览器工作室**,使用共享桌面渲染器。 可用 在包含浏览器支持的构建中; 已发布的npm v0.8.3不包含它.
-   `adf <command>`: 脚本的一发命令( s)`adf help`) (中文(简体) ).
-   `adf daemon`: 运行代理的背景守护进程 . `adf` 开始 为你准备的;退出后它会继续运行.

## 安装

当前 `main` 需要节点.js `^22.23.4 || ^24.22.1 || ^26.12.1`· ; `adf` 由于CVE-2026-111497和27+,拒绝提前释放和23.x/25.x 直到测试。 已发布 npm v0.8.3 声明 `>=22` 并先于此支票. 见 [节点.js 版本](https://github.com/christianbalevski/adf/blob/main/docs/cli/index.md#nodejs-versions)。 。 。 . 本地模块( SQLite, OS keychain) 来了 为Windows, macOS(arm64, x64)和Linux(x64, arm64, glibc)预建.

```bash
npm i -g @agentdocumentformat/cli
adf
```

`EEXIST` 安装? 首先删除旧软件包 : `npm uninstall -g agent-document-format`。 。 。 .

升级 : `npm i -g @agentdocumentformat/cli@latest`,则 `adf daemon restart`。 。 。 .

## 浏览器工作室

使用浏览器启用的 CLI 和守护进程构建 :

```bash
adf web                   # start the local daemon if needed and open the browser
adf web --port 7485        # choose another local daemon port
adf web --no-daemon        # use an already-running daemon
```

浏览器通过一个短寿命的单用链接来签名. 没有桌面应用程序或 需要手动复制符号. `adf web` 只有本地设备;对于另一个设备, 在守护进程主机上运行这些命令 :

```bash
adf daemon remote on
adf daemon remote status
adf daemon remote allow-network <network-id-or-name>   # if not already allowed
adf daemon pair
```

打开打印 `/studio/` 在另一个设备上的地址,输入六位数 代码和一个浏览器名称,然后在主机终端中批准该请求. Paired 浏览器被记住最多30天;浏览器会话持续了8天 小时。 签了字就清除了记忆中的证书 取消访问权限 `adf daemon devices revoke <id-or-label>`。 。 。 .

这些指令描述浏览器启用的构建, 未发布 npm v0.8.3. 从源检出,使用 `npm run build:web` 接下来是 `npm run adf -- web`· ; `npm run build:npm` 以 CLI(英语:CLI). 见 [浏览器工作室指南](https://github.com/christianbalevski/adf/blob/main/docs/guides/studio-web.md) 用于源设置,网络访问和浏览器限制.

## 本地模式

使用 Ollama、 LM Studio 或任何执行 OpenAI 兼容的服务器 聊天API. 服务器和所选模型都需要调用代理工具 工具。 只有当模型必须理解图像或截图时,才需要视觉。 添加服务器为 `/provider add`,使用它的 API 基础 URL 和 型号 ID;只有在 服务器需要一个。 见 [当地示范要求](https://github.com/christianbalevski/adf/blob/main/docs/cli/models-and-providers.md#local-model-requirements)。 。 。 .

## 快速启动

在终端应用程序中( 首发时打开一个欢迎清单):

```text
/identity create        # your owner identity: 12 words, the same as in ADF Studio
/login chatgpt          # or /login grok, /login claude, or /provider add for an API key
/new                    # create an agent; its chat opens
/loop new consolidator  # optional: an inner loop that tidies memory nightly
```

或有一发一发之令:

```bash
adf identity new
adf auth login chatgpt
adf new agent-1 --start
adf chat agent-1 "hello"
adf events agent-1
```

守护进程 : `adf daemon status | stop | restart | logs -f | token`当前 `main`,本地模式的工作室和 CLI 共享一个守护进程,设置和所有者 身份,可以并肩运行. 与内部工作室(Legacy), `adf` 拒绝在 Studio 运行时在同一设置上启动守护进程; 切换 工作室到本地模式或先退出 .

## 文档

-   [民主同盟军CLI](https://github.com/christianbalevski/adf/blob/main/docs/cli/index.md)
-   [开始](https://github.com/christianbalevski/adf/blob/main/docs/cli/getting-started.md)
-   [浏览器工作室](https://github.com/christianbalevski/adf/blob/main/docs/guides/studio-web.md) (浏览器驱动的建筑)
-   [终端应用程序](https://github.com/christianbalevski/adf/blob/main/docs/cli/terminal-app.md)
-   [参考文献](https://github.com/christianbalevski/adf/blob/main/docs/cli/reference.md): 每个命令、旗帜、斜线命令和密钥
-   [远程守护进程](https://github.com/christianbalevski/adf/blob/main/docs/cli/remote-daemon.md)
-   [解决问题](https://github.com/christianbalevski/adf/blob/main/docs/cli/troubleshooting.md)
-   [守护进程 HTTP API](https://github.com/christianbalevski/adf/blob/main/docs/daemon/http-api.md)

## 许可证

麻省理工学院

## 常见问题

### @agentdocumentformat/cli 是什么？

ADF CLI: ADF\(代理文档格式\)守护进程,命令行和终端应用\. 运行您的特工无头: adf daemon,则 adf。 。 。 \.

### 如何安装 @agentdocumentformat/cli？

在项目目录运行 npm install @agentdocumentformat/cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 adf，可以用 npx adf 直接运行。

### @agentdocumentformat/cli 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/agentdocumentformat\_\_cli 是否存在。

### @agentdocumentformat/cli 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @agentdocumentformat/cli 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js ^22\.23\.4 \|\| ^24\.22\.1 \|\| ^26\.12\.1。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @agentdocumentformat/cli 可以商用吗？

@agentdocumentformat/cli 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @agentdocumentformat/cli 的下载量有多少？

根据 npm 官方下载统计，@agentdocumentformat/cli 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,832 次，日均约 61 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @agentdocumentformat/cli 还在维护吗？

最新版本 0\.8\.8 发布于 2026/11/06（2 天前）；至今共发布 16 个版本，其中过去 12 个月发布了 16 个；首次发布于 2026/09/29。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

