@raytrace-cli/cli 0.19.5 → 0.19.7

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
@@ -106,7 +106,7 @@ raytrace open # run in another terminal to open th
106
106
  The dashboard is at `http://127.0.0.1:8797` by default. If you set
107
107
  `RAYTACE_PORT` in `~/.raytrace/config.env`, the dashboard is on that port instead.
108
108
 
109
- The npm package needs **Node.js 22.13 or newer** (`node --version`) on macOS or
109
+ The npm package needs **Node.js 22.16 or newer** (`node --version`) on macOS or
110
110
  Linux. The PyPI package installs the same CLI with its own Node.js, so you
111
111
  don't need Node on the machine. Windows is experimental. Where this page says
112
112
  `npx -y @raytrace-cli/cli@latest`, use `uvx --from raytrace-cli raytrace`
@@ -126,6 +126,8 @@ then say "create a local sandbox and connect this repo".
126
126
  | **Disk and memory** | the first setup downloads about 1 GB; the VM uses 4 GiB of memory while it runs |
127
127
 
128
128
  `raytrace doctor` checks all of this and says how to fix anything missing.
129
+ For slow downloads, port conflicts, Linux KVM access or an interrupted setup,
130
+ follow [first local sandbox setup troubleshooting](docs/troubleshooting.md#first-local-sandbox-setup).
129
131
 
130
132
  ### Day to day
131
133
 
package/bin/raytrace.mjs CHANGED
@@ -123,10 +123,12 @@ function unknownCommand(input, names, scope = '') {
123
123
  + '\nRun raytrace help for all commands.';
124
124
  }
125
125
 
126
- // node:sqlite, which the recorder stores everything in, needs 22.13.
126
+ // The recorder stores everything in node:sqlite and searches it with SQLite's FTS5,
127
+ // which Node.js builds in from 22.16 (22.13-22.15 and 23.x ship node:sqlite without it,
128
+ // and every evidence database then fails with "no such module: fts5").
127
129
  const [major, minor] = process.versions.node.split('.').map(Number);
128
- if (major < 22 || (major === 22 && minor < 13)) {
129
- console.error(`RayTrace needs Node.js 22.13 or newer; this is ${process.version}.`);
130
+ if (major < 22 || (major === 22 && minor < 16) || major === 23) {
131
+ console.error(`RayTrace needs Node.js 22.16 or newer (or 24+); this is ${process.version}.`);
130
132
  process.exit(1);
131
133
  }
132
134
 
@@ -178,7 +180,7 @@ if (command === 'auth') {
178
180
  const auth = await import('../src/auth.mjs');
179
181
  const sub = rest[0];
180
182
  const action = { login: auth.loginCommand, status: auth.status, logout: auth.logout }[sub];
181
- if (!action) { console.error(`Usage: raytrace auth login | status | logout`); process.exit(2); }
183
+ if (!action || rest.length !== 1) { console.error(`Usage: raytrace auth login | status | logout`); process.exit(2); }
182
184
  try { await action(); process.exit(0); }
183
185
  catch (error) { console.error(`raytrace auth ${sub}: ${error.message}`); process.exit(1); }
184
186
  }
@@ -197,6 +199,7 @@ if (command === 'connect') {
197
199
  // `raytrace key [openrouter|typesafe] [--remove]`: the keys the dashboard's AI features use.
198
200
  if (command === 'key') {
199
201
  const args = rest.filter((arg) => arg !== '--remove');
202
+ if (rest.includes('--remove') && !args.length) { console.error('Usage: raytrace key <openrouter|typesafe> --remove'); process.exit(2); }
200
203
  if (args.length > 1 || args[0]?.startsWith('-')) { console.error('Usage: raytrace key [openrouter|typesafe] [--remove]'); process.exit(2); }
201
204
  const { keyCommand } = await import('../src/commands.mjs');
202
205
  try { await keyCommand(args[0], { remove: rest.includes('--remove') }); process.exit(0); }
@@ -295,6 +298,7 @@ if (command === 'export') {
295
298
  }
296
299
 
297
300
  if (command === 'share') {
301
+ const usage = 'Usage: raytrace share <trace-id> [--sandbox <id>] [--fork] | raytrace share --list | raytrace share --revoke <id>';
298
302
  let parsed;
299
303
  try {
300
304
  parsed = parseArgs({ args: rest, strict: true, allowPositionals: true, options: {
@@ -304,29 +308,30 @@ if (command === 'share') {
304
308
  fork: { type: 'boolean' },
305
309
  } });
306
310
  } catch (error) {
307
- console.error(`${error.message}\n\nUsage: raytrace share <trace-id> [--sandbox <id>] [--fork] | raytrace share --list | raytrace share --revoke <id>`);
311
+ console.error(`${error.message}\n\n${usage}`);
308
312
  process.exit(2);
309
313
  }
310
314
  const [sub, ...extra] = parsed.positionals;
315
+ const listing = parsed.values.list || sub === 'list';
316
+ const revoking = parsed.values.revoke !== undefined || sub === 'revoke';
317
+ const shareId = parsed.values.revoke ?? extra[0];
318
+ const creationFlags = parsed.values.sandbox !== undefined || parsed.values.fork !== undefined;
319
+ if ((listing && (revoking || creationFlags || parsed.positionals.length !== (sub === 'list' ? 1 : 0)))
320
+ || (revoking && (creationFlags || !shareId || (parsed.values.revoke !== undefined
321
+ ? parsed.positionals.length !== 0 : extra.length !== 1)))
322
+ || (!listing && !revoking && (!sub || extra.length))) {
323
+ console.error(usage); process.exit(2);
324
+ }
311
325
  const share = await import('../src/share.mjs');
312
326
  try {
313
- if (parsed.values.list || sub === 'list') {
327
+ if (listing) {
314
328
  await share.listShares();
315
329
  process.exit(0);
316
330
  }
317
- if (parsed.values.revoke || sub === 'revoke') {
318
- const shareId = parsed.values.revoke || extra[0];
319
- if (!shareId) {
320
- console.error('Usage: raytrace share --revoke <id> (or raytrace share revoke <id>)');
321
- process.exit(2);
322
- }
331
+ if (revoking) {
323
332
  await share.revokeShare(shareId);
324
333
  process.exit(0);
325
334
  }
326
- if (!sub || extra.length > 0) {
327
- console.error('Usage: raytrace share <trace-id> [--sandbox <id>] [--fork] | raytrace share --list | raytrace share --revoke <id>');
328
- process.exit(2);
329
- }
330
335
  await share.sharePrompt(sub, { sandboxId: parsed.values.sandbox, allowFork: parsed.values.fork });
331
336
  process.exit(0);
332
337
  } catch (error) {
@@ -356,16 +361,23 @@ if (command === 'report') {
356
361
  } catch (error) { console.error(`raytrace report: ${error.message}`); process.exit(1); }
357
362
  }
358
363
 
359
- let flags;
360
- try {
361
- ({ values: flags } = parseArgs({ args: rest, strict: true, options: {
364
+ const commandOptions = {
365
+ setup: {
362
366
  yes: { type: 'boolean', short: 'y' },
363
367
  'no-claude-code': { type: 'boolean' },
364
368
  'no-start': { type: 'boolean' },
365
369
  'openrouter-key': { type: 'string' },
366
- purge: { type: 'boolean' },
367
- } }));
368
- } catch (error) { console.error(`${error.message}\n\nRun \`raytrace help\` for usage.`); process.exit(2); }
370
+ },
371
+ uninstall: { purge: { type: 'boolean' }, yes: { type: 'boolean', short: 'y' } },
372
+ };
373
+ const commandUsage = {
374
+ setup: 'Usage: raytrace setup [--yes] [--no-claude-code] [--no-start] [--openrouter-key <key>]',
375
+ uninstall: 'Usage: raytrace uninstall [--purge] [--yes]',
376
+ };
377
+ let flags;
378
+ try {
379
+ ({ values: flags } = parseArgs({ args: rest, strict: true, options: commandOptions[command] ?? {} }));
380
+ } catch (error) { console.error(`${error.message}\n\n${commandUsage[command] ?? `Usage: raytrace ${command}`}`); process.exit(2); }
369
381
 
370
382
  const actions = {
371
383
  setup: () => commands.setup(flags),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raytrace-cli/cli",
3
- "version": "0.19.5",
3
+ "version": "0.19.7",
4
4
  "mcpName": "io.github.Godcreatebugs/raytrace",
5
5
  "description": "See what your coding agent did: traces, tool calls, cost and step-by-step evidence for Claude Code and Codex.",
6
6
  "license": "MIT",
@@ -25,7 +25,7 @@
25
25
  "THIRD_PARTY_NOTICES.md"
26
26
  ],
27
27
  "engines": {
28
- "node": ">=22.13.0"
28
+ "node": "^22.16.0 || >=24"
29
29
  },
30
30
  "scripts": {
31
31
  "test": "node --disable-warning=ExperimentalWarning --experimental-strip-types --test test/*.test.mjs proxy/*.test.mjs",