Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4b7a4a2
refactor(cli): extract sandbox live state helpers
cv May 2, 2026
2ce87dd
refactor(cli): extract sandbox skill install action
cv May 2, 2026
4cd3cf3
refactor(cli): extract sandbox connect action
cv May 3, 2026
e9dd46e
refactor(cli): extract sandbox status action
cv May 3, 2026
aab6c86
refactor(cli): extract sandbox doctor action
cv May 3, 2026
8908521
refactor(cli): extract sandbox destroy action
cv May 3, 2026
56e4f05
refactor(cli): extract sandbox rebuild action
cv May 3, 2026
8bf1958
refactor(cli): extract upgrade sandboxes action
cv May 3, 2026
38eb84d
refactor(cli): remove runtime bridge
cv May 3, 2026
b2ad5da
refactor(cli): remove legacy dispatch fallbacks
cv May 3, 2026
edd2650
refactor(cli): expose explicit main entrypoint
cv May 3, 2026
a15da95
refactor(cli): add oclif examples for utility commands
cv May 3, 2026
4f57ebb
refactor(cli): validate logs flags with oclif
cv May 3, 2026
8b2d077
refactor(cli): improve sandbox diagnostic command metadata
cv May 3, 2026
a09cc51
refactor(cli): tighten policy and channel parser validation
cv May 3, 2026
75857dc
refactor(cli): improve snapshot command metadata
cv May 3, 2026
11c0676
refactor(cli): require skill install path in oclif
cv May 3, 2026
05f9eca
refactor(cli): add lifecycle confirmation flag aliases
cv May 3, 2026
4ebeae4
refactor(cli): split share into oclif subcommands
cv May 3, 2026
7d72437
Revert "refactor(cli): split share into oclif subcommands"
cv May 3, 2026
0ee5ca5
refactor(cli): split share into oclif subcommands
cv May 3, 2026
928219c
refactor(cli): model debug flags with oclif
cv May 3, 2026
36cce5e
refactor(cli): model onboard flags with oclif
cv May 3, 2026
702afb1
docs: sync oclif UX command reference
cv May 3, 2026
3224350
refactor(cli): extract public argv normalizer
cv May 3, 2026
cd4cdb8
refactor(cli): rename oclif dispatch module
cv May 3, 2026
9499ca6
refactor(cli): normalize policy command ids
cv May 3, 2026
42028ef
test(cli): require oclif command metadata
cv May 3, 2026
a05c6b3
refactor(cli): return typed debug parse results
cv May 3, 2026
1875fe9
refactor(cli): add public command display ids
cv May 3, 2026
36f1dbe
refactor(cli): use oclif summaries in root help
cv May 3, 2026
78bfd5a
refactor(cli): table-drive sandbox dispatch
cv May 3, 2026
96ce61f
refactor(cli): normalize gateway token command id
cv May 3, 2026
266ebc9
refactor(cli): render public oclif help
cv May 3, 2026
dc98994
refactor(cli): add shared oclif command base
cv May 3, 2026
4222730
merge(main): reconcile shared oclif command base
cv May 5, 2026
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
13 changes: 3 additions & 10 deletions src/lib/list-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@

/* v8 ignore start -- thin oclif adapter covered through CLI integration tests. */

import { Command, Flags } from "@oclif/core";

import { getSandboxInventory, renderSandboxInventoryText } from "./inventory-commands";
import { NemoClawCommand } from "./nemoclaw-oclif-command";
import { buildListCommandDeps } from "./list-command-deps";

export default class ListCommand extends Command {
export default class ListCommand extends NemoClawCommand {
static id = "list";
static strict = true;
static enableJsonFlag = true;
Expand All @@ -17,13 +16,7 @@ export default class ListCommand extends Command {
"List all registered sandboxes with their model, provider, and policy presets.";
static usage = ["list [--json]"];
static examples = ["<%= config.bin %> list", "<%= config.bin %> list --json"];
static flags = {
help: Flags.help({ char: "h" }),
};

protected logJson(json: unknown): void {
console.log(JSON.stringify(json, null, 2));
}
static flags = {};

public async run(): Promise<unknown> {
await this.parse(ListCommand);
Expand Down
15 changes: 6 additions & 9 deletions src/lib/maintenance-cli-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@

/* v8 ignore start -- thin oclif adapters covered through CLI integration tests. */

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";

import {
runBackupAllAction,
runGarbageCollectImagesAction,
runUpgradeSandboxesAction,
} from "./global-cli-actions";
import { NemoClawCommand } from "./nemoclaw-oclif-command";

export class BackupAllCommand extends Command {
export class BackupAllCommand extends NemoClawCommand {
static id = "backup-all";
static strict = true;
static summary = "Back up all sandbox state before upgrade";
static description = "Back up registered, running sandbox state before upgrading.";
static usage = ["backup-all"];
static examples = ["<%= config.bin %> backup-all"];
static flags = {
help: Flags.help({ char: "h" }),
};
static flags = {};

public async run(): Promise<void> {
await this.parse(BackupAllCommand);
runBackupAllAction();
}
}

export class UpgradeSandboxesCommand extends Command {
export class UpgradeSandboxesCommand extends NemoClawCommand {
static id = "upgrade-sandboxes";
static strict = true;
static summary = "Detect and rebuild stale sandboxes";
Expand All @@ -39,7 +38,6 @@ export class UpgradeSandboxesCommand extends Command {
"<%= config.bin %> upgrade-sandboxes --auto --yes",
];
static flags = {
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({ char: "y", description: "Skip confirmation prompts" }),
Expand All @@ -55,15 +53,14 @@ export class UpgradeSandboxesCommand extends Command {
}
}

export class GarbageCollectImagesCommand extends Command {
export class GarbageCollectImagesCommand extends NemoClawCommand {
static id = "gc";
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|-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({ char: "y", description: "Skip the confirmation prompt" }),
force: Flags.boolean({ description: "Skip the confirmation prompt" }),
Expand Down
20 changes: 20 additions & 0 deletions src/lib/nemoclaw-oclif-command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";

/**
* Shared oclif base for NemoClaw commands.
*
* Keep CLI-wide parser conventions here so individual command classes only
* describe their own grammar.
*/
export abstract class NemoClawCommand extends Command {
static baseFlags = {
help: Flags.help({ char: "h" }),
};

protected logJson(json: unknown): void {
console.log(JSON.stringify(json, null, 2));
}
}
13 changes: 3 additions & 10 deletions src/lib/status-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,19 @@

/* v8 ignore start -- thin oclif adapter covered through CLI integration tests. */

import { Command, Flags } from "@oclif/core";

import { getStatusReport, showStatusCommand } from "./inventory-commands";
import { NemoClawCommand } from "./nemoclaw-oclif-command";
import { buildStatusCommandDeps } from "./status-command-deps";

export default class StatusCommand extends Command {
export default class StatusCommand extends NemoClawCommand {
static id = "status";
static strict = true;
static enableJsonFlag = true;
static summary = "Show sandbox list and service status";
static description = "Show registered sandboxes, live inference, services, and messaging health.";
static usage = ["status [--json]"];
static examples = ["<%= config.bin %> status", "<%= config.bin %> status --json"];
static flags = {
help: Flags.help({ char: "h" }),
};

protected logJson(json: unknown): void {
console.log(JSON.stringify(json, null, 2));
}
static flags = {};

public async run(): Promise<unknown> {
await this.parse(StatusCommand);
Expand Down
Loading