@_mehrad/cbox 0.1.2 → 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.
Files changed (3) hide show
  1. package/README.md +36 -26
  2. package/dist/cbox +0 -0
  3. package/package.json +1 -1
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 --mount .
25
+ cbox session -m .
26
26
 
27
27
  # Mount current directory and run a task from a file
28
- cbox run -f task.md --mount .
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" --mount ./src
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>" # implicit run
40
- cbox run "<prompt>" # explicit (same behaviour)
41
- cbox run -f task.md # prompt from file
42
- cbox run -j "<prompt>" # JSON output
43
- cbox run --mount . "<prompt>" # mount cwd read-write
44
- cbox run --mount ./src:ro "<prompt>" # mount read-only
45
- cbox run --env KEY=VALUE "<prompt>" # pass env var into container
46
- cbox run --no-config "<prompt>" # skip mounting ~/.claude
47
- cbox run --no-browser "<prompt>" # skip agent-browser (lighter image)
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 # start interactive session
56
- cbox session --mount . # mount cwd read-write
57
- cbox session --mount ./src:ro # mount read-only
58
- cbox session --name refactor-auth # named session
59
- cbox session --env KEY=VALUE # pass env var
60
- cbox session --no-config # skip mounting ~/.claude
61
- cbox session --no-browser # lighter container
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
- | `--mount <path>` or `--mount <path>:ro` | `run`, `session` | Mount a host path into `/workspace` (default: read-write) |
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
- `--mount .` resolves to the absolute path of your cwd at invocation time and mounts it as `-v /abs/path:/workspace:rw` inside the container. All mounts land at `/workspace`.
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
- cbox run --mount . # /workspace = cwd (read-write)
102
- cbox run --mount ./src:ro # /workspace = ./src (read-only)
103
- cbox run --mount /abs/path # /workspace = /abs/path (read-write)
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://github.com/mehrad/cbox
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_mehrad/cbox",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Claude Sandbox CLI — run Claude Code in Docker",
5
5
  "bin": {
6
6
  "cbox": "dist/cbox"