Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/command-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const COMMANDS: readonly CommandDef[] = [
{
usage: "nemoclaw <name> rebuild",
description: "Upgrade sandbox to current agent version",
flags: "(--yes to skip prompt)",
flags: "[--yes|-y|--force] [--verbose|-v]",
group: "Sandbox Management",
scope: "sandbox",
},
Expand All @@ -183,7 +183,7 @@ export const COMMANDS: readonly CommandDef[] = [
{
usage: "nemoclaw <name> destroy",
description: "Stop NIM + delete sandbox",
flags: "(--yes to skip prompt)",
flags: "[--yes|-y|--force]",
group: "Sandbox Management",
scope: "sandbox",
},
Expand Down
5 changes: 3 additions & 2 deletions src/lib/destroy-cli-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["<name> destroy [--yes|--force]"];
static usage = ["<name> 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" }),
};

Expand Down
4 changes: 2 additions & 2 deletions src/lib/legacy-oclif-dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]" };
Expand All @@ -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] };
Expand Down
8 changes: 4 additions & 4 deletions src/lib/maintenance-cli-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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<void> {
Expand All @@ -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" }),
};

Expand Down
8 changes: 6 additions & 2 deletions src/lib/rebuild-cli-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["<name> rebuild [--yes|--force] [--verbose|-v]"];
static usage = ["<name> 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" }),
};
Expand Down
10 changes: 5 additions & 5 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});

Expand Down Expand Up @@ -1227,12 +1227,12 @@ describe("CLI dispatch", () => {

const destroy = runWithEnv("alpha destroy --help", { HOME: home });
expect(destroy.code).toBe(0);
expect(destroy.out).toContain("<name> destroy [--yes|--force]");
expect(destroy.out).toContain("<name> 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("<name> rebuild [--yes|--force] [--verbose|-v]");
expect(rebuild.out).toContain("<name> rebuild [--yes|-y|--force] [--verbose|-v]");
expect(rebuild.out).not.toContain("sandbox:rebuild");

for (const action of ["policy-add", "policy-remove", "policy-list"]) {
Expand Down Expand Up @@ -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 || ""}`,
});
Expand Down
Loading