instabox 0.8.14 → 0.8.15
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/cli/SHA256SUMS +6 -6
- package/cli/instabox-darwin-amd64 +0 -0
- package/cli/instabox-darwin-arm64 +0 -0
- package/cli/instabox-linux-amd64 +0 -0
- package/cli/instabox-linux-arm64 +0 -0
- package/cli/instabox-windows-amd64.exe +0 -0
- package/cli/instabox-windows-arm64.exe +0 -0
- package/package.json +1 -1
- package/skills/instabox/SKILL.md +2 -1
- package/skills/instabox-snapshots/SKILL.md +1 -1
package/cli/SHA256SUMS
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
f9666e3400fc74e5ae1e3eaba27176b5bb4211ec57d4fa2438ac65bd2a6c66b6 instabox-darwin-amd64
|
|
2
|
+
2c4c41f3361969cfb16791fe83f5146f9d53b014aaf68b31a1966e18abfaeffb instabox-darwin-arm64
|
|
3
|
+
ae8bd38ba424aa03a75dbde37d64f925eab29c245600c3dd32f9922b427e7b08 instabox-linux-amd64
|
|
4
|
+
515c926e99dd965146018025c50e3fb039e5fa8928d422d00e1c825b9581c187 instabox-linux-arm64
|
|
5
|
+
d49b67b8a5591ac98a5f4d15df0ede5e1e7112db2dd4fb6587d745a8632e73e9 instabox-windows-amd64.exe
|
|
6
|
+
4b04521b7daea52f11bf0fe68b91310960ba0ed6c0cf15650711422d6ddf676d instabox-windows-arm64.exe
|
|
Binary file
|
|
Binary file
|
package/cli/instabox-linux-amd64
CHANGED
|
Binary file
|
package/cli/instabox-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/skills/instabox/SKILL.md
CHANGED
|
@@ -92,9 +92,10 @@ instabox rm --yes work # delete the box (without --yes
|
|
|
92
92
|
- For a one-off job that needs no box afterwards, use `instabox run [--template T | --from SNAPSHOT] [--name N] [--push DIR] [--cwd D] [-e K=V ...] [--timeout 60s] [--keep] [--setup-file PATH|-] [--json] -- <cmd...>` instead of create + exec + rm: it deletes the box even when the command fails or the run is interrupted (Ctrl-C, SIGTERM), and exits with the command's code (124: timed out). Its own failures have their own codes: 2 usage, 75 `--fail-fast` and no host has room (retry later), 125 `run` itself failed (API, network, create, upload or cleanup), 130 interrupted; with `--json` they print the `{"error": {...}}` object, except a failed cleanup delete: the result then has `deleted: false` and `cleanup: {"error": {...}}` (stdout is always one JSON document). One argument is a shell string, several an exact argv. The same 10-minute limit as `exec` applies. `--push .` first uploads the current directory's files (those git does not ignore) into the working directory (`--cwd`, default HOME), so `instabox run --push . -- 'go test ./...'` tests your checkout. `--name N` is used as is (1-63 lowercase letters, digits or `-`, starting with a letter or digit; default `run-<8 hex digits>`). A box left behind by a killed CLI is deleted by the server at its `deleteAt`, 5 minutes after its timeout (10 with `--push`, plus another timeout with `--setup-file`); a cleanup delete that gets a 5xx, a retryable error or no answer is retried 5 times with backoff. `--setup-file PATH|-` runs a setup script (at most 64 KB) first, in HOME with the same `--timeout` and `-e` variables (after `--push`); if it fails, `run` exits with its code without running the command. `--keep` keeps the box with no deadline and, once it was created, prints `Kept NAME; delete it with: instabox rm --yes NAME` to stderr (stdout stays the command's; `--json` has it as `sandbox`); a failed create operation prints only its error (one whose wait was cut short is kept, with `Kept NAME, whose create had not finished; …`).
|
|
93
93
|
- `instabox ps work [--all] [--json]` lists the processes running in the box (the server runs `ps` through exec, so it wakes a box that paused itself). Kernel threads and the listing's own processes (its shell, `ps`, `head` and the sshd sessions exec uses) are left out unless `--all`. `--json` prints an array of `{pid, ppid, user, cpuPercent, memPercent, elapsedSeconds, command}`: `instabox ps work --json | jq '.[] | select(.command | test("node"))'`. A stopped or manually paused box shows the list the server read just before it stopped or paused (a stderr note says when it is from), so you can see what was running when a box went down; a box that was never listed while running says so and asks you to start it.
|
|
94
94
|
- `instabox history work [--limit N] [--json]` lists the commands run in the box through `exec` (by anyone: the CLI, the API, other agents; not SSH sessions), newest first, with ID, start time, duration and exit code, also while the box is stopped. The server keeps the newest 200 with the first 64 KiB of each output stream. `instabox output work [ex_<id>]` prints a past command's stored stdout and stderr (the last command's by default) and exits with its exit code, as `exec` did; `--json` gives `{id, command, cwd, startedAt, durationMs, status, exitCode, stdout, stderr, ...}`. Use them to find out what an earlier session or another agent ran in a box and what it printed, instead of rerunning it. The `jobs` polls and `ps` are not recorded; `exec --background` is recorded as `exec --background: <cmd>` (its output is in `jobs logs`).
|
|
95
|
-
- To copy a box (try something risky, or run agents side by side from the same state), use `instabox fork work [--name N] [--count N] [--keep-snapshot] [--json]` (`clone` works too):
|
|
95
|
+
- To copy a box (try something risky, or run agents side by side from the same state), use `instabox fork work [--name N] [--count N] [--keep-snapshot] [--json]` (`clone` works too): the server copies `work`'s disks (running or stopped) on its host into `--count` boxes (1-5) with the same template and size and boots them, in a few seconds and with no snapshot (memory and running programs are not copied); with an older server that has no native fork, or with `--keep-snapshot`, it saves a snapshot, creates the boxes from it and deletes the snapshot, also on error or Ctrl-C, unless `--keep-snapshot`; a suspended box is copied neither way, so resume or stop it first. `work` is not changed. Several boxes are named `N-1` to `N-N`; each box counts toward the plan's starts a minute, which fork waits out (up to 5 minutes in total). If the source's size is no longer one of the plan's sizes, pass `--vcpus N --mem-mib M`. On a failure part-way it prints which boxes were created; they are kept, so delete those you do not need. `--json` prints `{source, machines, native, snapshotId, snapshotName, kept, snapshotMs, createMs, totalMs}` (`native` true: no snapshot was used).
|
|
96
96
|
- `exec` returns the command's exit code and takes `--stdin` to pipe input (any size up to 5 GiB, binary too: `instabox exec work --stdin -- tar -xz -C /data/workspace < src.tgz`). `exec --json` prints one object instead of the raw output (`stdout`, `stderr`, `exitCode`, `signal`, `timedOut`, `truncated`, `invalidUtf8`, `durationMs`) and still exits with the command's code: `instabox exec work --json -- make test | jq .exitCode`. exec output is UTF-8 text: each stream is cut at 1 MiB (`truncated`; `--stream` has no cap) and bytes that are not UTF-8 become U+FFFD (`invalidUtf8`), so never copy a file out with `exec -- cat` (an APK or tarball comes back corrupt); use `pull`/`cp`. A cut is noted on stderr and keeps the exit code; when the command exits 0 but its output was binary, exec says so on stderr and exits 65 (its own code, like 75 and 125, so it never looks like the command's). `exec --stream` prints the output as the command writes it instead of at the end (same timeout and exit code; with `--json`, one `{"type":"stdout"|"stderr","data"}` object per line, then `{"type":"exit","exitCode",...}`), so you can watch a build or test run as it goes. It stops the command after `--timeout` seconds: 60 by default, 600 at most (whole seconds; `run`'s also takes `90s` or `5m`). A larger or unparsable value is a one-line usage error, exit 2. It returns when the command exits, even if it left a process running in the background (`instabox exec work -- 'nohup ./server >server.log 2>&1 &'` returns at once and the server keeps running); background output written later than about a second after the exit is not returned, and a background process that still writes to exec's stdout or stderr after that gets a broken pipe (it may die, or a server may drop requests), so send both to a file (`>log 2>&1`) or use `exec --background`. Run longer commands (installs, builds, test suites) over SSH, which also returns the exit code: `instabox ssh work -- 'cd /data/workspace/app && npm ci'`. The box's runtime cap still applies during SSH or exec.
|
|
97
97
|
- For work past 600 s, or to keep going while you do something else, start a background job: `instabox exec --background work -- 'npm run build'` prints a job ID at once (`--json`: `{jobId, pid}`); then `instabox jobs ls work`, `instabox jobs logs work <job> -f` (streams until it ends, exits with its code; Ctrl-C leaves the job running), `instabox jobs wait work <job> [--timeout 30m]` and `instabox jobs kill work <job> [--signal KILL]` (the whole process group). This is the CLI polling over plain exec calls. A job holds no activity lease: only its CPU use, or a running `jobs wait`/`logs -f`, counts as activity, so keep `jobs wait` going for a quiet job you need to finish. A pause freezes the job and it carries on after resume; a stop ends jobs (`exited(143)`, or `lost` after a hard stop).
|
|
98
|
+
- To hand a task to a coding agent inside the box, use `instabox agent`: `instabox agent prompt work [--provider claude|codex] [--model M] [--new | --resume ID] [--attach FILE] [--cwd D] [--env K=V] [-f] [--json] "text"` starts a turn as a background job (`claude -p --output-format stream-json` or `codex exec --json`, permission prompts and sandboxing skipped: the box is the boundary) and prints the conversation ID (`--json`: `{conversationId, turn, jobId, pid}`; `-f` follows the turn and exits with its code). `instabox agent events work [-c ID] [-f] [--json]` prints the conversation's events, one JSON object per line: the agent's own, between `instabox.turn` (with the prompt) and `instabox.turn_end` (`exitCode`, `interrupted`). `instabox agent steer work [-c ID] "text"` interrupts the running turn, if any, and resumes the agent's session with the text; `instabox agent interrupt work [-c ID]` stops the turn (INT, then TERM, then KILL); `instabox agent ls work [--json]` lists conversations (status `running`, `idle`, `interrupted`, `failed(N)` or `lost`). Without `-c`, the conversation prompted last. The agent needs its key in the box's environment: `ANTHROPIC_API_KEY` (or `CLAUDE_CODE_OAUTH_TOKEN`) for claude, `OPENAI_API_KEY` (or `CODEX_API_KEY`) for codex, from an org Secret the box selects, or `--env`; the CLI warns when none is set. When the template lacks the agent CLI, the first turn installs it with npm into `~/.instabox/agent-cli` (an `instabox.install` event), or fails with an `instabox.error` event when there is no npm. State lives in `~/.instabox/agents/<id>` in the box. A turn waiting on the model API looks idle to auto-suspend (network does not count), so keep `agent events -f` (or `prompt -f`) going for a long turn you need to finish.
|
|
98
99
|
- A box that does not boot, is unreachable, or failed to start or resume: `instabox logs work` prints its console log (kernel and systemd boot messages) and its last 20 operations with their errors, in any state, without waking it. Add `-f` to follow it or `--json` for `GET /v1/machines/{id}/logs`.
|
|
99
100
|
- Output: `--json` (or `-o json`) works on every command (each command's `-h` lists it); `ssh`, `mosh` and `port-forward` are interactive and refuse it with the JSON error code `json_unsupported` (use `exec --json`). With JSON output a failure prints `{"error":{"code","message",...}}` on stdout instead of text on stderr and still exits non-zero (2 for usage errors, code `usage`); API errors keep the server's `code`, `status` and `requestId`. Piped, the list and status commands (`ls`, `get`, `templates`, `usage`, `snapshot ls`, `port ls`, `keys ls`, `secrets ls`, `vault ls`, `workspace ls|get|members|invites`) print JSON on their own, so `instabox ls | jq` works; `--output table` or `INSTABOX_NO_AUTO_JSON=1` keeps the table. `exec`, `ssh`, `files` and the other commands print the same output piped or not.
|
|
100
101
|
- The box's HOME has `MACHINE.md` (which box it is, its size, what survives a stop, the installed tools) and `AGENTS.md`, a moment after it starts. They are reference for when a task needs a fact about the box, not steps to run first.
|
|
@@ -42,7 +42,7 @@ This reads the snapshot's root disk only; `/data` (and HOME) are not browsable h
|
|
|
42
42
|
|
|
43
43
|
## Copy a box
|
|
44
44
|
|
|
45
|
-
`instabox fork` does it in one command: it
|
|
45
|
+
`instabox fork` does it in one command: it copies a running or stopped box into a new box (or `--count` up to 5, named `NAME-1` to `NAME-N`) with the same template and size and waits until it runs. The server copies the disks on the box's host and boots the copy in a few seconds, with no snapshot; memory and running programs are not copied. With an older server that has no native fork, or with `--keep-snapshot`, it goes through a snapshot (save, create, delete unless `--keep-snapshot`). A suspended box is copied neither way: resume or stop it first. The source box is not changed.
|
|
46
46
|
|
|
47
47
|
```sh
|
|
48
48
|
instabox fork work --name work2
|