claude-code-runner 0.2.13 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,11 +7,27 @@
7
7
  > - This work is alpha and might have security issues, use at your own risk.
8
8
  > - Email [admin@soraharu.com](mailto:admin@soraharu.com) for inquiries.
9
9
 
10
- Run Claude Code as an autonomous agent inside Docker containers with automatic GitHub integration. Bypass all permissions safely.
10
+ Run Claude Code, OpenCode, Codex, Kimi Code, or Qwen Code as an autonomous agent inside Docker containers with automatic GitHub integration. Bypass all permissions safely.
11
+
12
+ ## Supported Code Runners
13
+
14
+ Claude Code Runner supports multiple AI coding assistants:
15
+
16
+ | Runner | Command | Description |
17
+ |--------|---------|-------------|
18
+ | **Claude Code** | `claude-run` | Anthropic's official Claude Code CLI |
19
+ | **OpenCode** | `claude-run --runner opencode` | Open-source alternative with multi-provider support |
20
+ | **Codex** | `claude-run --runner codex` | OpenAI's Codex CLI |
21
+ | **Kimi Code** | `claude-run --runner kimi` | Moonshot AI's Kimi Code CLI |
22
+ | **Qwen Code** | `claude-run --runner qwen` | Alibaba's Qwen Code CLI |
23
+
24
+ You can switch between runners using:
25
+ - **CLI flag**: `--runner claude`, `--runner opencode`, `--runner codex`, `--runner kimi`, or `--runner qwen`
26
+ - **Config file**: Set `"codeRunner": "codex"` (or `"kimi"`, `"qwen"`, etc.) in `claude-run.config.json`
11
27
 
12
28
  ## Why Claude Code Runner?
13
29
 
14
- The primary goal of Claude Code Runner is to enable **full async agentic workflows** by allowing Claude Code to execute without permission prompts. By running Claude in an isolated Docker container with the `--dangerously-skip-permissions` flag, Claude can:
30
+ The primary goal of Claude Code Runner is to enable **full async agentic workflows** by allowing Claude Code, OpenCode, Codex, Kimi Code, or Qwen Code to execute without permission prompts. By running the code assistant in an isolated Docker container with dangerous/auto-approve mode flags, the AI can:
15
31
 
16
32
  - Execute any command instantly without asking for permission
17
33
  - Make code changes autonomously
@@ -19,14 +35,14 @@ The primary goal of Claude Code Runner is to enable **full async agentic workflo
19
35
  - Create commits and manage git operations
20
36
  - Work continuously without interrupting the user
21
37
 
