instabox 0.8.133 → 0.8.135
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/bin/instabox.mjs +21 -12
- 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 +3 -3
package/bin/instabox.mjs
CHANGED
|
@@ -245,8 +245,10 @@ async function newBox() {
|
|
|
245
245
|
return { id: op.machineId, name: body.name, user };
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
// Runs while the box starts; never fatal. Returns a line to print, or null
|
|
249
|
-
//
|
|
248
|
+
// Runs while the box starts; never fatal. Returns a line to print, or null: a string, or
|
|
249
|
+
// { line, tryLs, more } when `instabox ls` is worth suggesting after it (reportInstalls decides).
|
|
250
|
+
// The CLI comes from this package only (cli/<build>); without one for this machine there is
|
|
251
|
+
// nothing to install.
|
|
250
252
|
async function ensureCli() {
|
|
251
253
|
if (process.argv.includes('--no-cli')) return null;
|
|
252
254
|
const found = findCli();
|
|
@@ -269,7 +271,7 @@ async function ensureBundledCli(bundled, found) {
|
|
|
269
271
|
if (found) {
|
|
270
272
|
const [version, have] = await Promise.all([cliVersion(found), sha256File(found).catch(() => null)]);
|
|
271
273
|
const v = version ? ` ${version}` : '';
|
|
272
|
-
if (want && have === want) return `instabox CLI${v} is up to date
|
|
274
|
+
if (want && have === want) return { line: `instabox CLI${v} is up to date`, tryLs: true };
|
|
273
275
|
if (version === 'dev' || version?.endsWith('-dirty'))
|
|
274
276
|
return `instabox CLI at ${found} is a development build (${version}), left as is`;
|
|
275
277
|
// Replace it where it is, through a symlink the file it points to, so whatever manages the
|
|
@@ -286,20 +288,27 @@ async function ensureBundledCli(bundled, found) {
|
|
|
286
288
|
}
|
|
287
289
|
const r = await installBundled(bundled, { path: real(found) });
|
|
288
290
|
if (r.error) return `instabox CLI${v} at ${found} could not be updated ${dim(`(${r.error})`)}`;
|
|
289
|
-
return `instabox CLI updated${v ? ` from${v}` : ''} to ${r.version} at ${found}
|
|
291
|
+
return { line: `instabox CLI updated${v ? ` from${v}` : ''} to ${r.version} at ${found}`, tryLs: true };
|
|
290
292
|
}
|
|
291
293
|
const r = await installBundled(bundled);
|
|
292
294
|
if (r.error) return `instabox CLI not installed ${dim(`(${r.error})`)}`;
|
|
293
|
-
return
|
|
294
|
-
`instabox CLI ${r.version} installed at ${r.path}
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
return {
|
|
296
|
+
line: `instabox CLI ${r.version} installed at ${r.path}`,
|
|
297
|
+
tryLs: true,
|
|
298
|
+
more: r.pathHint ? `\n ${dim('add it to your PATH:')} ${r.pathHint}` : '',
|
|
299
|
+
};
|
|
297
300
|
}
|
|
298
301
|
|
|
299
302
|
// Waits for the CLI install started earlier, installs the skills, and prints a line for each.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
+
// With boxShellNext the box's shell opens right after, so no `instabox ls` hint: it would read
|
|
304
|
+
// as something to type in the box, where the CLI is not signed in.
|
|
305
|
+
async function reportInstalls(cli, { boxShellNext = false } = {}) {
|
|
306
|
+
const r = await cli;
|
|
307
|
+
if (r) {
|
|
308
|
+
const { line, tryLs = false, more = '' } = typeof r === 'string' ? { line: r } : r;
|
|
309
|
+
const hint = tryLs && !boxShellNext ? ` ${dim('· try')} instabox ls` : '';
|
|
310
|
+
console.log(` ${green('✓')} ${line}${hint}${more}`);
|
|
311
|
+
}
|
|
303
312
|
if (process.argv.includes('--no-skills')) return;
|
|
304
313
|
const roots = skillRoots([]);
|
|
305
314
|
const skillsLine = describeSkills(installSkills(roots));
|
|
@@ -481,7 +490,7 @@ async function onboard(wantBox) {
|
|
|
481
490
|
process.stdout.write(`\r ${green('✓')} box ${bold(m.name)} ${ready}\n`);
|
|
482
491
|
const note = guestUserNote(box.user, m.name, m.guestUser);
|
|
483
492
|
if (note) console.log(dim(` ${note}`));
|
|
484
|
-
await reportInstalls(cli);
|
|
493
|
+
await reportInstalls(cli, { boxShellNext: true });
|
|
485
494
|
await report('ready', { box_ready_ms: boxMs, ssh: true });
|
|
486
495
|
console.log(dim(` type ${'exit'} to leave · stuck? press Enter, then ~.`));
|
|
487
496
|
// The box's prompt is ~37 columns; narrower terminals make bash scroll the input line sideways.
|
package/cli/SHA256SUMS
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
f0284eb5a9bb40483d883882fe2fcbff21a6ce80ed3aa132d2c0084d5563b61c instabox-darwin-amd64
|
|
2
|
+
3387a5d741f32999fbc5baa445c42128976cf6f0aff780185f3952ea26a4073d instabox-darwin-arm64
|
|
3
|
+
72a10fb5cf9981996e1a4b09f937b0715a046e74cc35021fd0e75572d08c69b6 instabox-linux-amd64
|
|
4
|
+
9588d7e7491f26b73ba8d8677bfae6075713ade485a941845f1135616c3e4945 instabox-linux-arm64
|
|
5
|
+
629db360085337896e8414090e3ad3780b96883829d427693985125e9e8331fe instabox-windows-amd64.exe
|
|
6
|
+
a635a3dec4c5d709d19ae5d97d5c8079e0d3b9bc36a827507b1691ce1a673637 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
|
@@ -88,7 +88,7 @@ instabox rm --yes work # delete the box (without --yes
|
|
|
88
88
|
- `create --devcontainer [PATH|DIR]` (also `run --devcontainer`) builds a box from a repo's devcontainer.json (default `.devcontainer/devcontainer.json` or `.devcontainer.json` here; JSONC): it pushes the repo into `workspaceFolder` (default `/workspaces/<dir>`), writes `containerEnv`/`remoteEnv` to `/etc/profile.d/instabox-devcontainer.sh` (login shells, nested `bash -l` and `instabox ssh BOX -- cmd` all get it; `PATH` entries appear once), installs `features` via their install.sh (ones the template already has, such as node/python/go/docker-in-docker/github-cli at the default version, are skipped), and runs `onCreateCommand`/`updateContentCommand`/`postCreateCommand`/`postStartCommand` in the workspace. Do not install the Dev Containers CLI in a box for this. `image`/`build`/compose are not booted (boxes are VM templates); the summary (stderr, or `--json`'s `devcontainer`: `applied`, `skipped`, `ports`, `steps`, `status`, `failedStep`) says what was skipped, and `forwardPorts` come with `instabox port-forward`/`port publish` commands. A failed step exits with its code and keeps the box (`metadata.setupStep` names it); `--name` defaults to the config's name. `${devcontainerId}` is the box's name; the summary shows commands as written (a `${localEnv:TOKEN}` is not printed), but the profile file keeps env values (readable by root and the box user's group, and in snapshots). In `run`, write `--devcontainer=PATH` when a command follows without `--`.
|
|
89
89
|
- Idle auto-pause defaults to 30 minutes. Paid boxes allow any whole minute from 5 to 30 (a part minute, below 5m or above 30m is refused, nothing created), or `0` to turn it off. Free boxes keep 30 minutes unless an admin grants an idle override; asking another value on a free box fails (`spec_not_allowed`, exit 5, nothing created), so leave `--auto-suspend` out there. Idle means no agent working, no terminal use and little CPU. `create --json` and `get --json` show the effective setting as `autoSuspendAfterSeconds` (`0`: off), and `readyAt` minus `createdAt` is the create time.
|
|
90
90
|
- Max run minutes is independent of idle activity: `-1` is unlimited, `0` pauses immediately, and a positive integer forces a pause after that many running minutes. Free boxes have a fixed 480-minute cap that only an admin session can change; paid boxes default to `-1` and can change it. An idle override does not permit changes to a free box's runtime cap. The first limit reached pauses the box; both timers restart after sleep and wake.
|
|
91
|
-
- A runtime pause blocks every wake path during a server-configured cooldown, 5 to 20 minutes by default (`409 machine_cooldown` with `Retry-After`). Wait until the `cooldownUntil` deadline shown by `instabox get`; edits cannot clear it. Afterward,
|
|
91
|
+
- A runtime pause blocks every wake path during a server-configured cooldown, 5 to 20 minutes by default (`409 machine_cooldown` with `Retry-After`). On the free plan, back-to-back max-run pauses rest longer: 60 to 75 minutes for the 2nd in a row and 120 to 135 for later ones; the count starts over when a run ends with no cooldown owed (idle pause, a user pause or stop) or starts 2 hours or more after the last cooldown. A security lock (up to 24 h) is a cooldown too and keeps the count. Wait until the `cooldownUntil` deadline shown by `instabox get`; edits cannot clear it. Afterward, a box that paused itself (idle or runtime) wakes on `exec`, `ssh`, `files`, a public port request or `instabox wake <box>`. A box you paused (`instabox suspend`) or stopped does not wake on any of these, `wake` included: run `instabox resume <box>` or `instabox start <box>`. A zero runtime cap must be changed before waking. A normal pause preserves memory and processes.
|
|
92
92
|
- `sudo reboot` inside a box reboots it: `instabox get` shows `starting`, then `running` (same disks, processes gone); wait for `running` before the next `exec`. `sudo poweroff` inside stops it until `instabox start`. Boxes from older template versions stop on a reboot too: start them.
|
|
93
93
|
- If `exec`/`ssh` stop answering (hang or time out on a running box), run `instabox restart <box>` (alias `recover`; `--timeout 20s` shortens the wait, `--json` prints the box). It stops the box, killing the VM if it has not shut down by the timeout (60 seconds by default), then starts it and waits until it runs. Files on the root disk and `/data` stay; processes do not, so start your servers again. A paused box is not hung: resume it. A box stuck in `starting` with no start in progress cannot be restarted; restart says so.
|
|
94
94
|
- Disk full (`df -h /data`)? Grow it with `instabox resize <box> --disk N` (`/data`, where HOME is), in GB. A running box grows online, no restart. A shrink, a paused box, or an image that can't grow online needs `--restart` (it stops the box, resizes the disk and starts it again; files stay, processes do not), else resize changes nothing and says so. A shrink must fit your data plus 10% (at least 1 GB), else it's refused (`disk_too_small`) and nothing changes. Free-plan boxes keep their size. The system disk (`/`) is the template's; you can't grow it.
|
|
@@ -107,7 +107,7 @@ instabox rm --yes work # delete the box (without --yes
|
|
|
107
107
|
- Output: `--json` (or `-o json`) works on every command (each command's `-h` lists it); the only exceptions are `ssh`, `mosh` and `port-forward`, which 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`, `requestId` and `retryable` (present when true). 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.
|
|
108
108
|
- Exit codes: a failed command exits 1 for any other error, 2 usage, 3 auth (not signed in, a bad or expired key, no permission: 401/403), 4 not found (404), 5 quota or plan limit (`quota_exceeded`, `credit_exhausted`, `spend_limit_reached`, `spec_not_allowed`, other 402/429), 75 retryable (`retryable: true`, such as `no_capacity` and `host_unavailable`, or another 5xx; retry with backoff). `--json` errors exit the same way. Commands that run something (`exec`, `ssh`, `jobs wait`, `output`, `run`, ...) exit with its code instead. Branch on the code (`case $? in 4) ...`), not on message text.
|
|
109
109
|
- 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.
|
|
110
|
-
- A public URL for a web server in the box: `instabox port publish work 3000` prints it (`instabox port ls`, `instabox port unpublish work 3000`). The URL works while the box runs.
|
|
110
|
+
- A public URL for a web server in the box: `instabox port publish work 3000` prints it (`instabox port ls`, `instabox port unpublish work 3000`). The URL works while the box runs. A request wakes a box that paused itself for being idle; a box you paused or stopped answers `503` (Sandbox offline) until you `instabox resume` or `instabox start` it.
|
|
111
111
|
- A raw TCP service (Postgres, Redis) reachable from anywhere, where the server enables it: `instabox port publish work 5432 --tcp` prints `5432-<id>.<tcp domain>:443`; clients connect with TLS and that host as SNI (`psql "host=<host> port=443 sslmode=require user=postgres"`). Otherwise, or for a private tunnel, use `instabox port-forward work 5432`.
|
|
112
112
|
- A private tunnel instead, only from your computer: `instabox port-forward work 8080:3000` (alias `forward`; `LOCAL` defaults to `REMOTE`, several ports at once) serves the box's port 3000 at `http://127.0.0.1:8080` over SSH and stays in the foreground until Ctrl-C, so start it in the background (`instabox port-forward work 8080:3000 &`) and kill it when done. It fails at once when the local port is busy.
|
|
113
113
|
|
|
@@ -136,7 +136,7 @@ instabox create --name tenant --no-vault --secrets none
|
|
|
136
136
|
- Org commands default to the signed-in user's personal org. Use `--org` for a team, and select only Secrets from the box's org. Value, host and deletion changes require the org owner/admin: a sign-in, or headless the workspace's own API key with `workspace:admin` in `INSTABOX_API_KEY` (org commands then default to the key's org; `secrets rm` needs `--yes` without a terminal). A personal org's key and keys with only machine scopes can inspect metadata and manage sandbox selections, but cannot change Secret values (`403 missing_scope`). No key or session can retrieve a value.
|
|
137
137
|
- For model provider keys use `--ai anthropic|openai|gemini|openrouter` (repeatable, combinable with `--host`): it scopes the key to `api.anthropic.com`, `api.openai.com`, `generativelanguage.googleapis.com` or `openrouter.ai`. The box only sees a placeholder, in its environment and in any file a tool writes, so the real key is never on its disk or in snapshots. Gemini keys must go in the `x-goog-api-key` header, not `?key=`. To block a box from all Secrets, `secrets select BOX --secrets none`; unblock with `--secrets all` or names. When the server records usage, `secrets show BOX` lists each Secret's proxied and denied request counts.
|
|
138
138
|
- `secrets select BOX --secrets` replaces the box's selection: `all`, `none`, comma-separated names, or a JSON array (which allows a Secret literally named `all` or `none`). Keep existing names when adding one.
|
|
139
|
-
- Placeholders work only in HTTPS request headers on port 443 to the allowed hosts. Apart from Basic auth in `Authorization`, which the proxy decodes and re-encodes, do not hash, encode, or sign with a placeholder; other traffic carries the placeholder unchanged.
|
|
139
|
+
- Placeholders work only in HTTPS request headers on port 443 to the allowed hosts. Apart from Basic auth in `Authorization`, which the proxy decodes and re-encodes, do not hash, encode, or sign with a placeholder; other traffic carries the placeholder unchanged. HTTP/3 (QUIC, UDP 443) bypasses the proxy: start a Chromium-based browser that sends Secrets with `--disable-quic` (Playwright/Puppeteer: `args: ['--disable-quic']`).
|
|
140
140
|
- Rotating a value keeps its placeholder, so running clients need no change. Newly selected names appear in new shells that load the managed environment; restart existing applications to pick them up.
|
|
141
141
|
- For a box intended for another person or tenant, disable personal Vault injection with `--no-vault` and select only the org Secrets they may use. For a fresh box with neither system's credentials, use `--no-vault --secrets none`. An empty Secret selection alone still permits Vault injection. These flags do not remove credentials already copied into a source snapshot.
|
|
142
142
|
- For an existing box, disable Vault with `start BOX --no-vault` or `resume BOX --no-vault` and clear the Secret selection with `secrets select BOX --secrets none`. Refresh a running guest with both `vault push BOX` and `secrets push BOX`. Vault values already copied into processes or files remain there; disabling Vault does not recover them.
|