Repository navigation
fix(onboard): clarify post-install next steps and add dashboard-url command #3937
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { Args } from "@oclif/core"; | ||
| import { quietFlag } from "../../lib/cli/common-flags"; | ||
| import { NemoClawCommand } from "../../lib/cli/nemoclaw-oclif-command"; | ||
| import { runCapture } from "../../lib/runner"; | ||
| import { | ||
| DashboardUrlCommandError, | ||
| runDashboardUrlCommand, | ||
| } from "../../lib/dashboard-url-command"; | ||
| import type { SandboxEntry } from "../../lib/state/registry"; | ||
|
|
||
| type DashboardUrlRuntimeBridge = { | ||
| fetchGatewayAuthTokenFromSandbox: (sandboxName: string) => string | null; | ||
| getSandbox: (sandboxName: string) => Pick<SandboxEntry, "agent" | "dashboardPort"> | null; | ||
| getAccessUrl?: (port: number) => string | null; | ||
| }; | ||
|
|
||
| let runtimeBridgeFactory = (): DashboardUrlRuntimeBridge => { | ||
| const onboard = require("../../lib/onboard") as Pick< | ||
| DashboardUrlRuntimeBridge, | ||
| "fetchGatewayAuthTokenFromSandbox" | ||
| >; | ||
| const registry = require("../../lib/state/registry") as { | ||
| getSandbox: (name: string) => SandboxEntry | null; | ||
| }; | ||
| const dashboardAccess = require("../../lib/onboard/dashboard-access") as typeof import("../../lib/onboard/dashboard-access"); | ||
| return { | ||
| fetchGatewayAuthTokenFromSandbox: onboard.fetchGatewayAuthTokenFromSandbox, | ||
| getSandbox: (sandboxName: string) => { | ||
| try { | ||
| return registry.getSandbox(sandboxName); | ||
| } catch { | ||
| return null; | ||
| } | ||
| }, | ||
| getAccessUrl: (port: number) => | ||
| dashboardAccess.buildDashboardChain(`http://127.0.0.1:${port}`, { | ||
| runCapture, | ||
| }).accessUrl, | ||
| }; | ||
| }; | ||
|
|
||
| export function setDashboardUrlRuntimeBridgeFactoryForTest( | ||
| factory: () => DashboardUrlRuntimeBridge, | ||
| ): void { | ||
| runtimeBridgeFactory = factory; | ||
| } | ||
|
|
||
| function getRuntimeBridge(): DashboardUrlRuntimeBridge { | ||
| return runtimeBridgeFactory(); | ||
| } | ||
|
|
||
| export default class DashboardUrlCliCommand extends NemoClawCommand { | ||
| static id = "sandbox:dashboard-url"; | ||
| static strict = true; | ||
| static summary = "Print the authenticated OpenClaw dashboard URL"; | ||
| static description = "Print the authenticated OpenClaw dashboard URL for a running sandbox."; | ||
| static usage = ["<name> [--quiet|-q]"]; | ||
| static examples = [ | ||
| "<%= config.bin %> sandbox dashboard-url alpha", | ||
| "<%= config.bin %> sandbox dashboard-url alpha --quiet", | ||
| ]; | ||
| static args = { | ||
| sandboxName: Args.string({ | ||
| name: "sandbox", | ||
| description: "Sandbox name", | ||
| required: true, | ||
| }), | ||
| }; | ||
| static flags = { | ||
| quiet: quietFlag("Print only the URL"), | ||
| }; | ||
|
|
||
| public async run(): Promise<void> { | ||
| const { args, flags } = await this.parse(DashboardUrlCliCommand); | ||
| process.stdout.once("error", (err: NodeJS.ErrnoException) => { | ||
| if (err.code === "EPIPE") { | ||
| this.setExitCode(0); | ||
| return; | ||
| } | ||
| throw err; | ||
| }); | ||
|
|
||
| const runtime = getRuntimeBridge(); | ||
| try { | ||
| runDashboardUrlCommand( | ||
| args.sandboxName, | ||
| { quiet: flags.quiet === true }, | ||
| { | ||
| fetchToken: runtime.fetchGatewayAuthTokenFromSandbox, | ||
| getSandbox: runtime.getSandbox, | ||
| getAccessUrl: runtime.getAccessUrl, | ||
| }, | ||
| ); | ||
| this.setExitCode(0); | ||
| } catch (error) { | ||
| if (error instanceof DashboardUrlCommandError) { | ||
| this.failWithLines(error.lines, error.exitCode); | ||
| return; | ||
| } | ||
| throw error; | ||
| } | ||
| } | ||
| } |
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.
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.