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
5 changes: 3 additions & 2 deletions src/commands/internal/dns/fix-coredns.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Args, Command, Flags } from "@oclif/core";
import { Args, Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { runFixCoreDns } from "../../../lib/actions/dns";

export default class InternalDnsFixCoreDnsCommand extends Command {
export default class InternalDnsFixCoreDnsCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = "Internal: patch CoreDNS for local gateway DNS";
Expand Down
5 changes: 3 additions & 2 deletions src/commands/internal/dns/setup-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Args, Command, Flags } from "@oclif/core";
import { Args, Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { runSetupDnsProxy } from "../../../lib/actions/dns";

export default class InternalDnsSetupProxyCommand extends Command {
export default class InternalDnsSetupProxyCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = "Internal: configure sandbox DNS proxy";
Expand Down
5 changes: 3 additions & 2 deletions src/commands/internal/installer/normalize-env.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { normalizeInstallerEnv } from "../../../lib/actions/installer/plan";

export default class InternalInstallerNormalizeEnvCommand extends Command {
export default class InternalInstallerNormalizeEnvCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = "Internal: normalize installer environment values";
Expand Down
5 changes: 3 additions & 2 deletions src/commands/internal/installer/plan.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { buildInstallerPlan } from "../../../lib/actions/installer/plan";

export default class InternalInstallerPlanCommand extends Command {
export default class InternalInstallerPlanCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = "Internal: build the NemoClaw installer plan";
Expand Down
5 changes: 3 additions & 2 deletions src/commands/internal/installer/resolve-release-tag.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { resolveInstallRef } from "../../../lib/domain/installer/ref";

export default class InternalInstallerResolveReleaseTagCommand extends Command {
export default class InternalInstallerResolveReleaseTagCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = "Internal: resolve the installer release ref";
Expand Down
5 changes: 3 additions & 2 deletions src/commands/internal/uninstall/classify-shim.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Args, Command, Flags } from "@oclif/core";
import { Args, Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { classifyShimPath } from "../../../lib/actions/uninstall/plan";

export default class InternalUninstallClassifyShimCommand extends Command {
export default class InternalUninstallClassifyShimCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = "Internal: classify a NemoClaw shim path";
Expand Down
5 changes: 3 additions & 2 deletions src/commands/internal/uninstall/plan.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { buildHostUninstallPlan } from "../../../lib/actions/uninstall/plan";
import { CLI_DISPLAY_NAME, CLI_NAME } from "../../../lib/cli/branding";

export default class InternalUninstallPlanCommand extends Command {
export default class InternalUninstallPlanCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = `Internal: build the ${CLI_DISPLAY_NAME} uninstall plan`;
Expand Down
5 changes: 3 additions & 2 deletions src/commands/internal/uninstall/run-plan.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { runUninstallPlan } from "../../../lib/actions/uninstall/run-plan";
import { CLI_DISPLAY_NAME, CLI_NAME } from "../../../lib/cli/branding";

export default class InternalUninstallRunPlanCommand extends Command {
export default class InternalUninstallRunPlanCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = `${CLI_DISPLAY_NAME} Uninstaller`;
Expand Down
22 changes: 22 additions & 0 deletions src/lib/cli/oclif-command-metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,29 @@
import { Config as OclifConfig } from "@oclif/core";
import { describe, expect, it } from "vitest";

function extendsNemoClawCommand(commandClass: unknown): boolean {
if (typeof commandClass !== "function") return false;
let current = Object.getPrototypeOf(commandClass) as { name?: string } | null;
while (current) {
if (current.name === "NemoClawCommand") return true;
current = Object.getPrototypeOf(current) as { name?: string } | null;
}
return false;
}

describe("oclif command metadata", () => {
it("keeps discovered commands on the shared NemoClaw oclif base", async () => {
const config = await OclifConfig.load(process.cwd());
const nonConforming: string[] = [];

for (const command of config.commands) {
const commandClass = await command.load();
if (!extendsNemoClawCommand(commandClass)) nonConforming.push(command.id);
}

expect(nonConforming).toEqual([]);
});

it("keeps public discovered commands documented in oclif statics", async () => {
const config = await OclifConfig.load(process.cwd());
const publicCommands = config.commands.filter((command) => command.hidden !== true);
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/credentials.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../cli/nemoclaw-oclif-command";

import { printCredentialsUsage } from "./credentials/common";

export default class CredentialsCommand extends Command {
export default class CredentialsCommand extends NemoClawCommand {
static id = "credentials";
static strict = true;
static summary = "Manage provider credentials";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/credentials/list.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../cli/nemoclaw-oclif-command";

import { CLI_NAME } from "../../cli/branding";
import { runOpenshellProviderCommand } from "../../actions/global";
import { OPENSHELL_OPERATION_TIMEOUT_MS } from "../../adapters/openshell/timeouts";
import { isBridgeProviderName, recoverGatewayOrExit } from "./common";

export default class CredentialsListCommand extends Command {
export default class CredentialsListCommand extends NemoClawCommand {
static id = "credentials:list";
static strict = true;
static summary = "List stored credential providers";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/credentials/reset.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Args, Command, Flags } from "@oclif/core";
import { Args, Flags } from "@oclif/core";
import { NemoClawCommand } from "../../cli/nemoclaw-oclif-command";

import { CLI_NAME } from "../../cli/branding";
import { prompt as askPrompt } from "../../credentials/store";
import { runOpenshellProviderCommand } from "../../actions/global";
import { OPENSHELL_OPERATION_TIMEOUT_MS } from "../../adapters/openshell/timeouts";
import { isBridgeProviderName, recoverGatewayOrExit } from "./common";

export default class CredentialsResetCommand extends Command {
export default class CredentialsResetCommand extends NemoClawCommand {
static id = "credentials:reset";
static strict = true;
static summary = "Remove a provider credential";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/debug.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../cli/nemoclaw-oclif-command";

import { CLI_NAME } from "../cli/branding";
import { runDebug } from "../diagnostics/debug";
Expand Down Expand Up @@ -67,7 +68,7 @@ function buildDebugCommandDeps(rootDir: string): RunDebugCommandDeps {
};
}

export default class DebugCliCommand extends Command {
export default class DebugCliCommand extends NemoClawCommand {
static id = "debug";
static strict = true;
static summary = "Collect diagnostics for bug reports";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Args, Command, Flags } from "@oclif/core";
import { Args, Flags } from "@oclif/core";
import { NemoClawCommand } from "../cli/nemoclaw-oclif-command";

import { runDeployAction } from "../actions/global";

export default class DeployCliCommand extends Command {
export default class DeployCliCommand extends NemoClawCommand {
static id = "deploy";
static strict = true;
static summary = "Deprecated Brev-specific bootstrap path";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/deprecated/start.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../cli/nemoclaw-oclif-command";

import { CLI_NAME } from "../../cli/branding";
import { startAll } from "../../tunnel/services";
import { runStartCommand } from "../../tunnel/service-command";
import { serviceDeps } from "../tunnel/common";

export default class DeprecatedStartCommand extends Command {
export default class DeprecatedStartCommand extends NemoClawCommand {
static id = "start";
static strict = true;
static summary = "Deprecated alias for 'tunnel start'";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/deprecated/stop.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../cli/nemoclaw-oclif-command";

import { CLI_NAME } from "../../cli/branding";
import { stopAll } from "../../tunnel/services";
import { runStopCommand } from "../../tunnel/service-command";
import { serviceDeps } from "../tunnel/common";

export default class DeprecatedStopCommand extends Command {
export default class DeprecatedStopCommand extends NemoClawCommand {
static id = "stop";
static strict = true;
static summary = "Deprecated alias for 'tunnel stop'";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/gateway-token.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Args, Command, Flags } from "@oclif/core";
import { Args, Flags } from "@oclif/core";
import { NemoClawCommand } from "../cli/nemoclaw-oclif-command";

import { runGatewayTokenCommand } from "../gateway-token-command";

Expand Down Expand Up @@ -40,7 +41,7 @@ function getRuntimeBridge(): GatewayTokenRuntimeBridge {
return runtimeBridgeFactory();
}

export default class GatewayTokenCliCommand extends Command {
export default class GatewayTokenCliCommand extends NemoClawCommand {
static id = "sandbox:gateway:token";
static strict = true;
static summary = "Print the OpenClaw gateway auth token to stdout";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/commands/onboard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command } from "@oclif/core";
import { NemoClawCommand } from "../cli/nemoclaw-oclif-command";

import { runOnboardAction } from "../actions/global";
import {
Expand All @@ -12,7 +12,7 @@ import {
toLegacyOnboardArgs,
} from "./onboard/common";

export default class OnboardCliCommand extends Command {
export default class OnboardCliCommand extends NemoClawCommand {
static id = "onboard";
static strict = true;
static summary = "Configure inference endpoint and credentials";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/commands/sandbox/channels/add.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command } from "@oclif/core";
import { NemoClawCommand } from "../../../cli/nemoclaw-oclif-command";

import {
buildChannelArgs,
Expand All @@ -10,7 +10,7 @@ import {
getChannelsRuntimeBridge,
} from "./common";

export default class ChannelsAddCommand extends Command {
export default class ChannelsAddCommand extends NemoClawCommand {
static id = "sandbox:channels:add";
static strict = true;
static summary = "Save messaging channel credentials and rebuild";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands/sandbox/channels/list.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command, Flags } from "@oclif/core";
import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../cli/nemoclaw-oclif-command";

import { listSandboxChannels } from "../../../actions/sandbox/policy-channel";
import { sandboxNameArg } from "../common";

export default class SandboxChannelsListCommand extends Command {
export default class SandboxChannelsListCommand extends NemoClawCommand {
static id = "sandbox:channels:list";
static strict = true;
static summary = "List supported messaging channels";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/commands/sandbox/channels/remove.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command } from "@oclif/core";
import { NemoClawCommand } from "../../../cli/nemoclaw-oclif-command";

import {
buildChannelArgs,
Expand All @@ -10,7 +10,7 @@ import {
getChannelsRuntimeBridge,
} from "./common";

export default class ChannelsRemoveCommand extends Command {
export default class ChannelsRemoveCommand extends NemoClawCommand {
static id = "sandbox:channels:remove";
static strict = true;
static summary = "Clear messaging channel credentials and rebuild";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/commands/sandbox/channels/start.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command } from "@oclif/core";
import { NemoClawCommand } from "../../../cli/nemoclaw-oclif-command";

import {
buildChannelArgs,
Expand All @@ -10,7 +10,7 @@ import {
getChannelsRuntimeBridge,
} from "./common";

export default class ChannelsStartCommand extends Command {
export default class ChannelsStartCommand extends NemoClawCommand {
static id = "sandbox:channels:start";
static strict = true;
static summary = "Re-enable a stopped messaging channel";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/commands/sandbox/channels/stop.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { Command } from "@oclif/core";
import { NemoClawCommand } from "../../../cli/nemoclaw-oclif-command";

import {
buildChannelArgs,
Expand All @@ -10,7 +10,7 @@ import {
getChannelsRuntimeBridge,
} from "./common";

export default class ChannelsStopCommand extends Command {
export default class ChannelsStopCommand extends NemoClawCommand {
static id = "sandbox:channels:stop";
static strict = true;
static summary = "Disable channel without wiping credentials";
Expand Down
Loading
Loading