runcloud 0.1.93 → 0.1.94

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.
@@ -358,8 +358,17 @@ export function registerSandbox(program) {
358
358
  else
359
359
  console.log(renderSandbox(exposedRecord, 'created'));
360
360
  }));
361
- withOutput(sandbox.command('list').description('List sandboxes').option('--state <state>', 'filter by state')).action((opts) => run(async () => {
362
- const qs = opts.state ? `?state=${encodeURIComponent(opts.state)}` : '';
361
+ withOutput(sandbox
362
+ .command('list')
363
+ .description('List sandboxes')
364
+ .option('--state <state>', 'filter by state')
365
+ .option('--name <name>', 'filter by name (exact)')).action((opts) => run(async () => {
366
+ const query = new URLSearchParams();
367
+ if (opts.state)
368
+ query.set('state', opts.state);
369
+ if (opts.name)
370
+ query.set('name', opts.name);
371
+ const qs = query.size ? `?${query}` : '';
363
372
  const api = runCloudApi();
364
373
  const [data, boxes] = await Promise.all([
365
374
  api.get(`/run-cloud/sandboxes${qs}`),
@@ -525,6 +534,17 @@ export function registerSandbox(program) {
525
534
  console.log(`${style.green('✓')} ${lifecycle.pastTense} ${id}`);
526
535
  }));
527
536
  }
537
+ withOutput(sandbox
538
+ .command('rename')
539
+ .description('Change a sandbox name (the label `list --name` filters on)')
540
+ .argument('<id>', 'sandbox id')
541
+ .argument('<name>', 'new name; pass "" to clear it')).action((id, name, opts) => run(async () => {
542
+ const record = await runCloudApi().post(`/run-cloud/sandboxes/${encodeURIComponent(id)}/name`, { name });
543
+ if (opts.json)
544
+ printJson(record);
545
+ else
546
+ console.log(`${style.green('✓')} Renamed ${id} to ${name || '(no name)'}`);
547
+ }));
528
548
  withOutput(sandbox
529
549
  .command('logs')
530
550
  .description('Show saved console logs (available after a sandbox is deleted)')
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.1.93';
1
+ export const CLI_VERSION = '0.1.94';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.1.93",
3
+ "version": "0.1.94",
4
4
  "description": "Create and control run.cloud remote mobile simulators and cloud sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -54,11 +54,13 @@ runcloud sandbox exec "$SANDBOX_ID" "npm install && npm test"
54
54
  The main lifecycle commands are:
55
55
 
56
56
  - `runcloud sandbox create`
57
- - `runcloud sandbox list [--state <state>]`
57
+ - `runcloud sandbox list [--state <state>] [--name <name>]`
58
58
  - `runcloud sandbox get <id>`
59
59
  - `runcloud sandbox exec <id> <cmd...>`
60
60
  - `runcloud sandbox shell <id>`
61
61
  - `runcloud sandbox pause|resume <id>`
62
+ - `runcloud sandbox rename <id> <name>` — relabel an existing sandbox; pair with
63
+ `list --name` to find a sandbox again instead of creating a second one
62
64
  - `runcloud sandbox logs <id> [--lines <n>]`
63
65
  - `runcloud sandbox metrics <id> [--range <range>] [--watch]`
64
66
  - `runcloud sandbox rm <id>`