-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(cli): enrich dashboard-url with connection guidance #7478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a3504c8
feat(cli): add connection info command to reprint the connection block
laitingsheng 12d688d
refactor(cli): keep onboard entrypoint net-neutral for connection info
laitingsheng 71e2076
Merge remote-tracking branch 'origin/main' into feat/connection-info-…
laitingsheng 4ceac20
test(cli): behaviour-oriented issue-linked titles for connection info
laitingsheng 5101fbe
Merge remote-tracking branch 'origin/main' into feat/connection-info-…
laitingsheng f0f2887
merge: resolve conflicts with main
github-actions[bot] 39c9fec
Merge remote-tracking branch 'origin/main' into feat/connection-info-…
sandl99 3d98c44
feat(cli): enrich dashboard-url connection guidance
sandl99 67974cd
Merge remote-tracking branch 'origin/main' into feat/connection-info-…
sandl99 c578254
Merge branch 'main' into feat/connection-info-command
sandl99 1e17215
test(cli): isolate dashboard-url runtime state
sandl99 bf705fb
Merge remote-tracking branch 'origin/feat/connection-info-command' in…
sandl99 f56df0a
merge: refresh dashboard guidance with main
prekshivyas d1e8240
fix(cli): use invoked binary in dashboard guidance
prekshivyas 5d9a241
test(cli): cover invoked dashboard binary
prekshivyas df9fc8d
merge: refresh dashboard guidance with main
prekshivyas 21af1a6
merge: refresh dashboard guidance with main
laitingsheng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { Config as OclifConfig } from "@oclif/core"; | ||
| import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import DashboardUrlCliCommand, { | ||
| resetDashboardUrlRuntimeBridgeFactoryForTest, | ||
| setDashboardUrlRuntimeBridgeFactoryForTest, | ||
| } from "./dashboard-url"; | ||
|
|
||
| describe("dashboard-url CLI output", () => { | ||
| beforeEach(() => { | ||
| vi.restoreAllMocks(); | ||
| setDashboardUrlRuntimeBridgeFactoryForTest(() => ({ | ||
| fetchGatewayAuthTokenFromSandbox: () => "secret-token", | ||
| getSandbox: () => ({ agent: "openclaw", dashboardPort: 18789 }), | ||
| getAccessUrl: () => "http://127.0.0.1:18789", | ||
| })); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| resetDashboardUrlRuntimeBridgeFactoryForTest(); | ||
| vi.restoreAllMocks(); | ||
| }); | ||
|
|
||
| it("prints the authenticated URL with connection and management guidance (#7473)", async () => { | ||
| const output: string[] = []; | ||
| const errors: string[] = []; | ||
| vi.spyOn(console, "log").mockImplementation((message: string) => output.push(message)); | ||
| vi.spyOn(console, "error").mockImplementation((message: string) => errors.push(message)); | ||
|
|
||
| const previousExitCode = process.exitCode; | ||
| try { | ||
| await DashboardUrlCliCommand.run(["alpha"], process.cwd()); | ||
|
|
||
| expect(output).toContain(" http://127.0.0.1:18789/#token=secret-token"); | ||
| expect(output).toContain(" nemoclaw alpha connect"); | ||
| expect(output).toContain(" Manage later"); | ||
| expect(output).toContain(" Status: nemoclaw alpha status"); | ||
| expect(output).toContain(" Logs: nemoclaw alpha logs --follow"); | ||
| expect(errors.join("\n")).toContain("Treat this URL like a password"); | ||
| } finally { | ||
| process.exitCode = previousExitCode; | ||
| } | ||
| }); | ||
|
|
||
| it("uses the invoked CLI binary in every follow-up command (#7473)", async () => { | ||
| const output: string[] = []; | ||
| vi.spyOn(console, "log").mockImplementation((message: string) => output.push(message)); | ||
| vi.spyOn(console, "error").mockImplementation(() => {}); | ||
|
|
||
| const baseConfig = await OclifConfig.load(process.cwd()); | ||
| const config = await OclifConfig.load({ | ||
| root: process.cwd(), | ||
| pjson: { | ||
| ...baseConfig.pjson, | ||
| oclif: { ...baseConfig.pjson.oclif, bin: "nemohermes" }, | ||
| }, | ||
| }); | ||
|
|
||
| const previousExitCode = process.exitCode; | ||
| try { | ||
| await DashboardUrlCliCommand.run(["alpha"], config); | ||
|
|
||
| expect(output).toContain(" nemohermes alpha connect"); | ||
| expect(output).toContain(" Status: nemohermes alpha status"); | ||
| expect(output).toContain(" Logs: nemohermes alpha logs --follow"); | ||
| expect(output).toContain( | ||
| " Model: nemohermes inference set --model <model> --provider <provider> --sandbox alpha", | ||
| ); | ||
| expect(output).toContain(" Policies: nemohermes alpha policy add"); | ||
| expect(output).toContain( | ||
| " Credentials: nemohermes credentials reset <KEY> && nemohermes onboard", | ||
| ); | ||
| } finally { | ||
| process.exitCode = previousExitCode; | ||
| } | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.