@_mehrad/cbox 0.1.1 → 0.1.3
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 +36 -26
- package/dist/cbox +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,8 +5,8 @@ Run Claude Code in a throwaway Docker container. One-shot automation or persiste
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
7
7
|
- [Docker](https://docs.docker.com/get-docker/) (running)
|
|
8
|
+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code/getting-started) installed and logged in via `claude login`
|
|
8
9
|
- [tmux](https://github.com/tmux/tmux) (required for `session`, `attach`)
|
|
9
|
-
- `ANTHROPIC_API_KEY` environment variable set
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -22,13 +22,16 @@ bunx @_mehrad/cbox # no-install, always latest
|
|
|
22
22
|
cbox "refactor the auth module to use JWT"
|
|
23
23
|
|
|
24
24
|
# Interactive: persistent Claude Code session
|
|
25
|
-
cbox session
|
|
25
|
+
cbox session -m .
|
|
26
26
|
|
|
27
27
|
# Mount current directory and run a task from a file
|
|
28
|
-
cbox run -f task.md
|
|
28
|
+
cbox run -f task.md -m .
|
|
29
|
+
|
|
30
|
+
# Mount multiple directories
|
|
31
|
+
cbox run -m ./src -m ./tests "add tests for the auth module"
|
|
29
32
|
|
|
30
33
|
# JSON output for scripting
|
|
31
|
-
cbox run -j "list all TODO comments"
|
|
34
|
+
cbox run -j "list all TODO comments" -m ./src
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
## Commands
|
|
@@ -36,15 +39,16 @@ cbox run -j "list all TODO comments" --mount ./src
|
|
|
36
39
|
### One-shot mode
|
|
37
40
|
|
|
38
41
|
```sh
|
|
39
|
-
cbox "<prompt>"
|
|
40
|
-
cbox run "<prompt>"
|
|
41
|
-
cbox run -f task.md
|
|
42
|
-
cbox run -j "<prompt>"
|
|
43
|
-
cbox run
|
|
44
|
-
cbox run
|
|
45
|
-
cbox run
|
|
46
|
-
cbox run --
|
|
47
|
-
cbox run --no-
|
|
42
|
+
cbox "<prompt>" # implicit run
|
|
43
|
+
cbox run "<prompt>" # explicit (same behaviour)
|
|
44
|
+
cbox run -f task.md # prompt from file
|
|
45
|
+
cbox run -j "<prompt>" # JSON output
|
|
46
|
+
cbox run -m . "<prompt>" # mount cwd read-write
|
|
47
|
+
cbox run -m ./src:ro "<prompt>" # mount read-only
|
|
48
|
+
cbox run -m ./src -m ./data "<prompt>" # mount multiple directories
|
|
49
|
+
cbox run --env KEY=VALUE "<prompt>" # pass env var into container
|
|
50
|
+
cbox run --no-config "<prompt>" # skip mounting ~/.claude
|
|
51
|
+
cbox run --no-browser "<prompt>" # skip agent-browser (lighter image)
|
|
48
52
|
```
|
|
49
53
|
|
|
50
54
|
Streams Claude Code's stdout/stderr directly. Exits with the container's exit code.
|
|
@@ -52,13 +56,14 @@ Streams Claude Code's stdout/stderr directly. Exits with the container's exit co
|
|
|
52
56
|
### Interactive session mode
|
|
53
57
|
|
|
54
58
|
```sh
|
|
55
|
-
cbox session
|
|
56
|
-
cbox session
|
|
57
|
-
cbox session
|
|
58
|
-
cbox session
|
|
59
|
-
cbox session --
|
|
60
|
-
cbox session --
|
|
61
|
-
cbox session --no-
|
|
59
|
+
cbox session # start interactive session
|
|
60
|
+
cbox session -m . # mount cwd read-write
|
|
61
|
+
cbox session -m ./src:ro # mount read-only
|
|
62
|
+
cbox session -m ./src -m ./data # mount multiple directories
|
|
63
|
+
cbox session --name refactor-auth # named session
|
|
64
|
+
cbox session --env KEY=VALUE # pass env var
|
|
65
|
+
cbox session --no-config # skip mounting ~/.claude
|
|
66
|
+
cbox session --no-browser # lighter container
|
|
62
67
|
```
|
|
63
68
|
|
|
64
69
|
Creates a tmux session on the host, starts Docker inside it. Attaching/detaching from tmux leaves the container running. Reconnect anytime with `cbox attach`.
|
|
@@ -86,7 +91,7 @@ The image is built automatically on first run and cached. It rebuilds when the C
|
|
|
86
91
|
|
|
87
92
|
| Flag | Commands | Description |
|
|
88
93
|
|---|---|---|
|
|
89
|
-
|
|
|
94
|
+
| `-m, --mount <path>` | `run`, `session` | Mount a host path (repeatable; append `:ro` for read-only) |
|
|
90
95
|
| `--env KEY=VALUE` | `run`, `session` | Pass an environment variable into the container (repeatable) |
|
|
91
96
|
| `--no-config` | `run`, `session` | Skip mounting `~/.claude` (fully isolated container) |
|
|
92
97
|
| `--no-browser` | `run`, `session` | Skip agent-browser (smaller, faster startup) |
|
|
@@ -95,12 +100,17 @@ The image is built automatically on first run and cached. It rebuilds when the C
|
|
|
95
100
|
|
|
96
101
|
## Mounts
|
|
97
102
|
|
|
98
|
-
|
|
103
|
+
Pass `-m` once for a single mount (lands at `/workspace`) or multiple times for named mounts (each lands at `/workspace/<dirname>`).
|
|
99
104
|
|
|
100
105
|
```sh
|
|
101
|
-
|
|
102
|
-
cbox run
|
|
103
|
-
cbox run
|
|
106
|
+
# Single mount — lands at /workspace
|
|
107
|
+
cbox run -m . # /workspace = cwd (read-write)
|
|
108
|
+
cbox run -m ./src:ro # /workspace = ./src (read-only)
|
|
109
|
+
cbox run -m /abs/path # /workspace = /abs/path (read-write)
|
|
110
|
+
|
|
111
|
+
# Multiple mounts — each named by directory basename
|
|
112
|
+
cbox run -m ./src -m ./tests # /workspace/src + /workspace/tests
|
|
113
|
+
cbox run -m ./src -m ./data:ro # /workspace/src (rw) + /workspace/data (ro)
|
|
104
114
|
```
|
|
105
115
|
|
|
106
116
|
## Tools Inside the Container
|
|
@@ -195,7 +205,7 @@ Old images are left in place after upgrades. Clean them up with `docker image pr
|
|
|
195
205
|
## Building from Source
|
|
196
206
|
|
|
197
207
|
```sh
|
|
198
|
-
git clone https://
|
|
208
|
+
git clone https://gitlab.com/mehrad.meraji/cbox
|
|
199
209
|
cd cbox
|
|
200
210
|
bun install
|
|
201
211
|
bun run build # produces dist/cbox
|
package/dist/cbox
CHANGED
|
Binary file
|
package/package.json
CHANGED