# @bunny-agent/runner-cli 中文文档

规范地址：https://npmcn.com/package/%40bunny-agent/runner-cli/

版本：0\.10\.3-beta1
npm 元数据更新时间：2026-11-07T00:48:59.929Z
中文译文更新时间：2026-11-08T20:02:03.445Z
软件包许可：Apache-2\.0

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

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

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

- 包体积（解压后）：2 MB，48 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=20\.19\.0
- 运行依赖：13 个
- 首次发布：2026-04-14T06:44:28.517Z
- 最新版本发布：2026-11-07T00:48:59.745Z
- 近 30 天下载量：3381（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：115（近 12 个月 115 个）

## 中文简介

Bunny Agent Runner CLI - 如Gemini-cli或claude-code,在您本地终端运行,并使用AI SDK UI流线

## 安装

```sh
npm install @bunny-agent/runner-cli
```

也可以使用：`pnpm add @bunny-agent/runner-cli`、`yarn add @bunny-agent/runner-cli`、`bun add @bunny-agent/runner-cli`

## README

# @bunny-agent/runner-cli (英语)

Bunny探员跑步者CLI - A **轻型, 当地** 用于在您的终端运行AI代理的命令行界面.

和Gemini-cli, Claude-code, 或codex-cli一样,这个工具运行 **直接在本地文件系统中**它有两个子命令,每个输出协议一个: `run` 串流 AI SDK UI 消息用于单项任务的 stdout,以及 `acp` 长生不老 [代理客户协议](https://agentclientprotocol.com/) zed和JetBrains等编辑的特工.

## 关键特性

-   🔌 **选择不同的运行者**: Claude、Codex、双子座、副驾驶之间切换 `--runner` 旗帜
-   🚀 **本地执行**: 直接运行在您的文件系统中,不需要沙盒
-   💨 **轻巧**: 没有管理人员的依赖性,间接费用最低
-   📡 **流线**: 实时 AI SDK UI 流线(`run`或非加太JSON-RPC 超过 stdio(`acp`(中文(简体) )

## 建筑

```
runner-cli
  ├─ run  → @bunny-agent/runner-harness → runner-claude / runner-codex / ...
  └─ acp  → @bunny-agent/server-acp     → runner-harness → same runners

Dependencies:
✅ @bunny-agent/runner-harness (dispatches to every runner)
✅ @bunny-agent/server-acp (the `acp` subcommand's ACP agent + stdio transport)
❌ NO @bunny-agent/manager
❌ NO @bunny-agent/sandbox-*
```

**与管理者- cli 的区别 :**

-   `runner-cli`: 本地文件系统, 不隔离, 轻量级, 直接跑道使用
-   `manager-cli`: 沙箱执行,使用管理器+沙箱适配器+跑取器

## 安装

```bash
# Global install (recommended if you want the `bunny-agent` command)
npm install -g @bunny-agent/runner-cli@latest

# Or add to a project
npm install @bunny-agent/runner-cli@latest
```

## 使用量

```bash
bunny-agent run [options] -- "<user input>"
```

不在全球安装,您也可以通过 `npx`数字 :

```bash
npx -y @bunny-agent/runner-cli@latest run -- "Create a hello world script"
```

### 基本实例

```bash
# Using Claude (default)
bunny-agent run -- "Create a hello world script"

# Explicitly choose Claude
bunny-agent run --runner claude -- "Create a hello world script"

# Using Codex
bunny-agent run --runner codex -- "Build a REST API with Express"

# Using Gemini
bunny-agent run --runner gemini -- "Build a REST API with Express"

# Using GitHub Copilot
bunny-agent run --runner copilot -- "Refactor this code"

# With custom system prompt
bunny-agent run --runner claude --system-prompt "You are a coding assistant" -- "Build a REST API with Express"
```

## 选项

| 选项 | 短数 | 说明 | 默认 |
| --- | --- | --- | --- |
| `--runner <runner>` | `-r` | 要使用的运行器 : `claude`, (中文(简体) ), `codex`, (中文(简体) ), `gemini`, (中文(简体) ), `opencode`, (中文(简体) ), `copilot`, (中文(简体) ), `pi` | `claude` |
| `--model <model>` | `-m` | 要使用的模型 | `claude-sonnet-4-20250514` |
| `--cwd <path>` | `-c` | 工作目录 | 当前目录 |
| `--system-prompt <prompt>` | `-s` | 自定义系统提示 | \- 说吧 |
| `--max-turns <n>` | `-t` | 最大对话回合 | \- 说吧 |
| `--allowed-tools <tools>` | `-a` | 以逗号分隔的允许工具列表 | \- 说吧 |
| `--yolo` | \- 说吧 | 自动批准工具权限请求 | `false` |
| `--effort <level>` | \- 说吧 | 合理努力或思维水平,取决于跑者 | \- 说吧 |
| `--resume <session-id>` | \- 说吧 | 恢复上届会议 | \- 说吧 |
| `--help` | `-h` | 显示帮助消息 | \- 说吧 |

`--allowed-tools` 限制内置跑道工具。 提供自定义工具 通过SDK `streamText({ tools })` API,不是直接通过跑道-cli.

## 输出格式

`bunny-agent run` 总是输出AI SDK数据流(SSE)格式,一发- 它运行的任务和出口.

```bash
bunny-agent run -- "Calculate 2+2"
```

**输出 :**

```
data: {"type":"start","messageId":"msg_123"}
data: {"type":"text-delta","id":"text_1","delta":"The answer is 4."}
data: [DONE]
```

对于非加太议定书,使用 `bunny-agent acp` - 见下文。 两个是 单独的子命令, 而不是旗子 `run`:非加太是长时期的会话 (单位:千美元)`initialize` → `session/new` 可能有许多人 `session/prompt` 来自 连接编辑器),而不是一个请求/答复.

## `bunny-agent acp`

担任兔子代理 [代理客户协议](https://agentclientprotocol.com/) **代理人** 运输编辑器在生产毒剂时使用 二进制直接,例如Zed的"客户代理"设置或JetBrains的AI助手 代理整合。 处理JSON -RPC的程序依然有效 stdin/ stdout 直到连接客户端断开; 它不需要一个 任务参数如 `run` 已经.

```bash
bunny-agent acp --runner claude
bunny-agent acp --runner pi --model gemini-2.0-flash --cwd ./my-project
```

| 选项 | 短数 | 说明 | 默认 |
| --- | --- | --- | --- |
| `--runner <runner>` | `-r` | 要使用的运行器 : `claude`, (中文(简体) ), `codex`, (中文(简体) ), `gemini`, (中文(简体) ), `opencode`, (中文(简体) ), `copilot`, (中文(简体) ), `pi` | `claude` |
| `--model <model>` | `-m` | 要使用的模型 | `claude-sonnet-4-20250514` |
| `--cwd <path>` | `-c` | 工作目录 | 当前目录 |
| `--yolo` | \- 说吧 | 自动批准工具权限请求 | `false` |
| `--help` | `-h` | 显示帮助消息 | \- 说吧 |

这些旗帜设置了 **默认会话**. 非加太国家 `session/new` 没有本地人 运行/ 模型字段, 这样连接客户端仍然可以覆盖每个会话 通过协议 `_meta` 扩展名, 名称空格 `"bunny-agent"`数字 :

```json
{ "cwd": "/workspace", "mcpServers": [],
  "_meta": { "bunny-agent": { "runner": "pi", "model": "gemini-2.0-flash" } } }
```

将非CAP客户端指向 CLI 本身作为代理命令( 精确 ) 配置是针对客户的 — 见每个编辑的 ACP Docs :

```json
{ "command": "bunny-agent", "args": ["acp", "--runner", "claude"] }
```

相当于HTTP的`POST /api/coding/acp`,由守护进程代替使用 产入子进程,见 [`apps/daemon/README.md`](https://npmcn.com/package/%40bunny-agent/daemon/README.md#post-apicodingacp)两者都是 由 `@bunny-agent/server-acp` 并且支持这个CLI的每一个跑者.

## 环境变量

| 变量 | 说明 | 需求 |
| --- | --- | --- |
| `ANTHROPIC_API_KEY` | Anthropic API 密钥( 克劳德跑车) | 没有 |
| `OPENAI_API_KEY` 或者说 `CODEX_API_KEY` | OpenAI API 密钥( Codex 运行器) | 没有 |
| `GEMINI_API_KEY` | 双子座 API 键( Gemini 跑者) | 没有 |
| `GITHUB_TOKEN` 或者说 `GH_TOKEN` | GitHub 令牌( 副驾驶长); 返回登录的副驾驶用户 | 没有 |
| `BUNNY_AGENT_WORKSPACE` | 默认工作空间路径 | 没有 |
| `BUNNY_AGENT_LOG_LEVEL` | 日志级别( 调试、 信息、 警告、 错误) | 没有 |

## 高级示例

### 指定工作目录

```bash
bunny-agent run --cwd ./my-project -- "Fix the bug in main.ts"
```

### 组合选项

```bash
bunny-agent run \
  -m claude-sonnet-4-20250514 \
  --system-prompt "You are a helpful coding assistant" \
  --max-turns 10 \
  -- "Build a REST API"
```

## 建筑

国家倡议旨在:

1.  在特定工作目录中执行
2.  装入设置从 `.claude/settings.json` 财务报告和审定财务报表 `CLAUDE.md` 在项目中
3.  将 AI SDK UI 信件直接流到 stdout
4.  输出 AI SDK 数据流格式

## +++ Docker 图像构建

用代理模板在 :

```bash
# Build image
bunny-agent image build --name vikadata/bunny-agent-seo --tag 0.1.0 --template ./templates/seo-agent

# Build and push
bunny-agent image build --name vikadata/bunny-agent-seo --tag 0.1.0 --template ./templates/seo-agent --push

# Without template
bunny-agent image build --name vikadata/bunny-agent --tag 0.1.0
```

### 图像构建选项

| 选项 | 说明 | 默认 |
| --- | --- | --- |
| `--name <name>` | 全图像名( 如. `vikadata/bunny-agent-seo`(中文(简体) ) | `bunny-agent` |
| `--tag <tag>` | 图像标签 | `latest` |
| `--image <full>` | 完整图像名称覆盖( 例如 ). `myorg/myimage:v1`(中文(简体) ) | \- 说吧 |
| `--platform <plat>` | 构建平台 | `linux/amd64` |
| `--template <path>` | 代理模板目录路径 | \- 说吧 |
| `--push` | 构建后将图像推向注册 | `false` |

## 相关文档

-   [技能](https://npmcn.com/package/%40bunny-agent/runner-cli/docs/SKILLS.md) - 技能所在和装载方式(当地和多克)
-   [克劳德探员SDK](https://platform.claude.com/docs/agent-sdk/typescript)
-   [AI SDK UI流协议](https://ai-sdk.dev/docs/ai-sdk-ui/stream-protocol)
-   [代理客户协议](https://agentclientprotocol.com/) - 议定书 `bunny-agent acp` 说话
-   [运行器成熟度/ 输出协议](https://npmcn.com/package/docs/runner-maturity.md#output-protocols) - 怎么样 `run` 财务报告和审定财务报表 `acp` 比较

## 常见问题

### @bunny-agent/runner-cli 是什么？

Bunny Agent Runner CLI - 如Gemini-cli或claude-code,在您本地终端运行,并使用AI SDK UI流线

### 如何安装 @bunny-agent/runner-cli？

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

### @bunny-agent/runner-cli 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @bunny-agent/runner-cli 支持 ESM 还是 CommonJS？

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

### @bunny-agent/runner-cli 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=20\.19\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @bunny-agent/runner-cli 可以商用吗？

@bunny-agent/runner-cli 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @bunny-agent/runner-cli 的下载量有多少？

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

### @bunny-agent/runner-cli 还在维护吗？

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

