aibox-cli 0.3.0 → 0.4.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 +14 -4
- package/bin/aibox +37 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -19,11 +19,8 @@ On macOS, if Docker isn't installed, aibox will offer to install [Colima](https:
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
# first time (once)
|
|
23
|
-
aibox build
|
|
24
|
-
|
|
25
22
|
# in any project directory
|
|
26
|
-
aibox up # start container
|
|
23
|
+
aibox up # start container (auto-builds image on first run)
|
|
27
24
|
aibox claude --yolo # no prompts, full sudo, no firewall
|
|
28
25
|
aibox claude --safe # keep prompts, restricted sudo, firewall on
|
|
29
26
|
aibox claude # asks you each time
|
|
@@ -71,6 +68,17 @@ aibox down --all # stop all containers for this project
|
|
|
71
68
|
aibox nuke # remove ALL aibox containers
|
|
72
69
|
```
|
|
73
70
|
|
|
71
|
+
### From a Git Repo
|
|
72
|
+
|
|
73
|
+
Start directly from a repo URL — aibox clones it and runs:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
aibox --repo https://github.com/user/project.git claude --yolo
|
|
77
|
+
aibox --repo git@github.com:user/project.git --branch dev claude
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Repos are cloned to `~/.config/aibox/repos/` with `--recursive` (submodules included). On subsequent runs, the existing clone is reused.
|
|
81
|
+
|
|
74
82
|
### Custom Image
|
|
75
83
|
|
|
76
84
|
```bash
|
|
@@ -151,6 +159,8 @@ SHARED_MODULES=false
|
|
|
151
159
|
|-------|------|-------------|
|
|
152
160
|
| `-n` | `--name NAME` | Named instance (multiple containers per project) |
|
|
153
161
|
| `-d` | `--dir PATH` | Run in a different project directory |
|
|
162
|
+
| `-r` | `--repo URL` | Clone a git repo and run in it |
|
|
163
|
+
| `-b` | `--branch NAME` | Branch to checkout (with `--repo`) |
|
|
154
164
|
| `-i` | `--image NAME` | Override base Docker image |
|
|
155
165
|
| `-c` | `--copy` | Copy repo into Docker volume (full isolation) |
|
|
156
166
|
| `-w` | `--worktree` | Use git worktree (lightweight isolation) |
|
package/bin/aibox
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
# -n, --name NAME Run a named instance (e.g. -n refactor)
|
|
24
24
|
# Allows multiple containers per project
|
|
25
25
|
# -d, --dir PATH Run in a different project directory
|
|
26
|
+
# -r, --repo URL Clone a git repo and run in it
|
|
27
|
+
# -b, --branch NAME Branch to checkout (with --repo)
|
|
26
28
|
# -i, --image NAME Override base Docker image (default: aibox:latest)
|
|
27
29
|
# -c, --copy Copy project into container (full isolation, no host sync)
|
|
28
30
|
# -w, --worktree Use git worktree (lightweight isolation, stays on host)
|
|
@@ -185,6 +187,8 @@ IMAGE="$DEFAULT_IMAGE"
|
|
|
185
187
|
SHARED_MODULES=false
|
|
186
188
|
INSTANCE_NAME=""
|
|
187
189
|
PROJECT_DIR_FLAG=""
|
|
190
|
+
REPO_URL=""
|
|
191
|
+
REPO_BRANCH=""
|
|
188
192
|
DOWN_ALL=false
|
|
189
193
|
DOWN_CLEAN=false
|
|
190
194
|
SKIP_PERMISSIONS=false
|
|
@@ -207,6 +211,14 @@ parse_flags() {
|
|
|
207
211
|
PROJECT_DIR_FLAG="${2:?'--dir requires a value'}"
|
|
208
212
|
shift 2
|
|
209
213
|
;;
|
|
214
|
+
-r|--repo)
|
|
215
|
+
REPO_URL="${2:?'--repo requires a value'}"
|
|
216
|
+
shift 2
|
|
217
|
+
;;
|
|
218
|
+
-b|--branch)
|
|
219
|
+
REPO_BRANCH="${2:?'--branch requires a value'}"
|
|
220
|
+
shift 2
|
|
221
|
+
;;
|
|
210
222
|
--shared-modules)
|
|
211
223
|
SHARED_MODULES=true
|
|
212
224
|
shift
|
|
@@ -259,6 +271,31 @@ elif [[ "$SAFE_MODE" == "true" ]]; then
|
|
|
259
271
|
export AIBOX_MODE="safe"
|
|
260
272
|
fi
|
|
261
273
|
|
|
274
|
+
# ── Repo clone ───────────────────────────────────────────────────
|
|
275
|
+
if [[ -n "$REPO_URL" ]]; then
|
|
276
|
+
# Derive a directory name from the repo URL (hash prevents collisions)
|
|
277
|
+
_repo_name=$(basename "$REPO_URL" .git)
|
|
278
|
+
_repo_hash=$(printf '%s' "$REPO_URL" | shasum | cut -c1-6)
|
|
279
|
+
_repo_dir="${CONFIG_DIR}/repos/${_repo_name}-${_repo_hash}"
|
|
280
|
+
|
|
281
|
+
if [[ -d "$_repo_dir/.git" ]]; then
|
|
282
|
+
echo "Repo already cloned (${_repo_dir}). Reusing."
|
|
283
|
+
# Fetch latest and checkout branch if specified
|
|
284
|
+
if [[ -n "$REPO_BRANCH" ]]; then
|
|
285
|
+
git -C "$_repo_dir" fetch --all --quiet 2>/dev/null || true
|
|
286
|
+
git -C "$_repo_dir" checkout "$REPO_BRANCH" 2>/dev/null || true
|
|
287
|
+
fi
|
|
288
|
+
else
|
|
289
|
+
echo "Cloning ${REPO_URL}..."
|
|
290
|
+
mkdir -p "${CONFIG_DIR}/repos"
|
|
291
|
+
_clone_args=(--recursive)
|
|
292
|
+
[[ -n "$REPO_BRANCH" ]] && _clone_args+=(--branch "$REPO_BRANCH")
|
|
293
|
+
git clone "${_clone_args[@]}" "$REPO_URL" "$_repo_dir"
|
|
294
|
+
fi
|
|
295
|
+
|
|
296
|
+
PROJECT_DIR_FLAG="$_repo_dir"
|
|
297
|
+
fi
|
|
298
|
+
|
|
262
299
|
# ── Per-project config file (.aibox) ─────────────────────────────
|
|
263
300
|
if [[ -n "$PROJECT_DIR_FLAG" ]]; then
|
|
264
301
|
PROJECT_DIR="$(cd "$PROJECT_DIR_FLAG" 2>/dev/null && pwd)" || {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aibox-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Run AI coding agents in isolated Docker containers",
|
|
5
5
|
"author": "repalash <palash@shaders.app>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,5 +35,8 @@
|
|
|
35
35
|
],
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=18"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"release": "git tag v$npm_package_version && git push origin v$npm_package_version"
|
|
38
41
|
}
|
|
39
42
|
}
|