Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 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
d0d2a70
refactor(cli): use oclif flag relationships
cv May 3, 2026
8396c06
refactor(cli): pass lifecycle typed options
cv May 3, 2026
1532b19
refactor(cli): parse durations with oclif flags
cv May 3, 2026
7c0445a
refactor(cli): project public help through oclif
cv May 3, 2026
3978c32
test(cli): cover oclif metadata routing helpers
cv May 3, 2026
591eabb
test(cli): cover global oclif command adapters
cv May 3, 2026
8a6ecbc
test(cli): cover sandbox oclif command adapters
cv May 3, 2026
6133caa
merge(main): reconcile sandbox oclif adapter coverage
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
2 changes: 0 additions & 2 deletions src/lib/channels-mutate-cli-commands.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

type ChannelsRuntimeBridge = {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/connect-cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { CLI_NAME } from "./branding";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/destroy-cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { NemoClawCommand } from "./nemoclaw-oclif-command";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/policy-mutate-cli-commands.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

type PolicyRuntimeBridge = {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/rebuild-cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { NemoClawCommand } from "./nemoclaw-oclif-command";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/sandbox-doctor-cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { runSandboxDoctor } from "./sandbox-doctor-action";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/sandbox-inspection-cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { CLI_NAME } from "./branding";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/sandbox-logs-cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { logsSinceDurationFlag } from "./duration-flags";
Expand Down
109 changes: 109 additions & 0 deletions src/lib/sandbox-oclif-command-adapters.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { beforeEach, describe, expect, it, vi } from "vitest";

const mocks = vi.hoisted(() => ({
configGet: vi.fn(),
connectSandbox: vi.fn().mockResolvedValue(undefined),
destroySandbox: vi.fn().mockResolvedValue(undefined),
listSandboxChannels: vi.fn(),
listSandboxPolicies: vi.fn(),
rebuildSandbox: vi.fn().mockResolvedValue(undefined),
runSandboxDoctor: vi.fn().mockResolvedValue(undefined),
shieldsDown: vi.fn(),
shieldsStatus: vi.fn(),
shieldsUp: vi.fn(),
showSandboxStatus: vi.fn().mockResolvedValue(undefined),
}));

vi.mock("./sandbox-runtime-actions", () => ({
connectSandbox: mocks.connectSandbox,
destroySandbox: mocks.destroySandbox,
rebuildSandbox: mocks.rebuildSandbox,
showSandboxStatus: mocks.showSandboxStatus,
}));

vi.mock("./policy-channel-actions", () => ({
listSandboxChannels: mocks.listSandboxChannels,
listSandboxPolicies: mocks.listSandboxPolicies,
}));

vi.mock("./sandbox-config", () => ({
configGet: mocks.configGet,
}));

vi.mock("./sandbox-doctor-action", () => ({
runSandboxDoctor: mocks.runSandboxDoctor,
}));

vi.mock("./shields", () => ({
shieldsDown: mocks.shieldsDown,
shieldsStatus: mocks.shieldsStatus,
shieldsUp: mocks.shieldsUp,
}));

import ConnectCliCommand from "./connect-cli-command";
import DestroyCliCommand from "./destroy-cli-command";
import RebuildCliCommand from "./rebuild-cli-command";
import SandboxDoctorCliCommand from "./sandbox-doctor-cli-command";
import {
SandboxChannelsListCommand,
SandboxConfigGetCommand,
SandboxPolicyListCommand,
SandboxStatusCommand,
} from "./sandbox-inspection-cli-command";
import { ShieldsDownCommand, ShieldsStatusCommand, ShieldsUpCommand } from "./shields-cli-commands";

const rootDir = process.cwd();

describe("sandbox oclif command adapters", () => {
beforeEach(() => {
vi.clearAllMocks();
});

it("maps connect and lifecycle flags to typed action options", async () => {
await ConnectCliCommand.run(["alpha", "--probe-only"], rootDir);
await DestroyCliCommand.run(["alpha", "--yes"], rootDir);
await RebuildCliCommand.run(["alpha", "--force", "--verbose"], rootDir);

expect(mocks.connectSandbox).toHaveBeenCalledWith("alpha", { probeOnly: true });
expect(mocks.destroySandbox).toHaveBeenCalledWith("alpha", { force: false, yes: true });
expect(mocks.rebuildSandbox).toHaveBeenCalledWith("alpha", {
force: true,
verbose: true,
yes: false,
});
});

it("maps inspection commands to their action helpers", async () => {
await SandboxStatusCommand.run(["alpha"], rootDir);
await SandboxPolicyListCommand.run(["alpha"], rootDir);
await SandboxChannelsListCommand.run(["alpha"], rootDir);
await SandboxConfigGetCommand.run(["alpha", "--key", "model", "--format", "yaml"], rootDir);

expect(mocks.showSandboxStatus).toHaveBeenCalledWith("alpha");
expect(mocks.listSandboxPolicies).toHaveBeenCalledWith("alpha");
expect(mocks.listSandboxChannels).toHaveBeenCalledWith("alpha");
expect(mocks.configGet).toHaveBeenCalledWith("alpha", { key: "model", format: "yaml" });
});

it("maps doctor and shields commands to action helpers", async () => {
await SandboxDoctorCliCommand.run(["alpha", "--json"], rootDir);
await ShieldsDownCommand.run(
["alpha", "--timeout", "5m", "--reason", "debugging", "--policy", "permissive"],
rootDir,
);
await ShieldsUpCommand.run(["alpha"], rootDir);
await ShieldsStatusCommand.run(["alpha"], rootDir);

expect(mocks.runSandboxDoctor).toHaveBeenCalledWith("alpha", ["--json"]);
expect(mocks.shieldsDown).toHaveBeenCalledWith("alpha", {
timeout: "5m",
reason: "debugging",
policy: "permissive",
});
expect(mocks.shieldsUp).toHaveBeenCalledWith("alpha");
expect(mocks.shieldsStatus).toHaveBeenCalledWith("alpha");
});
});
2 changes: 0 additions & 2 deletions src/lib/shields-cli-commands.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { shieldsTimeoutDurationFlag } from "./duration-flags";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/skill-install-cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { installSandboxSkill } from "./sandbox-runtime-actions";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/snapshot-cli-commands.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

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

import { runSandboxSnapshot } from "./sandbox-runtime-actions";
Expand Down
Loading