diff --git a/src/lib/command-registry.ts b/src/lib/command-registry.ts index 704e233fcfe..bcc7163cdf1 100644 --- a/src/lib/command-registry.ts +++ b/src/lib/command-registry.ts @@ -169,7 +169,7 @@ export const COMMANDS: readonly CommandDef[] = [ { usage: "nemoclaw rebuild", description: "Upgrade sandbox to current agent version", - flags: "(--yes to skip prompt)", + flags: "[--yes|-y|--force] [--verbose|-v]", group: "Sandbox Management", scope: "sandbox", }, @@ -183,7 +183,7 @@ export const COMMANDS: readonly CommandDef[] = [ { usage: "nemoclaw destroy", description: "Stop NIM + delete sandbox", - flags: "(--yes to skip prompt)", + flags: "[--yes|-y|--force]", group: "Sandbox Management", scope: "sandbox", }, diff --git a/src/lib/destroy-cli-command.ts b/src/lib/destroy-cli-command.ts index 055dfa1449a..2a764e25700 100644 --- a/src/lib/destroy-cli-command.ts +++ b/src/lib/destroy-cli-command.ts @@ -12,13 +12,14 @@ export default class DestroyCliCommand extends Command { static strict = true; static summary = "Stop NIM and delete sandbox"; static description = "Destroy a sandbox and remove its local registry entry."; - static usage = [" destroy [--yes|--force]"]; + static usage = [" destroy [--yes|-y|--force]"]; + static examples = ["<%= config.bin %> alpha destroy", "<%= config.bin %> alpha destroy --yes"]; static args = { sandboxName: Args.string({ name: "sandbox", description: "Sandbox name", required: true }), }; static flags = { help: Flags.help({ char: "h" }), - yes: Flags.boolean({ description: "Skip the confirmation prompt" }), + yes: Flags.boolean({ char: "y", description: "Skip the confirmation prompt" }), force: Flags.boolean({ description: "Skip the confirmation prompt" }), }; diff --git a/src/lib/legacy-oclif-dispatch.ts b/src/lib/legacy-oclif-dispatch.ts index 70b26ac0e8b..43b55140ea9 100644 --- a/src/lib/legacy-oclif-dispatch.ts +++ b/src/lib/legacy-oclif-dispatch.ts @@ -123,7 +123,7 @@ export function resolveSandboxOclifDispatch( if (hasHelpFlag(actionArgs)) return { kind: "help", usage: "policy-list" }; return { kind: "oclif", commandId: "sandbox:policy-list", args: [sandboxName, ...actionArgs] }; case "destroy": - if (hasHelpFlag(actionArgs)) return { kind: "help", usage: "destroy [--yes|--force]" }; + if (hasHelpFlag(actionArgs)) return { kind: "help", usage: "destroy [--yes|-y|--force]" }; return { kind: "oclif", commandId: "sandbox:destroy", args: [sandboxName, ...actionArgs] }; case "gateway-token": if (hasHelpFlag(actionArgs)) return { kind: "help", usage: "gateway-token [--quiet|-q]" }; @@ -141,7 +141,7 @@ export function resolveSandboxOclifDispatch( return { kind: "oclif", commandId: "sandbox:skill", args: [sandboxName, ...actionArgs] }; } case "rebuild": - if (hasHelpFlag(actionArgs)) return { kind: "help", usage: "rebuild [--yes|--force] [--verbose|-v]" }; + if (hasHelpFlag(actionArgs)) return { kind: "help", usage: "rebuild [--yes|-y|--force] [--verbose|-v]" }; return { kind: "oclif", commandId: "sandbox:rebuild", args: [sandboxName, ...actionArgs] }; case "share": return { kind: "oclif", commandId: "share", args: [sandboxName, ...actionArgs] }; diff --git a/src/lib/maintenance-cli-commands.ts b/src/lib/maintenance-cli-commands.ts index c40e95e4eeb..62b22601071 100644 --- a/src/lib/maintenance-cli-commands.ts +++ b/src/lib/maintenance-cli-commands.ts @@ -33,7 +33,7 @@ export class UpgradeSandboxesCommand extends Command { static strict = true; static summary = "Detect and rebuild stale sandboxes"; static description = "Detect stale sandboxes and optionally rebuild them."; - static usage = ["upgrade-sandboxes [--check] [--auto] [--yes]"]; + static usage = ["upgrade-sandboxes [--check] [--auto] [--yes|-y]"]; static examples = [ "<%= config.bin %> upgrade-sandboxes --check", "<%= config.bin %> upgrade-sandboxes --auto --yes", @@ -42,7 +42,7 @@ export class UpgradeSandboxesCommand extends Command { help: Flags.help({ char: "h" }), check: Flags.boolean({ description: "Only check whether sandboxes need upgrading" }), auto: Flags.boolean({ description: "Automatically rebuild running stale sandboxes" }), - yes: Flags.boolean({ description: "Skip confirmation prompts" }), + yes: Flags.boolean({ char: "y", description: "Skip confirmation prompts" }), }; public async run(): Promise { @@ -60,12 +60,12 @@ export class GarbageCollectImagesCommand extends Command { static strict = true; static summary = "Remove orphaned sandbox Docker images"; static description = "Remove sandbox Docker images that are not referenced by registered sandboxes."; - static usage = ["gc [--dry-run] [--yes|--force]"]; + static usage = ["gc [--dry-run] [--yes|-y|--force]"]; static examples = ["<%= config.bin %> gc --dry-run", "<%= config.bin %> gc --yes"]; static flags = { help: Flags.help({ char: "h" }), "dry-run": Flags.boolean({ description: "Show images that would be removed without deleting" }), - yes: Flags.boolean({ description: "Skip the confirmation prompt" }), + yes: Flags.boolean({ char: "y", description: "Skip the confirmation prompt" }), force: Flags.boolean({ description: "Skip the confirmation prompt" }), }; diff --git a/src/lib/rebuild-cli-command.ts b/src/lib/rebuild-cli-command.ts index a459d8c2226..582fe8a7ba0 100644 --- a/src/lib/rebuild-cli-command.ts +++ b/src/lib/rebuild-cli-command.ts @@ -12,13 +12,17 @@ export default class RebuildCliCommand extends Command { static strict = true; static summary = "Upgrade sandbox to current agent version"; static description = "Back up, recreate, and restore a sandbox using the current agent image."; - static usage = [" rebuild [--yes|--force] [--verbose|-v]"]; + static usage = [" rebuild [--yes|-y|--force] [--verbose|-v]"]; + static examples = [ + "<%= config.bin %> alpha rebuild", + "<%= config.bin %> alpha rebuild --yes --verbose", + ]; static args = { sandboxName: Args.string({ name: "sandbox", description: "Sandbox name", required: true }), }; static flags = { help: Flags.help({ char: "h" }), - yes: Flags.boolean({ description: "Skip the confirmation prompt" }), + yes: Flags.boolean({ char: "y", description: "Skip the confirmation prompt" }), force: Flags.boolean({ description: "Skip the confirmation prompt" }), verbose: Flags.boolean({ char: "v", description: "Show verbose rebuild diagnostics" }), }; diff --git a/test/cli.test.ts b/test/cli.test.ts index ab518707968..265ed426d73 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -748,12 +748,12 @@ describe("CLI dispatch", () => { const upgrade = run("upgrade-sandboxes --help"); expect(upgrade.code).toBe(0); - expect(upgrade.out).toContain("upgrade-sandboxes [--check] [--auto] [--yes]"); + expect(upgrade.out).toContain("upgrade-sandboxes [--check] [--auto] [--yes|-y]"); expect(upgrade.out).toContain("Detect and rebuild stale sandboxes"); const gc = run("gc --help"); expect(gc.code).toBe(0); - expect(gc.out).toContain("gc [--dry-run] [--yes|--force]"); + expect(gc.out).toContain("gc [--dry-run] [--yes|-y|--force]"); expect(gc.out).toContain("Remove orphaned sandbox Docker images"); }); @@ -1227,12 +1227,12 @@ describe("CLI dispatch", () => { const destroy = runWithEnv("alpha destroy --help", { HOME: home }); expect(destroy.code).toBe(0); - expect(destroy.out).toContain(" destroy [--yes|--force]"); + expect(destroy.out).toContain(" destroy [--yes|-y|--force]"); expect(destroy.out).not.toContain("sandbox:destroy"); const rebuild = runWithEnv("alpha rebuild --help", { HOME: home }); expect(rebuild.code).toBe(0); - expect(rebuild.out).toContain(" rebuild [--yes|--force] [--verbose|-v]"); + expect(rebuild.out).toContain(" rebuild [--yes|-y|--force] [--verbose|-v]"); expect(rebuild.out).not.toContain("sandbox:rebuild"); for (const action of ["policy-add", "policy-remove", "policy-list"]) { @@ -1865,7 +1865,7 @@ describe("CLI dispatch", () => { { mode: 0o755 }, ); - const r = runWithEnv("alpha destroy --yes", { + const r = runWithEnv("alpha destroy -y", { HOME: home, PATH: `${localBin}:${process.env.PATH || ""}`, });