22
- Access Claude through a **browser-based terminal** that lets you monitor and interact with the AI assistant while you work on other tasks. This creates a truly autonomous development assistant, similar to [OpenAI Codex](https://chatgpt.com/codex) or [Google Jules](https://jules.dev), but running locally on your machine with full control.
38
+ Access the code assistant through a **browser-based terminal** that lets you monitor and interact with the AI assistant while you work on other tasks. This creates a truly autonomous development assistant, similar to [OpenAI Codex](https://chatgpt.com/codex) or [Google Jules](https://jules.dev), but running locally on your machine with full control.
23
39
 
24
40
  ## Overview
25
41
 
26
- Claude Code Runner allows you to run Claude Code in isolated Docker containers, providing a safe environment for AI-assisted development. It automatically:
42
+ Claude Code Runner allows you to run Claude Code, OpenCode, Codex, Kimi Code, or Qwen Code in isolated Docker containers, providing a safe environment for AI-assisted development. It automatically:
27
43
 
28
44
  - Creates a new git branch for each session
29
- - Monitors for commits made by Claude
45
+ - Monitors for commits made by the AI assistant
30
46
  - Provides interactive review of changes
31
47
  - Handles credential forwarding securely
32
48
  - Enables push/PR creation workflows
@@ -102,6 +118,18 @@ The following commands are shortcuts for `claude-run`:
102
118
 
103
119
  - `clauderun`
104
120
  - `ccrun`
121
+ - `ocrun` (OpenCode alias)
122
+ - `opencoderun` (OpenCode alias)
123
+ - `opencode-run` (OpenCode alias)
124
+ - `cxrun` (Codex alias)
125
+ - `codexrun` (Codex alias)
126
+ - `codex-run` (Codex alias)
127
+ - `kmrun` (Kimi Code alias)
128
+ - `kimirun` (Kimi Code alias)
129
+ - `kimi-run` (Kimi Code alias)
130
+ - `qwrun` (Qwen Code alias)
131
+ - `qwenrun` (Qwen Code alias)
132
+ - `qwen-run` (Qwen Code alias)
105
133
 
106
134
  #### `claude-run` (default)
107
135
 
@@ -111,6 +139,62 @@ Start a new container with web UI (recommended):
111
139
  claude-run
112
140
  ```
113
141
 
142
+ #### Using OpenCode
143
+
144
+ To use OpenCode instead of Claude Code:
145
+
146
+ ```bash
147
+ # Via CLI flag
148
+ claude-run --runner opencode
149
+
150
+ # Or use OpenCode aliases
151
+ ocrun
152
+ opencoderun
153
+ opencode-run
154
+ ```
155
+
156
+ #### Using Codex
157
+
158
+ To use OpenAI Codex:
159
+
160
+ ```bash
161
+ # Via CLI flag
162
+ claude-run --runner codex
163
+
164
+ # Or use Codex aliases
165
+ cxrun
166
+ codexrun
167
+ codex-run
168
+ ```
169
+
170
+ #### Using Kimi Code
171
+
172
+ To use Moonshot AI's Kimi Code:
173
+
174
+ ```bash
175
+ # Via CLI flag
176
+ claude-run --runner kimi
177
+
178
+ # Or use Kimi Code aliases
179
+ kmrun
180
+ kimirun
181
+ kimi-run
182
+ ```
183
+
184
+ #### Using Qwen Code
185
+
186
+ To use Alibaba's Qwen Code:
187
+
188
+ ```bash
189
+ # Via CLI flag
190
+ claude-run --runner qwen
191
+
192
+ # Or use Qwen Code aliases
193
+ qwrun
194
+ qwenrun
195
+ qwen-run
196
+ ```
197
+
114
198
  #### `claude-run start`
115
199
 
116
200
  Explicitly start a new container with options:
@@ -121,6 +205,8 @@ claude-run start [options]
121
205
  Options:
122
206
  -c, --config <path> Configuration file (default: ./claude-run.config.json)
123
207
  -n, --name <name> Container name prefix
208
+ --runner <runner> Code runner to use: 'claude', 'opencode', 'codex', 'kimi', or 'qwen'
209
+ --shell <shell> Shell to start with: 'claude', 'opencode', 'codex', 'kimi', 'qwen', or 'bash'
124
210
  --no-web Disable web UI (use terminal attach)
125
211
  --no-push Disable automatic branch pushing
126
212
  --no-pr Disable automatic PR creation
@@ -261,6 +347,8 @@ Create a `claude-run.config.json` file (see `claude-run.config.example.json` for
261
347
  - `autoPush`: Automatically push branches after commits
262
348
  - `autoCreatePR`: Automatically create pull requests
263
349
  - `autoStartClaude`: Start Claude Code automatically (default: true)
350
+ - `codeRunner`: Which code runner to use: `"claude"`, `"opencode"`, `"codex"`, `"kimi"`, or `"qwen"` (default: `"claude"`)
351
+ - `defaultShell`: Shell to start with: `"claude"`, `"opencode"`, `"codex"`, `"kimi"`, `"qwen"`, or `"bash"` (default: matches `codeRunner`)
264
352
  - `envFile`: Load environment variables from file (e.g., `.env`)
265
353
  - `environment`: Additional environment variables
266
354
  - `setupCommands`: Commands to run after container starts (e.g., install dependencies)
@@ -271,6 +359,10 @@ Create a `claude-run.config.json` file (see `claude-run.config.example.json` for
271
359
  - `bashTimeout`: Timeout for bash commands in milliseconds
272
360
  - `containerPrefix`: Custom prefix for container names
273
361
  - `claudeConfigPath`: Path to Claude configuration file
362
+ - `opencodeConfigPath`: Path to OpenCode configuration file (default: `~/.config/opencode/opencode.json`)
363
+ - `codexConfigPath`: Path to Codex configuration directory (default: `~/.codex`)
364
+ - `kimiConfigPath`: Path to Kimi Code configuration directory (default: `~/.kimi`)
365
+ - `qwenConfigPath`: Path to Qwen Code configuration directory (default: `~/.qwen`)
274
366
  - `dockerSocketPath`: Custom Docker/Podman socket path (auto-detected by default)
275
367
  - `forwardSshKeys`: Forward SSH keys from `~/.ssh` to container (default: true)
276
368
  - `forwardGpgKeys`: Forward GPG keys from `~/.gnupg` to container (default: true)
@@ -278,6 +370,126 @@ Create a `claude-run.config.json` file (see `claude-run.config.example.json` for
278
370
  - `forwardGpgAgent`: Forward GPG agent for passphrase-protected GPG keys (default: false, requires explicit enabling)
279
371
  - `enableGpgSigning`: Enable GPG commit signing in container (default: false)
280
372
 
373
+ #### OpenCode Configuration
374
+
375
+ To use OpenCode instead of Claude Code, create a config file with:
376
+
377
+ ```jsonc
378
+ {
379
+ "codeRunner": "opencode",
380
+ "defaultShell": "opencode",
381
+ "environment": {
382
+ // For Anthropic provider
383
+ "ANTHROPIC_API_KEY": "your-api-key",
384
+
385
+ // For custom API endpoint (e.g., proxy services)
386
+ "ANTHROPIC_BASE_URL": "https://your-proxy-url"
387
+ }
388
+ }
389
+ ```
390
+
391
+ OpenCode supports multiple providers. See [OpenCode Providers Documentation](https://opencode.ai/docs/providers/) for details on configuring:
392
+ - OpenAI, Anthropic, Google Vertex AI, Azure OpenAI
393
+ - OpenRouter, Groq, Together AI, and many more
394
+ - Local models via Ollama or LM Studio
395
+
396
+ ##### Using oh-my-opencode Plugin
397
+
398
+ The container includes [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) pre-installed. To enable it:
399
+
400
+ **1. Create configuration on your host machine** (recommended approach):
401
+
402
+ Create `~/.config/opencode/opencode.json` on your host:
403
+
404
+ ```jsonc
405
+ {
406
+ "plugin": ["oh-my-opencode"],
407
+ "agents": {
408
+ "sisyphus": { "model": "anthropic/claude-opus-4-6" }
409
+ }
410
+ }
411
+ ```
412
+
413
+ The configuration will be automatically copied to the container when it starts.
414
+
415
+ **2. Run the installer inside the container:**
416
+
417
+ ```bash
418
+ # Inside the container
419
+ npx oh-my-opencode install --no-tui --claude=yes --gemini=no --copilot=no
420
+ ```
421
+
422
+ > **Note**: Creating the config on your host machine is preferred because:
423
+ > - The config file typically contains sensitive API keys
424
+ > - You can keep it out of git tracking (add `opencode.json` to `.gitignore`)
425
+ > - The same config can be reused across multiple containers
426
+ > - You can customize the path using `opencodeConfigPath` in your `claude-run.config.json`
427
+
428
+ For detailed configuration options, see the [oh-my-opencode installation guide](https://github.com/code-yeongyu/oh-my-opencode/blob/master/docs/guide/installation.md).
429
+
430
+ #### Codex Configuration
431
+
432
+ To use OpenAI Codex, create a config file with:
433
+
434
+ ```jsonc
435
+ {
436
+ "codeRunner": "codex",
437
+ "defaultShell": "codex",
438
+ "environment": {
439
+ "OPENAI_API_KEY": "your-openai-api-key"
440
+ }
441
+ }
442
+ ```
443
+
444
+ Codex runs with `--dangerously-bypass-approvals-and-sandbox` mode in the container. You can also authenticate via `codex login` inside the container.
445
+
446
+ Configuration is stored in `~/.codex/` (including `config.toml` and `auth.json`). You can customize the config path using `codexConfigPath` in your `claude-run.config.json`.
447
+
448
+ See [Codex CLI Documentation](https://github.com/openai/codex) for more details.
449
+
450
+ #### Kimi Code Configuration
451
+
452
+ To use Moonshot AI's Kimi Code, create a config file with:
453
+
454
+ ```jsonc
455
+ {
456
+ "codeRunner": "kimi",
457
+ "defaultShell": "kimi",
458
+ "environment": {
459
+ "KIMI_API_KEY": "your-kimi-api-key",
460
+ "KIMI_BASE_URL": "https://api.kimi.com/coding/v1"
461
+ }
462
+ }
463
+ ```
464
+
465
+ Kimi Code runs with `--yolo` mode (auto-approve all operations) in the container. You can also configure the default model and other options in `~/.kimi/config.toml`.
466
+
467
+ Configuration is stored in `~/.kimi/`. You can customize the config path using `kimiConfigPath` in your `claude-run.config.json`.
468
+
469
+ See [Kimi Code CLI Documentation](https://github.com/MoonshotAI/kimi-cli) for more details.
470
+
471
+ #### Qwen Code Configuration
472
+
473
+ To use Alibaba's Qwen Code, create a config file with:
474
+
475
+ ```jsonc
476
+ {
477
+ "codeRunner": "qwen",
478
+ "defaultShell": "qwen",
479
+ "environment": {
480
+ "DASHSCOPE_API_KEY": "your-dashscope-api-key"
481
+ }
482
+ }
483
+ ```
484
+
485
+ Qwen Code runs with `--yolo` mode (auto-approve all operations) in the container. It supports multiple model providers by configuring `~/.qwen/settings.json`.
486
+
487
+ Configuration is stored in `~/.qwen/`. You can customize the config path using `qwenConfigPath` in your `claude-run.config.json`.
488
+
489
+ Qwen Code also supports `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, and `GEMINI_API_KEY` via the `modelProviders` configuration in `settings.json`.
490
+
491
+ See [Qwen Code Documentation](https://github.com/nicepkg/qwen-code) for more details.
492
+
281
493
  #### Mount Configuration
282
494
 
283
495
  The `mounts` array allows you to mount files or directories into the container:
@@ -547,7 +759,12 @@ Claude Code Runner automatically discovers and forwards:
547
759
 
548
760
  ### Sandboxed Execution
549
761
 
550
- - Claude runs with `--dangerously-skip-permissions` flag (safe in container)
762
+ - Code runners use their respective dangerous/auto-approve mode flags (safe in container):
763
+ - Claude Code: `--dangerously-skip-permissions`
764
+ - OpenCode: `--dangerously-skip-permissions`
765
+ - Codex: `--dangerously-bypass-approvals-and-sandbox`
766
+ - Kimi Code: `--yolo`
767
+ - Qwen Code: `--yolo`
551
768
  - Creates isolated branch for each session
552
769
  - Full access to run any command within the container
553
770
  - Files are copied into container (not mounted) for true isolation
@@ -594,6 +811,10 @@ The default Docker image includes:
594
811
  - Node.js, npm
595
812
  - Python 3
596
813
  - Claude Code
814
+ - OpenCode (with oh-my-opencode plugin)
815
+ - Codex (OpenAI)
816
+ - Kimi Code CLI
817
+ - Qwen Code
597
818
  - Build essentials
598
819
 
599
820
  ### Custom Dockerfile
package/README.zh-Hans.md CHANGED
@@ -7,11 +7,27 @@
7
7
  > - 这项工作处于 alpha 阶段,可能存在安全问题,使用风险自负。
8
8
  > - 如有疑问,请发送邮件至 [admin@soraharu.com](mailto:admin@soraharu.com)。
9
9
 
10
- 在 Docker 容器内将 Claude Code 作为自主代理运行,并自动集成 GitHub。安全地绕过所有权限提示。
10
+ 在 Docker 容器内将 Claude Code、OpenCode、Codex、Kimi Code 或 Qwen Code 作为自主代理运行,并自动集成 GitHub。安全地绕过所有权限提示。
11
+
12
+ ## 支持的代码运行器
13
+
14
+ Claude Code Runner 支持多个 AI 编程助手:
15
+
16
+ | 运行器 | 命令 | 描述 |
17
+ |--------|------|------|
18
+ | **Claude Code** | `claude-run` | Anthropic 官方的 Claude Code CLI |
19
+ | **OpenCode** | `claude-run --runner opencode` | 支持多提供商的开源替代方案 |
20
+ | **Codex** | `claude-run --runner codex` | OpenAI 的 Codex CLI |
21
+ | **Kimi Code** | `claude-run --runner kimi` | 月之暗面的 Kimi Code CLI |
22
+ | **Qwen Code** | `claude-run --runner qwen` | 阿里巴巴的 Qwen Code CLI |
23
+
24
+ 你可以通过以下方式切换运行器:
25
+ - **CLI 参数**: `--runner claude`、`--runner opencode`、`--runner codex`、`--runner kimi` 或 `--runner qwen`
26
+ - **配置文件**: 在 `claude-run.config.json` 中设置 `"codeRunner": "codex"`(或 `"kimi"`、`"qwen"` 等)
11
27
 
12
28
  ## 为什么选择 Claude Code Runner?
13
29
 
14
- Claude Code Runner 的主要目标是通过允许 Claude Code 在没有权限提示的情况下执行,从而实现 **完全异步的智能体工作流**。通过在隔离的 Docker 容器中使用 `--dangerously-skip-permissions` 标志运行 Claude,Claude 可以:
30
+ Claude Code Runner 的主要目标是通过允许 Claude Code、OpenCode、Codex、Kimi Code 或 Qwen Code 在没有权限提示的情况下执行,从而实现 **完全异步的智能体工作流**。通过在隔离的 Docker 容器中使用危险/自动批准模式标志运行 AI 助手,AI 可以:
15
31
 
16
32
  - 无需请求权限即可立即执行任何命令
17
33
  - 自主进行代码更改
@@ -19,14 +35,14 @@ Claude Code Runner 的主要目标是通过允许 Claude Code 在没有权限提
19
35
  - 创建提交并管理 Git 操作
20
36
  - 在不打断用户的情况下持续工作
21
37
 
22
- 通过 **基于浏览器的终端** 访问 Claude,让你可以在处理其他任务的同时监控 AI 助手并与之交互。这创建了一个真正自主的开发助手,类似于 [OpenAI Codex](https://chatgpt.com/codex) 或 [Google Jules](https://jules.dev),但在你的本地机器上运行,并且完全可控。
38
+ 通过 **基于浏览器的终端** 访问代码助手,让你可以在处理其他任务的同时监控 AI 助手并与之交互。这创建了一个真正自主的开发助手,类似于 [OpenAI Codex](https://chatgpt.com/codex) 或 [Google Jules](https://jules.dev),但在你的本地机器上运行,并且完全可控。
23
39
 
24
40
  ## 概述
25
41
 
26
- Claude Code Runner 允许你在隔离的 Docker 容器中运行 Claude Code,为 AI 辅助开发提供安全的环境。它会自动:
42
+ Claude Code Runner 允许你在隔离的 Docker 容器中运行 Claude Code、OpenCode、Codex、Kimi Code 或 Qwen Code,为 AI 辅助开发提供安全的环境。它会自动:
27
43
 
28
44
  - 为每个会话创建新的 Git 分支
29
- - 监控 Claude 所做的提交
45
+ - 监控 AI 助手所做的提交
30
46
  - 提供交互式的更改审查
31
47
  - 安全地转发凭证
32
48
  - 启用推送/PR 创建工作流
@@ -120,6 +136,18 @@ claude-run
120
136
 
121
137
  - `clauderun`
122
138
  - `ccrun`
139
+ - `ocrun`(OpenCode 别名)
140
+ - `opencoderun`(OpenCode 别名)
141
+ - `opencode-run`(OpenCode 别名)
142
+ - `cxrun`(Codex 别名)
143
+ - `codexrun`(Codex 别名)
144
+ - `codex-run`(Codex 别名)
145
+ - `kmrun`(Kimi Code 别名)
146
+ - `kimirun`(Kimi Code 别名)
147
+ - `kimi-run`(Kimi Code 别名)
148
+ - `qwrun`(Qwen Code 别名)
149
+ - `qwenrun`(Qwen Code 别名)
150
+ - `qwen-run`(Qwen Code 别名)
123
151
 
124
152
  #### `claude-run`(默认)
125
153
 
@@ -129,6 +157,62 @@ claude-run
129
157
  claude-run
130
158
  ```
131
159
 
160
+ #### 使用 OpenCode
161
+
162
+ 要使用 OpenCode 而不是 Claude Code:
163
+
164
+ ```bash
165
+ # 通过 CLI 参数
166
+ claude-run --runner opencode
167
+
168
+ # 或使用 OpenCode 别名
169
+ ocrun
170
+ opencoderun
171
+ opencode-run
172
+ ```
173
+
174
+ #### 使用 Codex
175
+
176
+ 要使用 OpenAI Codex:
177
+
178
+ ```bash
179
+ # 通过 CLI 参数
180
+ claude-run --runner codex
181
+
182
+ # 或使用 Codex 别名
183
+ cxrun
184
+ codexrun
185
+ codex-run
186
+ ```
187
+
188
+ #### 使用 Kimi Code
189
+
190
+ 要使用月之暗面的 Kimi Code:
191
+
192
+ ```bash
193
+ # 通过 CLI 参数
194
+ claude-run --runner kimi
195
+
196
+ # 或使用 Kimi Code 别名
197
+ kmrun
198
+ kimirun
199
+ kimi-run
200
+ ```
201
+
202
+ #### 使用 Qwen Code
203
+
204
+ 要使用阿里巴巴的 Qwen Code:
205
+
206
+ ```bash
207
+ # 通过 CLI 参数
208
+ claude-run --runner qwen
209
+
210
+ # 或使用 Qwen Code 别名
211
+ qwrun
212
+ qwenrun
213
+ qwen-run
214
+ ```
215
+
132
216
  #### `claude-run start`
133
217
 
134
218
  显式启动带选项的新容器:
@@ -139,6 +223,8 @@ claude-run start [选项]
139
223
  选项:
140
224
  -c, --config <path> 配置文件(默认: ./claude-run.config.json)
141
225
  -n, --name <name> 容器名称前缀
226
+ --runner <runner> 要使用的代码运行器: 'claude'、'opencode'、'codex'、'kimi' 或 'qwen'
227
+ --shell <shell> 启动时使用的 shell: 'claude'、'opencode'、'codex'、'kimi'、'qwen' 或 'bash'
142
228
  --no-web 禁用 Web UI(使用终端附加)
143
229
  --no-push 禁用自动分支推送
144
230
  --no-pr 禁用自动 PR 创建
@@ -281,6 +367,8 @@ claude-run update # 别名
281
367
  - `autoPush`: 提交后自动推送分支
282
368
  - `autoCreatePR`: 自动创建拉取请求
283
369
  - `autoStartClaude`: 自动启动 Claude Code (默认: true)
370
+ - `codeRunner`: 要使用的代码运行器: `"claude"`、`"opencode"`、`"codex"`、`"kimi"` 或 `"qwen"` (默认: `"claude"`)
371
+ - `defaultShell`: 启动时使用的 shell: `"claude"`、`"opencode"`、`"codex"`、`"kimi"`、`"qwen"` 或 `"bash"` (默认: 与 `codeRunner` 一致)
284
372
  - `envFile`: 从文件加载环境变量 (例如 `.env`)
285
373
  - `environment`: 额外的环境变量
286
374
  - `setupCommands`: 容器启动后要运行的命令(例如安装依赖)
@@ -291,6 +379,10 @@ claude-run update # 别名
291
379
  - `bashTimeout`: bash 命令超时时间(毫秒)
292
380
  - `containerPrefix`: 容器名称的自定义前缀
293
381
  - `claudeConfigPath`: Claude 配置文件的路径
382
+ - `opencodeConfigPath`: OpenCode 配置文件的路径(默认:`~/.config/opencode/opencode.json`)
383
+ - `codexConfigPath`: Codex 配置目录的路径(默认:`~/.codex`)
384
+ - `kimiConfigPath`: Kimi Code 配置目录的路径(默认:`~/.kimi`)
385
+ - `qwenConfigPath`: Qwen Code 配置目录的路径(默认:`~/.qwen`)
294
386
  - `dockerSocketPath`: 自定义 Docker/Podman 套接字路径(默认自动检测)
295
387
  - `forwardSshKeys`: 将 `~/.ssh` 中的 SSH 密钥转发到容器(默认:true)
296
388
  - `forwardGpgKeys`: 将 `~/.gnupg` 中的 GPG 密钥转发到容器(默认:true)
@@ -298,6 +390,126 @@ claude-run update # 别名
298
390
  - `forwardGpgAgent`: 转发 GPG agent 以支持带密码的 GPG 密钥(默认:false,需显式启用)
299
391
  - `enableGpgSigning`: 在容器中启用 GPG 提交签名(默认:false)
300
392
 
393
+ #### OpenCode 配置
394
+
395
+ 要使用 OpenCode 而不是 Claude Code,创建一个配置文件:
396
+
397
+ ```jsonc
398
+ {
399
+ "codeRunner": "opencode",
400
+ "defaultShell": "opencode",
401
+ "environment": {
402
+ // Anthropic 提供商
403
+ "ANTHROPIC_API_KEY": "your-api-key",
404
+
405
+ // 自定义 API 端点(例如代理服务)
406
+ "ANTHROPIC_BASE_URL": "https://your-proxy-url"
407
+ }
408
+ }
409
+ ```
410
+
411
+ OpenCode 支持多个提供商。详情请参阅 [OpenCode 提供商文档](https://opencode.ai/docs/providers/):
412
+ - OpenAI、Anthropic、Google Vertex AI、Azure OpenAI
413
+ - OpenRouter、Groq、Together AI 等
414
+ - 通过 Ollama 或 LM Studio 使用本地模型
415
+
416
+ ##### 使用 oh-my-opencode 插件
417
+
418
+ 容器已预装 [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode)。要启用它:
419
+
420
+ **1. 在宿主机上创建配置**(推荐方式):
421
+
422
+ 在宿主机上创建 `~/.config/opencode/opencode.json`:
423
+
424
+ ```jsonc
425
+ {
426
+ "plugin": ["oh-my-opencode"],
427
+ "agents": {
428
+ "sisyphus": { "model": "anthropic/claude-opus-4-6" }
429
+ }
430
+ }
431
+ ```
432
+
433
+ 在容器启动时,配置文件会自动复制到容器中。
434
+
435
+ **2. 在容器内运行安装器:**
436
+
437
+ ```bash
438
+ # 在容器内执行
439
+ npx oh-my-opencode install --no-tui --claude=yes --gemini=no --copilot=no
440
+ ```
441
+
442
+ > **注意**:在宿主机上创建配置是首选方式,因为:
443
+ > - 配置文件通常包含敏感的 API 密钥
444
+ > - 你可以将它排除在 git 跟踪之外(将 `opencode.json` 添加到 `.gitignore`)
445
+ > - 同一配置可以在多个容器之间重用
446
+ > - 你可以在 `claude-run.config.json` 中使用 `opencodeConfigPath` 自定义路径
447
+
448
+ 有关详细配置选项,请参阅 [oh-my-opencode 安装指南](https://github.com/code-yeongyu/oh-my-opencode/blob/master/docs/guide/installation.md)。
449
+
450
+ #### Codex 配置
451
+
452
+ 要使用 OpenAI Codex,创建一个配置文件:
453
+
454
+ ```jsonc
455
+ {
456
+ "codeRunner": "codex",
457
+ "defaultShell": "codex",
458
+ "environment": {
459
+ "OPENAI_API_KEY": "your-openai-api-key"
460
+ }
461
+ }
462
+ ```
463
+
464
+ Codex 在容器中使用 `--dangerously-bypass-approvals-and-sandbox` 模式运行。你也可以在容器内通过 `codex login` 进行认证。
465
+
466
+ 配置存储在 `~/.codex/`(包括 `config.toml` 和 `auth.json`)。你可以在 `claude-run.config.json` 中使用 `codexConfigPath` 自定义路径。
467
+
468
+ 详情请参阅 [Codex CLI 文档](https://github.com/openai/codex)。
469
+
470
+ #### Kimi Code 配置
471
+
472
+ 要使用月之暗面的 Kimi Code,创建一个配置文件:
473
+
474
+ ```jsonc
475
+ {
476
+ "codeRunner": "kimi",
477
+ "defaultShell": "kimi",
478
+ "environment": {
479
+ "KIMI_API_KEY": "your-kimi-api-key",
480
+ "KIMI_BASE_URL": "https://api.kimi.com/coding/v1"
481
+ }
482
+ }
483
+ ```
484
+
485
+ Kimi Code 在容器中使用 `--yolo` 模式(自动批准所有操作)运行。你也可以在 `~/.kimi/config.toml` 中配置默认模型和其他选项。
486
+
487
+ 配置存储在 `~/.kimi/`。你可以在 `claude-run.config.json` 中使用 `kimiConfigPath` 自定义路径。
488
+
489
+ 详情请参阅 [Kimi Code CLI 文档](https://github.com/MoonshotAI/kimi-cli)。
490
+
491
+ #### Qwen Code 配置
492
+
493
+ 要使用阿里巴巴的 Qwen Code,创建一个配置文件:
494
+
495
+ ```jsonc
496
+ {
497
+ "codeRunner": "qwen",
498
+ "defaultShell": "qwen",
499
+ "environment": {
500
+ "DASHSCOPE_API_KEY": "your-dashscope-api-key"
501
+ }
502
+ }
503
+ ```
504
+
505
+ Qwen Code 在容器中使用 `--yolo` 模式(自动批准所有操作)运行。它支持通过配置 `~/.qwen/settings.json` 使用多个模型提供商。
506
+
507
+ 配置存储在 `~/.qwen/`。你可以在 `claude-run.config.json` 中使用 `qwenConfigPath` 自定义路径。
508
+
509
+ Qwen Code 还支持通过 `settings.json` 中的 `modelProviders` 配置使用 `OPENAI_API_KEY`、`ANTHROPIC_API_KEY` 和 `GEMINI_API_KEY`。
510
+
511
+ 详情请参阅 [Qwen Code 文档](https://github.com/nicepkg/qwen-code)。
512
+
301
513
  #### 挂载配置
302
514
 
303
515
  `mounts` 数组允许你将文件或目录挂载到容器中:
@@ -567,7 +779,12 @@ Claude Code Runner 会自动发现并转发:
567
779
 
568
780
  ### 沙箱执行
569
781
 
570
- - Claude 使用 `--dangerously-skip-permissions` 标志运行(在容器中安全)
782
+ - 代码运行器使用各自的危险/自动批准模式标志(在容器中安全):
783
+ - Claude Code: `--dangerously-skip-permissions`
784
+ - OpenCode: `--dangerously-skip-permissions`
785
+ - Codex: `--dangerously-bypass-approvals-and-sandbox`
786
+ - Kimi Code: `--yolo`
787
+ - Qwen Code: `--yolo`
571
788
  - 为每个会话创建隔离的分支
572
789
  - 在容器内完全访问运行任何命令
573
790
  - 文件被复制到容器中(而不是挂载),实现真正的隔离
@@ -614,6 +831,10 @@ claude-run attach
614
831
  - Node.js、npm
615
832
  - Python 3
616
833
  - Claude Code
834
+ - OpenCode(含 oh-my-opencode 插件)
835
+ - Codex (OpenAI)
836
+ - Kimi Code CLI
837
+ - Qwen Code
617
838
  - 构建必需工具
618
839
 
619
840
  ### 自定义 Dockerfile