Skip to content

Commit f4574a0

Browse files
committed
fix(cli): guide deprecated global start
Signed-off-by: Deepak Jain <deepujain@gmail.com>
1 parent 54cb2a4 commit f4574a0

5 files changed

Lines changed: 21 additions & 11 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ describe("simple global oclif adapters", () => {
293293
await DeprecatedStartCommand.run([], rootDir);
294294
await DeprecatedStopCommand.run([], rootDir);
295295

296-
expect(mocks.runStartCommand).toHaveBeenCalledTimes(2);
296+
expect(mocks.runStartCommand).toHaveBeenCalledTimes(1);
297297
expect(mocks.runStopCommand).toHaveBeenCalledTimes(2);
298298
expect(mocks.runStartCommand).toHaveBeenCalledWith(
299299
expect.objectContaining({ listSandboxes: expect.any(Function), startAll: mocks.startAll }),

src/commands/start.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
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";
@@ -15,13 +15,11 @@ export default class DeprecatedStartCommand extends NemoClawCommand {
1515
static examples = ["<%= config.bin %> start"];
1616
static state = "deprecated" as const;
1717
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'.",
18+
message: DEPRECATED_START_MESSAGE,
2019
};
2120
static flags = {};
2221

2322
public async run(): Promise<void> {
2423
await this.parse(DeprecatedStartCommand);
25-
await runStartCommand({ ...serviceDeps(), startAll });
2624
}
2725
}

test/cli/tunnel-command.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ describe("tunnel CLI dispatch", () => {
3737
expect(r.out).toContain("Deprecated alias");
3838
});
3939

40+
it("deprecated start exits 0 with sandbox-scoped migration guidance (#9303)", () => {
41+
const r = run("start 2>&1");
42+
expect(r.code).toBe(0);
43+
expect(r.out).toContain("nemoclaw <name> start");
44+
expect(r.out).toContain("nemoclaw tunnel start");
45+
});
46+
4047
it("tunnel stop --help exits 0 and shows tunnel usage", () => {
4148
const r = run("tunnel stop --help");
4249
expect(r.code).toBe(0);

0 commit comments

Comments
 (0)