Skip to content

Commit fe01877

Browse files
fix(cli): guide deprecated global start (#9352)
## Summary Make the deprecated global `nemoclaw start` command exit successfully with migration guidance instead of attempting tunnel startup. The command now directs users to the sandbox-scoped start command or the explicit tunnel command without mutating either resource. ## Related Issue Fixes #9303 ## Changes - Remove tunnel startup dispatch from the deprecated global command while retaining Oclif deprecation output. - Verify exit code zero, migration guidance, and the absence of a second start dispatch. - Update command and sandbox lifecycle documentation to match the compatibility behavior. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [x] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — `npx vitest run src/commands/simple-global-oclif-adapters.test.ts test/cli/tunnel-command.test.ts` (22 passed) - [x] Applicable broad gate passed — `npm run test:changed` (12 passed); `npm run build:cli`; `npm run typecheck:cli`; `npm run lint` - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Deepak Jain <deepujain@gmail.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Updated the deprecated `nemoclaw start` command to exit successfully without starting a sandbox or tunnel. * Added migration guidance directing users to sandbox-specific or tunnel start commands. * **Documentation** * Clarified the deprecated command’s non-mutating behavior and recommended alternatives. * **Tests** * Added coverage confirming the command displays guidance, completes successfully, and does not launch local services. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Deepak Jain <deepujain@gmail.com> Signed-off-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com> Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
1 parent 14cde08 commit fe01877

6 files changed

Lines changed: 35 additions & 20 deletions

File tree

docs/manage-sandboxes/run-sandboxes.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ $$nemoclaw tunnel start
158158
```
159159

160160
`$$nemoclaw tunnel stop` stops the tunnel and asks NemoClaw to stop the in-sandbox gateway for the selected or default sandbox.
161-
The older `$$nemoclaw start` still works as a deprecated alias.
161+
The older `$$nemoclaw start` now prints migration guidance and exits successfully without starting
162+
a sandbox or tunnel. Use `$$nemoclaw <name> start` or `$$nemoclaw tunnel start` explicitly.
162163
</AgentOnly>
163164
<AgentOnly variant="hermes">
164165

docs/reference/commands.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3950,7 +3950,9 @@ export CLOUDFLARE_TUNNEL_TOKEN=<cloudflare-tunnel-token>
39503950
$$nemoclaw tunnel start
39513951
```
39523952

3953-
`$$nemoclaw start` remains as a deprecated alias that prints a warning and delegates to `tunnel start`.
3953+
`$$nemoclaw start` remains as a deprecated compatibility command. It exits successfully after
3954+
printing guidance for `$$nemoclaw <name> start` and `$$nemoclaw tunnel start`; it does not start
3955+
either resource itself.
39543956

39553957
### `$$nemoclaw tunnel stop`
39563958

@@ -3985,10 +3987,12 @@ $$nemoclaw tunnel status
39853987
### `$$nemoclaw start`
39863988

39873989
<Warning>
3988-
Deprecated. Use `$$nemoclaw tunnel start` instead.
3990+
Deprecated. Use `$$nemoclaw <name> start` for a stopped sandbox or `$$nemoclaw tunnel start` for
3991+
the optional public-URL tunnel.
39893992
</Warning>
39903993

3991-
This command remains as a compatibility alias to `$$nemoclaw tunnel start`.
3994+
This compatibility command prints migration guidance and exits successfully without changing
3995+
sandbox or tunnel state.
39923996

39933997
### `$$nemoclaw stop`
39943998

src/commands/simple-global-oclif-adapters.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,12 @@ describe("simple global oclif adapters", () => {
289289

290290
it("maps tunnel and deprecated service commands to service actions", async () => {
291291
await TunnelStartCommand.run([], rootDir);
292+
expect(mocks.runStartCommand).toHaveBeenCalledTimes(1);
292293
await TunnelStopCommand.run([], rootDir);
293294
await DeprecatedStartCommand.run([], rootDir);
295+
expect(mocks.runStartCommand).toHaveBeenCalledTimes(1);
294296
await DeprecatedStopCommand.run([], rootDir);
295297

296-
expect(mocks.runStartCommand).toHaveBeenCalledTimes(2);
297298
expect(mocks.runStopCommand).toHaveBeenCalledTimes(2);
298299
expect(mocks.runStartCommand).toHaveBeenCalledWith(
299300
expect.objectContaining({ listSandboxes: expect.any(Function), startAll: mocks.startAll }),

src/commands/start.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { NemoClawCommand } from "../lib/cli/nemoclaw-oclif-command";
5-
import { serviceDeps } from "../lib/tunnel/command-support";
6-
import { runStartCommand } from "../lib/tunnel/service-command";
7-
import { startAll } from "../lib/tunnel/services";
5+
6+
const DEPRECATED_START_MESSAGE =
7+
"Deprecated: 'nemoclaw start' no longer starts a resource. Use 'nemoclaw <name> start' for a stopped sandbox or 'nemoclaw tunnel start' for the optional public-URL tunnel.";
88

99
export default class DeprecatedStartCommand extends NemoClawCommand {
1010
static id = "start";
1111
static strict = true;
12-
static summary = "Deprecated alias for 'tunnel start'";
13-
static description = "Deprecated alias for tunnel start.";
12+
static summary = "Deprecated command that prints start migration guidance";
13+
static description =
14+
"Use 'nemoclaw <name> start' or 'nemoclaw tunnel start'; this command does not start a sandbox or public-URL tunnel.";
1415
static usage = ["start"];
1516
static examples = ["<%= config.bin %> start"];
1617
static state = "deprecated" as const;
1718
static deprecationOptions = {
18-
message:
19-
"Deprecated: 'nemoclaw start' is now 'nemoclaw tunnel start'. To start a stopped sandbox container instead, use 'nemoclaw <name> start'. See 'nemoclaw help'.",
19+
message: DEPRECATED_START_MESSAGE,
2020
};
2121
static flags = {};
2222

2323
public async run(): Promise<void> {
2424
await this.parse(DeprecatedStartCommand);
25-
await runStartCommand({ ...serviceDeps(), startAll });
2625
}
2726
}

test/cli/dispatch-basics.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe("CLI dispatch", () => {
7575
});
7676

7777
it(
78-
"start does not prompt for NVIDIA_INFERENCE_API_KEY before launching local services",
78+
"deprecated start does not prompt for NVIDIA_INFERENCE_API_KEY or launch local services",
7979
testTimeoutOptions(35_000),
8080
() => {
8181
const home = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-cli-start-no-key-"));
@@ -112,7 +112,7 @@ describe("CLI dispatch", () => {
112112
);
113113

114114
const r = runWithEnv(
115-
"start",
115+
"start 2>&1",
116116
{
117117
HOME: home,
118118
PATH: `${localBin}:${process.env.PATH || ""}`,
@@ -124,8 +124,9 @@ describe("CLI dispatch", () => {
124124

125125
expect(r.code).toBe(0);
126126
expect(r.out).not.toContain("NVIDIA API Key required");
127-
// Services module now runs in-process (no bash shelling)
128-
expect(r.out).toContain("NemoClaw Services");
127+
expect(r.out).toContain("nemoclaw <name> start");
128+
expect(r.out).toContain("nemoclaw tunnel start");
129+
expect(fs.existsSync(markerFile)).toBe(false);
129130
},
130131
);
131132

test/cli/tunnel-command.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,20 @@ describe("tunnel CLI dispatch", () => {
3030
expect(r.out).toContain("Start the cloudflared public-URL tunnel");
3131
});
3232

33-
it("deprecated start --help exits 0 and shows alias usage", () => {
33+
it("deprecated start --help exits 0 and describes migration-only behavior", () => {
3434
const r = run("start --help");
3535
expect(r.code).toBe(0);
36-
expect(r.out).toContain("start");
37-
expect(r.out).toContain("Deprecated alias");
36+
expect(r.out).toContain("this command does not");
37+
expect(r.out).toContain("start a sandbox or public-URL tunnel");
38+
expect(r.out).toContain("nemoclaw <name> start");
39+
expect(r.out).toContain("nemoclaw tunnel start");
40+
});
41+
42+
it("deprecated start exits 0 with sandbox-scoped migration guidance (#9303)", () => {
43+
const r = run("start 2>&1");
44+
expect(r.code).toBe(0);
45+
expect(r.out).toContain("nemoclaw <name> start");
46+
expect(r.out).toContain("nemoclaw tunnel start");
3847
});
3948

4049
it("tunnel stop --help exits 0 and shows tunnel usage", () => {

0 commit comments

Comments
 (0)