claude-code-runner 0.3.0 → 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 +174 -10
- package/README.zh-Hans.md +174 -10
- package/dist/cli.js +22 -8
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -1
- package/dist/config.js.map +1 -1
- package/dist/container.d.ts +4 -0
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +198 -15
- package/dist/container.js.map +1 -1
- package/dist/git/shadow-repository.d.ts.map +1 -1
- package/dist/git/shadow-repository.js +2 -1
- package/dist/git/shadow-repository.js.map +1 -1
- package/dist/types.d.ts +6 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +30 -0
- package/dist/types.js.map +1 -1
- package/docker/Dockerfile +88 -99
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
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 or
|
|
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
11
|
|
|
12
12
|
## Supported Code Runners
|
|
13
13
|
|
|
@@ -17,14 +17,17 @@ Claude Code Runner supports multiple AI coding assistants:
|
|
|
17
17
|
|--------|---------|-------------|
|
|
18
18
|
| **Claude Code** | `claude-run` | Anthropic's official Claude Code CLI |
|
|
19
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 |
|
|
20
23
|
|
|
21
24
|
You can switch between runners using:
|
|
22
|
-
- **CLI flag**: `--runner claude
|
|
23
|
-
- **Config file**: Set `"codeRunner": "
|
|
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`
|
|
24
27
|
|
|
25
28
|
## Why Claude Code Runner?
|
|
26
29
|
|
|
27
|
-
The primary goal of Claude Code Runner is to enable **full async agentic workflows** by allowing Claude Code or
|
|
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:
|
|
28
31
|
|
|
29
32
|
- Execute any command instantly without asking for permission
|
|
30
33
|
- Make code changes autonomously
|
|
@@ -36,7 +39,7 @@ Access the code assistant through a **browser-based terminal** that lets you mon
|
|
|
36
39
|
|
|
37
40
|
## Overview
|
|
38
41
|
|
|
39
|
-
Claude Code Runner allows you to run Claude Code or
|
|
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:
|
|
40
43
|
|
|
41
44
|
- Creates a new git branch for each session
|
|
42
45
|
- Monitors for commits made by the AI assistant
|
|
@@ -118,6 +121,15 @@ The following commands are shortcuts for `claude-run`:
|
|
|
118
121
|
- `ocrun` (OpenCode alias)
|
|
119
122
|
- `opencoderun` (OpenCode alias)
|
|
120
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)
|
|
121
133
|
|
|
122
134
|
#### `claude-run` (default)
|
|
123
135
|
|
|
@@ -141,6 +153,48 @@ opencoderun
|
|
|
141
153
|
opencode-run
|
|
142
154
|
```
|
|
143
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
|
+
|
|
144
198
|
#### `claude-run start`
|
|
145
199
|
|
|
146
200
|
Explicitly start a new container with options:
|
|
@@ -151,8 +205,8 @@ claude-run start [options]
|
|
|
151
205
|
Options:
|
|
152
206
|
-c, --config <path> Configuration file (default: ./claude-run.config.json)
|
|
153
207
|
-n, --name <name> Container name prefix
|
|
154
|
-
--runner <runner> Code runner to use: 'claude' or '
|
|
155
|
-
--shell <shell> Shell to start with: 'claude', 'opencode', or 'bash'
|
|
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'
|
|
156
210
|
--no-web Disable web UI (use terminal attach)
|
|
157
211
|
--no-push Disable automatic branch pushing
|
|
158
212
|
--no-pr Disable automatic PR creation
|
|
@@ -293,8 +347,8 @@ Create a `claude-run.config.json` file (see `claude-run.config.example.json` for
|
|
|
293
347
|
- `autoPush`: Automatically push branches after commits
|
|
294
348
|
- `autoCreatePR`: Automatically create pull requests
|
|
295
349
|
- `autoStartClaude`: Start Claude Code automatically (default: true)
|
|
296
|
-
- `codeRunner`: Which code runner to use: `"claude"` or `"
|
|
297
|
-
- `defaultShell`: Shell to start with: `"claude"`, `"opencode"`, or `"bash"` (default: matches `codeRunner`)
|
|
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`)
|
|
298
352
|
- `envFile`: Load environment variables from file (e.g., `.env`)
|
|
299
353
|
- `environment`: Additional environment variables
|
|
300
354
|
- `setupCommands`: Commands to run after container starts (e.g., install dependencies)
|
|
@@ -305,6 +359,10 @@ Create a `claude-run.config.json` file (see `claude-run.config.example.json` for
|
|
|
305
359
|
- `bashTimeout`: Timeout for bash commands in milliseconds
|
|
306
360
|
- `containerPrefix`: Custom prefix for container names
|
|
307
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`)
|
|
308
366
|
- `dockerSocketPath`: Custom Docker/Podman socket path (auto-detected by default)
|
|
309
367
|
- `forwardSshKeys`: Forward SSH keys from `~/.ssh` to container (default: true)
|
|
310
368
|
- `forwardGpgKeys`: Forward GPG keys from `~/.gnupg` to container (default: true)
|
|
@@ -335,6 +393,103 @@ OpenCode supports multiple providers. See [OpenCode Providers Documentation](htt
|
|
|
335
393
|
- OpenRouter, Groq, Together AI, and many more
|
|
336
394
|
- Local models via Ollama or LM Studio
|
|
337
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
|
+
|
|
338
493
|
#### Mount Configuration
|
|
339
494
|
|
|
340
495
|
The `mounts` array allows you to mount files or directories into the container:
|
|
@@ -604,7 +759,12 @@ Claude Code Runner automatically discovers and forwards:
|
|
|
604
759
|
|
|
605
760
|
### Sandboxed Execution
|
|
606
761
|
|
|
607
|
-
-
|
|
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`
|
|
608
768
|
- Creates isolated branch for each session
|
|
609
769
|
- Full access to run any command within the container
|
|
610
770
|
- Files are copied into container (not mounted) for true isolation
|
|
@@ -651,6 +811,10 @@ The default Docker image includes:
|
|
|
651
811
|
- Node.js, npm
|
|
652
812
|
- Python 3
|
|
653
813
|
- Claude Code
|
|
814
|
+
- OpenCode (with oh-my-opencode plugin)
|
|
815
|
+
- Codex (OpenAI)
|
|
816
|
+
- Kimi Code CLI
|
|
817
|
+
- Qwen Code
|
|
654
818
|
- Build essentials
|
|
655
819
|
|
|
656
820
|
### Custom Dockerfile
|
package/README.zh-Hans.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
> - 这项工作处于 alpha 阶段,可能存在安全问题,使用风险自负。
|
|
8
8
|
> - 如有疑问,请发送邮件至 [admin@soraharu.com](mailto:admin@soraharu.com)。
|
|
9
9
|
|
|
10
|
-
在 Docker 容器内将 Claude Code 或
|
|
10
|
+
在 Docker 容器内将 Claude Code、OpenCode、Codex、Kimi Code 或 Qwen Code 作为自主代理运行,并自动集成 GitHub。安全地绕过所有权限提示。
|
|
11
11
|
|
|
12
12
|
## 支持的代码运行器
|
|
13
13
|
|
|
@@ -17,14 +17,17 @@ Claude Code Runner 支持多个 AI 编程助手:
|
|
|
17
17
|
|--------|------|------|
|
|
18
18
|
| **Claude Code** | `claude-run` | Anthropic 官方的 Claude Code CLI |
|
|
19
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 |
|
|
20
23
|
|
|
21
24
|
你可以通过以下方式切换运行器:
|
|
22
|
-
- **CLI 参数**: `--runner claude` 或 `--runner
|
|
23
|
-
- **配置文件**: 在 `claude-run.config.json` 中设置 `"codeRunner": "
|
|
25
|
+
- **CLI 参数**: `--runner claude`、`--runner opencode`、`--runner codex`、`--runner kimi` 或 `--runner qwen`
|
|
26
|
+
- **配置文件**: 在 `claude-run.config.json` 中设置 `"codeRunner": "codex"`(或 `"kimi"`、`"qwen"` 等)
|
|
24
27
|
|
|
25
28
|
## 为什么选择 Claude Code Runner?
|
|
26
29
|
|
|
27
|
-
Claude Code Runner 的主要目标是通过允许 Claude Code 或
|
|
30
|
+
Claude Code Runner 的主要目标是通过允许 Claude Code、OpenCode、Codex、Kimi Code 或 Qwen Code 在没有权限提示的情况下执行,从而实现 **完全异步的智能体工作流**。通过在隔离的 Docker 容器中使用危险/自动批准模式标志运行 AI 助手,AI 可以:
|
|
28
31
|
|
|
29
32
|
- 无需请求权限即可立即执行任何命令
|
|
30
33
|
- 自主进行代码更改
|
|
@@ -36,7 +39,7 @@ Claude Code Runner 的主要目标是通过允许 Claude Code 或 OpenCode 在
|
|
|
36
39
|
|
|
37
40
|
## 概述
|
|
38
41
|
|
|
39
|
-
Claude Code Runner 允许你在隔离的 Docker 容器中运行 Claude Code 或
|
|
42
|
+
Claude Code Runner 允许你在隔离的 Docker 容器中运行 Claude Code、OpenCode、Codex、Kimi Code 或 Qwen Code,为 AI 辅助开发提供安全的环境。它会自动:
|
|
40
43
|
|
|
41
44
|
- 为每个会话创建新的 Git 分支
|
|
42
45
|
- 监控 AI 助手所做的提交
|
|
@@ -136,6 +139,15 @@ claude-run
|
|
|
136
139
|
- `ocrun`(OpenCode 别名)
|
|
137
140
|
- `opencoderun`(OpenCode 别名)
|
|
138
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 别名)
|
|
139
151
|
|
|
140
152
|
#### `claude-run`(默认)
|
|
141
153
|
|
|
@@ -159,6 +171,48 @@ opencoderun
|
|
|
159
171
|
opencode-run
|
|
160
172
|
```
|
|
161
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
|
+
|
|
162
216
|
#### `claude-run start`
|
|
163
217
|
|
|
164
218
|
显式启动带选项的新容器:
|
|
@@ -169,8 +223,8 @@ claude-run start [选项]
|
|
|
169
223
|
选项:
|
|
170
224
|
-c, --config <path> 配置文件(默认: ./claude-run.config.json)
|
|
171
225
|
-n, --name <name> 容器名称前缀
|
|
172
|
-
--runner <runner> 要使用的代码运行器: 'claude' 或 '
|
|
173
|
-
--shell <shell> 启动时使用的 shell: 'claude'、'opencode' 或 'bash'
|
|
226
|
+
--runner <runner> 要使用的代码运行器: 'claude'、'opencode'、'codex'、'kimi' 或 'qwen'
|
|
227
|
+
--shell <shell> 启动时使用的 shell: 'claude'、'opencode'、'codex'、'kimi'、'qwen' 或 'bash'
|
|
174
228
|
--no-web 禁用 Web UI(使用终端附加)
|
|
175
229
|
--no-push 禁用自动分支推送
|
|
176
230
|
--no-pr 禁用自动 PR 创建
|
|
@@ -313,8 +367,8 @@ claude-run update # 别名
|
|
|
313
367
|
- `autoPush`: 提交后自动推送分支
|
|
314
368
|
- `autoCreatePR`: 自动创建拉取请求
|
|
315
369
|
- `autoStartClaude`: 自动启动 Claude Code (默认: true)
|
|
316
|
-
- `codeRunner`: 要使用的代码运行器: `"claude"` 或 `"
|
|
317
|
-
- `defaultShell`: 启动时使用的 shell: `"claude"`、`"opencode"` 或 `"bash"` (默认: 与 `codeRunner` 一致)
|
|
370
|
+
- `codeRunner`: 要使用的代码运行器: `"claude"`、`"opencode"`、`"codex"`、`"kimi"` 或 `"qwen"` (默认: `"claude"`)
|
|
371
|
+
- `defaultShell`: 启动时使用的 shell: `"claude"`、`"opencode"`、`"codex"`、`"kimi"`、`"qwen"` 或 `"bash"` (默认: 与 `codeRunner` 一致)
|
|
318
372
|
- `envFile`: 从文件加载环境变量 (例如 `.env`)
|
|
319
373
|
- `environment`: 额外的环境变量
|
|
320
374
|
- `setupCommands`: 容器启动后要运行的命令(例如安装依赖)
|
|
@@ -325,6 +379,10 @@ claude-run update # 别名
|
|
|
325
379
|
- `bashTimeout`: bash 命令超时时间(毫秒)
|
|
326
380
|
- `containerPrefix`: 容器名称的自定义前缀
|
|
327
381
|
- `claudeConfigPath`: Claude 配置文件的路径
|
|
382
|
+
- `opencodeConfigPath`: OpenCode 配置文件的路径(默认:`~/.config/opencode/opencode.json`)
|
|
383
|
+
- `codexConfigPath`: Codex 配置目录的路径(默认:`~/.codex`)
|
|
384
|
+
- `kimiConfigPath`: Kimi Code 配置目录的路径(默认:`~/.kimi`)
|
|
385
|
+
- `qwenConfigPath`: Qwen Code 配置目录的路径(默认:`~/.qwen`)
|
|
328
386
|
- `dockerSocketPath`: 自定义 Docker/Podman 套接字路径(默认自动检测)
|
|
329
387
|
- `forwardSshKeys`: 将 `~/.ssh` 中的 SSH 密钥转发到容器(默认:true)
|
|
330
388
|
- `forwardGpgKeys`: 将 `~/.gnupg` 中的 GPG 密钥转发到容器(默认:true)
|
|
@@ -355,6 +413,103 @@ OpenCode 支持多个提供商。详情请参阅 [OpenCode 提供商文档](http
|
|
|
355
413
|
- OpenRouter、Groq、Together AI 等
|
|
356
414
|
- 通过 Ollama 或 LM Studio 使用本地模型
|
|
357
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
|
+
|
|
358
513
|
#### 挂载配置
|
|
359
514
|
|
|
360
515
|
`mounts` 数组允许你将文件或目录挂载到容器中:
|
|
@@ -624,7 +779,12 @@ Claude Code Runner 会自动发现并转发:
|
|
|
624
779
|
|
|
625
780
|
### 沙箱执行
|
|
626
781
|
|
|
627
|
-
-
|
|
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`
|
|
628
788
|
- 为每个会话创建隔离的分支
|
|
629
789
|
- 在容器内完全访问运行任何命令
|
|
630
790
|
- 文件被复制到容器中(而不是挂载),实现真正的隔离
|
|
@@ -671,6 +831,10 @@ claude-run attach
|
|
|
671
831
|
- Node.js、npm
|
|
672
832
|
- Python 3
|
|
673
833
|
- Claude Code
|
|
834
|
+
- OpenCode(含 oh-my-opencode 插件)
|
|
835
|
+
- Codex (OpenAI)
|
|
836
|
+
- Kimi Code CLI
|
|
837
|
+
- Qwen Code
|
|
674
838
|
- 构建必需工具
|
|
675
839
|
|
|
676
840
|
### 自定义 Dockerfile
|
package/dist/cli.js
CHANGED
|
@@ -19,7 +19,7 @@ const index_1 = require("./index");
|
|
|
19
19
|
const types_1 = require("./types");
|
|
20
20
|
const web_server_1 = require("./web-server");
|
|
21
21
|
// Package info - injected at build time
|
|
22
|
-
const currentVersion = '0.3.
|
|
22
|
+
const currentVersion = '0.3.1';
|
|
23
23
|
const packageName = 'claude-code-runner';
|
|
24
24
|
// Check for updates (non-blocking)
|
|
25
25
|
async function checkForUpdates() {
|
|
@@ -139,7 +139,7 @@ async function selectContainer(containers) {
|
|
|
139
139
|
}
|
|
140
140
|
program
|
|
141
141
|
.name('claude-run')
|
|
142
|
-
.description('Run Claude Code or
|
|
142
|
+
.description('Run Claude Code, OpenCode, Codex, Kimi Code, or Qwen Code in isolated Docker containers')
|
|
143
143
|
.version(currentVersion, '-v, --version', 'Display version number');
|
|
144
144
|
// Check for updates before running any command
|
|
145
145
|
program.hook('preAction', async () => {
|
|
@@ -152,24 +152,38 @@ function getRunnerFromCommandName() {
|
|
|
152
152
|
if (commandName === 'ocrun' || commandName === 'opencoderun' || commandName === 'opencode-run') {
|
|
153
153
|
return 'opencode';
|
|
154
154
|
}
|
|
155
|
+
// Codex aliases
|
|
156
|
+
if (commandName === 'cxrun' || commandName === 'codexrun' || commandName === 'codex-run') {
|
|
157
|
+
return 'codex';
|
|
158
|
+
}
|
|
159
|
+
// Kimi Code aliases
|
|
160
|
+
if (commandName === 'kmrun' || commandName === 'kimirun' || commandName === 'kimi-run') {
|
|
161
|
+
return 'kimi';
|
|
162
|
+
}
|
|
163
|
+
// Qwen Code aliases
|
|
164
|
+
if (commandName === 'qwrun' || commandName === 'qwenrun' || commandName === 'qwen-run') {
|
|
165
|
+
return 'qwen';
|
|
166
|
+
}
|
|
155
167
|
// Claude aliases (claude-run, ccrun, clauderun) - return undefined to use config default
|
|
156
168
|
return undefined;
|
|
157
169
|
}
|
|
170
|
+
// All valid code runner names
|
|
171
|
+
const VALID_RUNNERS = ['claude', 'opencode', 'codex', 'kimi', 'qwen'];
|
|
158
172
|
// Helper to validate and get code runner
|
|
159
173
|
function validateCodeRunner(runner) {
|
|
160
174
|
if (!runner)
|
|
161
175
|
return undefined;
|
|
162
176
|
const lowerRunner = runner.toLowerCase();
|
|
163
|
-
if (lowerRunner
|
|
177
|
+
if (VALID_RUNNERS.includes(lowerRunner)) {
|
|
164
178
|
return lowerRunner;
|
|
165
179
|
}
|
|
166
|
-
console.error(chalk_1.default.red(`Invalid code runner: ${runner}. Valid options are:
|
|
180
|
+
console.error(chalk_1.default.red(`Invalid code runner: ${runner}. Valid options are: ${VALID_RUNNERS.join(', ')}`));
|
|
167
181
|
node_process_1.default.exit(1);
|
|
168
182
|
}
|
|
169
183
|
// Default command (always web UI)
|
|
170
184
|
program
|
|
171
|
-
.option('--shell <shell>', 'Start with \'claude\', \'opencode\', or \'bash\' shell', /^(claude|opencode|bash)$/i)
|
|
172
|
-
.option('--runner <runner>', 'Code runner to use: \'claude\' or \'
|
|
185
|
+
.option('--shell <shell>', 'Start with \'claude\', \'opencode\', \'codex\', \'kimi\', \'qwen\', or \'bash\' shell', /^(claude|opencode|codex|kimi|qwen|bash)$/i)
|
|
186
|
+
.option('--runner <runner>', 'Code runner to use: \'claude\', \'opencode\', \'codex\', \'kimi\', or \'qwen\' (overrides config)')
|
|
173
187
|
.option('--skip-reconnect-check', 'Skip checking for existing containers and always create a new one', false)
|
|
174
188
|
.action(async (options) => {
|
|
175
189
|
// Priority: CLI flag > config file > command name default
|
|
@@ -201,8 +215,8 @@ program
|
|
|
201
215
|
.option('-b, --branch <branch>', 'Switch to specific branch on container start (creates if doesn\'t exist)')
|
|
202
216
|
.option('--remote-branch <branch>', 'Checkout a remote branch (e.g., origin/feature-branch)')
|
|
203
217
|
.option('--pr <number>', 'Checkout a specific PR by number')
|
|
204
|
-
.option('--shell <shell>', 'Start with \'claude\', \'opencode\', or \'bash\' shell', /^(claude|opencode|bash)$/i)
|
|
205
|
-
.option('--runner <runner>', 'Code runner to use: \'claude\' or \'
|
|
218
|
+
.option('--shell <shell>', 'Start with \'claude\', \'opencode\', \'codex\', \'kimi\', \'qwen\', or \'bash\' shell', /^(claude|opencode|codex|kimi|qwen|bash)$/i)
|
|
219
|
+
.option('--runner <runner>', 'Code runner to use: \'claude\', \'opencode\', \'codex\', \'kimi\', or \'qwen\' (overrides config)')
|
|
206
220
|
.option('--skip-reconnect-check', 'Skip checking for existing containers and always create a new one', false)
|
|
207
221
|
.action(async (options) => {
|
|
208
222
|
// Priority: CLI flag > config file > command name default
|