instabox 0.4.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 CHANGED
@@ -29,6 +29,6 @@ npx --package=./instabox-0.4.0.tgz instabox --help
29
29
 
30
30
  ## Release
31
31
 
32
- Bump `version` in `package.json`, merge, then push a tag `npm-v<version>` (for example `git tag npm-v0.4.1 && git push origin npm-v0.4.1`). [`npm-release.yml`](../.github/workflows/npm-release.yml) checks the tag against `package.json`, runs the tests and publishes through npm trusted publishing, so there is no npm token anywhere. A version with a `-` (`0.5.0-rc.1`) goes to the `next` dist-tag, never to `latest`.
32
+ Bump `version` in `package.json` and merge that to `main`. [`npm-release.yml`](../.github/workflows/npm-release.yml) publishes when the merged commit is the one that changed the version: it runs the tests, publishes through npm trusted publishing (so there is no npm token anywhere), then tags the commit `npm-v<version>`. Nothing to tag or push by hand, and anyone who can merge can release - npm maintainer access is not needed. A version with a `-` (`0.5.0-rc.1`) goes to the `next` dist-tag, never to `latest`. If a publish fails after its merge, re-run the workflow from the Actions tab; it does nothing when the version is already on the registry.
33
33
 
34
34
  The trusted publisher is set on npmjs.com, package `instabox` → Settings → Trusted Publisher: GitHub Actions, `InsForge` / `instabox` / `npm-release.yml`. The very first publish, before the package existed, was by hand with `npm publish --access public` from this directory.
package/bin/instabox.mjs CHANGED
@@ -184,9 +184,8 @@ async function waitOp(op) {
184
184
  return op;
185
185
  }
186
186
 
187
- const LISTED = Symbol('listed');
188
-
189
- // The box to enter, null for a new one, or LISTED when there is no terminal to ask which one.
187
+ // The box to enter, null for a new one, or { listed: <name> } when there is no terminal to ask
188
+ // which one; the name is the box the list puts first, so the hint below is ready to paste.
190
189
  async function chooseBox() {
191
190
  const { machines = [] } = await client
192
191
  .call('GET', '/v1/machines?limit=100')
@@ -203,7 +202,7 @@ async function chooseBox() {
203
202
  ` ${ask ? `${i + 1}) ` : ''}${b.name.padEnd(w)} ${b.state.padEnd(9)} ${dim(`${b.template?.id || ''} created ${new Date(b.createdAt).toLocaleString()}`)}`,
204
203
  ),
205
204
  );
206
- if (!ask) return LISTED;
205
+ if (!ask) return { listed: boxes[0].name };
207
206
  console.log(` ${boxes.length + 1}) ${green('+ new box')}`);
208
207
  const rl = createInterface({ input: process.stdin, output: process.stdout });
209
208
  try {
@@ -237,7 +236,7 @@ async function newBox() {
237
236
  const named = images.filter((i) => i.name === IMAGE || i.id === IMAGE);
238
237
  const img = named.find((i) => i.official) || named[0];
239
238
  const body = {
240
- name: `demo-${randomBytes(3).toString('hex')}`,
239
+ name: `box-${randomBytes(3).toString('hex')}`,
241
240
  desiredState: 'running',
242
241
  };
243
242
  if (img) body.imageId = img.id;
@@ -260,7 +259,7 @@ async function ensureCli() {
260
259
  }
261
260
 
262
261
  // Agent skills shipped in this package (skills/<name>/SKILL.md) into the folders coding agents
263
- // read. Overwrites only copies we installed earlier (marked `installed-by: instabox-demo`).
262
+ // read. Overwrites only copies we installed earlier (marked `installed-by: instabox`).
264
263
  function installSkills() {
265
264
  if (process.argv.includes('--no-skills')) return null;
266
265
  const src = join(dirname(fileURLToPath(import.meta.url)), '..', 'skills');
@@ -276,7 +275,7 @@ function installSkills() {
276
275
  for (const n of names) {
277
276
  const dest = join(root, n, 'SKILL.md');
278
277
  try {
279
- if (existsSync(dest) && !readFileSync(dest, 'utf8').includes('installed-by: instabox-demo')) continue;
278
+ if (existsSync(dest) && !readFileSync(dest, 'utf8').includes('installed-by: instabox')) continue;
280
279
  mkdirSync(join(root, n), { recursive: true });
281
280
  writeFileSync(dest, readFileSync(join(src, n, 'SKILL.md')));
282
281
  done.add(n);
@@ -307,10 +306,10 @@ async function sh() {
307
306
 
308
307
  const cli = ensureCli();
309
308
  const picked = await chooseBox();
310
- if (picked === LISTED) {
309
+ if (picked?.listed) {
311
310
  await reportInstalls(cli);
312
311
  console.log(
313
- `\n Which box? ${bold('npx instabox@latest --box NAME')} enters one, ${bold('instabox create --name NAME')} starts a new one.\n`,
312
+ `\n Which box? ${bold(`npx instabox@latest --box ${picked.listed}`)} enters it, ${bold('instabox create --name NAME')} starts a new one.\n`,
314
313
  );
315
314
  return;
316
315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instabox",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A cloud box for your coding agent, the instabox CLI and its agent skills in one command: npx instabox@latest",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,7 +2,7 @@
2
2
  name: instabox
3
3
  description: Use when the user wants a cloud Linux box (instabox sandbox) from the terminal with the `instabox` CLI — create one, SSH in, run a command in it, read its files, set its timeout, or delete it. For saving or restoring a box's disks, see instabox-snapshots.
4
4
  metadata:
5
- installed-by: instabox-demo
5
+ installed-by: instabox
6
6
  ---
7
7
 
8
8
  # instabox CLI
@@ -2,7 +2,7 @@
2
2
  name: instabox-migrate
3
3
  description: Use when the user wants to move their local project or setup onto instabox — "move my setup to instabox", "migrate this repo to a box", "continue this work in the cloud". Copies the current git repo (uncommitted and untracked work included, .gitignored files left out) and its Claude Code / Codex conversation history into a new box, then installs dependencies there until it builds.
4
4
  metadata:
5
- installed-by: instabox-demo
5
+ installed-by: instabox
6
6
  ---
7
7
 
8
8
  # Move a local project to instabox
@@ -2,7 +2,7 @@
2
2
  name: instabox-snapshots
3
3
  description: Use when the user wants to save an instabox box's state and load it later — "save a snapshot", "checkpoint this box", "restore/load from a snapshot", "start a new box from my setup", "clone this box". Covers instabox snapshot save/ls/files/rm, create --snapshot and fork.
4
4
  metadata:
5
- installed-by: instabox-demo
5
+ installed-by: instabox
6
6
  ---
7
7
 
8
8
  # instabox snapshots: save and load