The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
onboarding: end Beacon Cloud setup at the dashboard
shukieshahcdf212aba3e0
diff --git a/README.md b/README.mdindex dc4b59e5..d6894dbf 100644--- a/README.md+++ b/README.md@@ -58,8 +58,10 @@ Beacon is an open-source memory layer for AI coding agents that learns from yourBeacon is open source and local-first. Interactive endpoint setup signs in throughbeacon.sh and preselects Beacon Cloud, with an explicit Local opt-out. Signing inforwards nothing; confirming Managed installs Beacon and connects this machine in-the same command, and the confirm screen says so before you accept. System, package,-MDM, and CI installation paths remain noninteractive and account-free.+the same command, and the confirm screen says so before you accept. Setup then ends+on a short summary and opens the hosted dashboard at+[beacon.sh/dashboard](https://beacon.sh/dashboard). System, package, MDM, and CI+installation paths remain noninteractive and account-free.### 1. Install Beacondiff --git a/cli/beacon/.goreleaser.yaml b/cli/beacon/.goreleaser.yamlindex c12fb1ac..27454e6c 100644--- a/cli/beacon/.goreleaser.yaml+++ b/cli/beacon/.goreleaser.yaml@@ -270,13 +270,13 @@ brews:bin.install "beacon-otelcol"bin.install "beacon-vector" if OS.linux?caveats: |- To configure local endpoint telemetry, run:+ Set up Beacon (sign in, choose where telemetry goes, install):beacon endpoint install-- To forward telemetry to the Asymptote dashboard (opt-in, revocable), run:+ Already installed? Send this machine's sessions to Beacon Cloud+ (opt-in, revocable), then open https://beacon.sh/dashboard:beacon endpoint connect- That needs no extra step: this formula installs its own Vector as- beacon-vector, so it never collides with a Vector you already have.+ This formula installs its own Vector as beacon-vector, so it never+ collides with a Vector you already have.test: |system "#{bin}/beacon", "version"diff --git a/cli/beacon/cmd/agent_tools.go b/cli/beacon/cmd/agent_tools.goindex 38b973fd..2588d9c7 100644--- a/cli/beacon/cmd/agent_tools.go+++ b/cli/beacon/cmd/agent_tools.go@@ -60,7 +60,12 @@ func installAgentSkillsFromOnboarding(cmd *cobra.Command, decided onboardingOutcif !decided.InstallSkills {return}- if err := installAgentSkills(cmd.OutOrStdout()); err != nil {+ // The wizard's short closing leaves out where each copy went; a failure is still a warning.+ out := cmd.OutOrStdout()+ if decided.briefClose() {+ out = io.Discard+ }+ if err := installAgentSkills(out); err != nil {fmt.Fprintf(cmd.ErrOrStderr(), "beacon: the Beacon agent skills were not installed (%v). Run `beacon skills install` to try again.\n", err)}}@@ -69,10 +74,13 @@ func installAgentSkillsFromOnboarding(cmd *cobra.Command, decided onboardingOutc// `beacon mcp connect --yes` would, once this endpoint forwards to Beacon Cloud. Leaving the// row selected on the wizard's agent tools screen is the confirmation connect would otherwise// ask for. It writes only the URL (each harness signs in with OAuth on first use) and never a-// token. A failure is a warning naming the retry.-func connectCloudMCPFromOnboarding(cmd *cobra.Command) {- fmt.Fprintln(cmd.OutOrStdout())- err := agentToolsConnectCloudMCP(commandContext(cmd), cmd.OutOrStdout(), cloudMCPRequest{yes: true})+// token. A failure is a warning naming the retry. brief says the outcome in one line, the last+// line of the wizard's short closing.+func connectCloudMCPFromOnboarding(cmd *cobra.Command, brief bool) {+ if !brief {+ fmt.Fprintln(cmd.OutOrStdout())+ }+ err := agentToolsConnectCloudMCP(commandContext(cmd), cmd.OutOrStdout(), cloudMCPRequest{yes: true, brief: brief})if err != nil {fmt.Fprintf(cmd.ErrOrStderr(), "beacon: Beacon Cloud MCP was not registered (%v). Run `beacon mcp connect` to try again.\n", err)}diff --git a/cli/beacon/cmd/agent_tools_test.go b/cli/beacon/cmd/agent_tools_test.goindex 7c9b9f3e..f12e7e80 100644--- a/cli/beacon/cmd/agent_tools_test.go+++ b/cli/beacon/cmd/agent_tools_test.go@@ -82,7 +82,7 @@ func TestOnboardingRegistersCloudMCPWithoutAsking(t *testing.T) {mcpStdin = strings.NewReader("n\n") // would decline if it were askedcmd, out, errOut := agentToolsCommand(t)- connectCloudMCPFromOnboarding(cmd)+ connectCloudMCPFromOnboarding(cmd, false)if errOut.Len() != 0 {t.Fatalf("stderr: %s\nstdout: %s", errOut, out)@@ -111,7 +111,7 @@ func TestOnboardingCloudMCPFailureIsAWarning(t *testing.T) {return errors.New("offline")}cmd, _, errOut := agentToolsCommand(t)- connectCloudMCPFromOnboarding(cmd)+ connectCloudMCPFromOnboarding(cmd, false)if !got.yes || got.dryRun || got.force || got.tokenEnv != "" || len(got.harnesses) != 0 || got.url != "" {t.Fatalf("request = %+v", got)}@@ -211,6 +211,7 @@ func TestRefreshAgentSkillsOnlyUpdatesInstalledCopies(t *testing.T) {func TestFinishCloudSetupRegistersMCPOnlyAfterConnectSucceeds(t *testing.T) {prev := agentToolsConnectCloudMCPt.Cleanup(func() { agentToolsConnectCloudMCP = prev })+ opened := stubDashboardOpener(t)for _, tc := range []struct {name stringoutcome onboardingOutcome@@ -228,13 +229,19 @@ func TestFinishCloudSetupRegistersMCPOnlyAfterConnectSucceeds(t *testing.T) {} {h := newOnboardingHarness(t)h.loaded = onboarding.Profile{Onboarding: onboarding.Onboarding{CompletedAt: "2026-10-05T00:00:00Z"}}- ran := false- agentToolsConnectCloudMCP = func(context.Context, io.Writer, cloudMCPRequest) error {- ran = true+ ran, brief := false, false+ agentToolsConnectCloudMCP = func(_ context.Context, _ io.Writer, req cloudMCPRequest) error {+ ran, brief = true, req.briefreturn nil}+ // As runEndpointInstall does: the wizard's Beacon Cloud connect closes on the summary.+ var summary *cloudSummary+ if tc.outcome.briefClose() {+ summary = &cloudSummary{}+ }+ *opened = nilconnected := false- finishCloudSetup(h.cmd, tc.outcome, tc.connect, func() error {+ finishCloudSetup(h.cmd, tc.outcome, tc.connect, summary, func() error {connected = truereturn tc.connectErr})@@ -244,6 +251,12 @@ func TestFinishCloudSetupRegistersMCPOnlyAfterConnectSucceeds(t *testing.T) {if ran != tc.wantMCP {t.Fatalf("%s: Beacon Cloud MCP ran = %t, want %t", tc.name, ran, tc.wantMCP)}+ if ran && brief != (summary != nil) {+ t.Fatalf("%s: Beacon Cloud MCP brief = %t, want %t", tc.name, brief, summary != nil)+ }+ if wantOpened := tc.outcome.Connect && tc.connectErr == nil; (len(*opened) == 1) != wantOpened {+ t.Fatalf("%s: dashboard opened %v, want opened = %t", tc.name, *opened, wantOpened)+ }if tc.wantStderr != "" && !strings.Contains(h.stderr.String(), tc.wantStderr) {t.Fatalf("%s: stderr = %q", tc.name, h.stderr)}diff --git a/cli/beacon/cmd/endpoint.go b/cli/beacon/cmd/endpoint.goindex 73846925..ab6a3cbb 100644--- a/cli/beacon/cmd/endpoint.go+++ b/cli/beacon/cmd/endpoint.go@@ -432,7 +432,7 @@ func init() {endpointInstallCmd.Flags().BoolVar(&endpointOpts.includeCodexSpans, "include-codex-spans", false, "Include high-volume Codex OTLP spans for troubleshooting")endpointInstallCmd.Flags().BoolVar(&endpointOpts.claudeCaptureModelContext, "claude-capture-model-context", false, claudeCaptureModelContextUsage)endpointInstallCmd.Flags().BoolVar(&endpointOpts.noStart, "no-start", false, "Write files without starting the collector service")- endpointInstallCmd.Flags().BoolVar(&endpointOpts.noBrowser, "no-browser", false, "During interactive setup, print the sign-in URL instead of opening a browser")+ endpointInstallCmd.Flags().BoolVar(&endpointOpts.noBrowser, "no-browser", false, "During interactive setup, print the sign-in and dashboard URLs instead of opening a browser")endpointInstallCmd.Flags().StringVar(&endpointOpts.serviceKind, "service", "", "Service manager to use: auto (default), launchd, systemd, or none for a supervised collector process")endpointInstallCmd.Flags().BoolVar(&endpointOpts.dryRun, "dry-run", false, "Print planned actions without changing endpoint files or services")endpointInstallCmd.Flags().BoolVar(&endpointOpts.noBackfill, "no-backfill", false, "Skip reading the last 30 days of agent sessions from their local session stores into the runtime log (also "+endpointBackfillEnv+"=0)")diff --git a/cli/beacon/cmd/endpoint_connect.go b/cli/beacon/cmd/endpoint_connect.goindex 6bd9f817..cae81636 100644--- a/cli/beacon/cmd/endpoint_connect.go+++ b/cli/beacon/cmd/endpoint_connect.go@@ -94,6 +94,13 @@ func runEndpointConnect(cmd *cobra.Command, args []string) error {// call it after a successful install; `endpoint connect` calls it directly. backfilled// says the caller has just run the session backfill, so connect only ships it.func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string, backfilled bool) error {+ return connectEndpointFor(cmd, userMode, logPath, backfilled, nil)+}++// connectEndpointFor is connectEndpoint for an install that closes on the wizard's short summary+// when summary is non-nil: it says one line for the connection, then the install's backfill report,+// and leaves the dashboard and what comes next to finishCloudSetup.+func connectEndpointFor(cmd *cobra.Command, userMode bool, logPath string, backfilled bool, summary *cloudSummary) error {hostname, _ := os.Hostname()out := cmd.OutOrStdout()if endpointOpts.jsonOutput {@@ -110,6 +117,7 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string, backfillPrivacyMode: privacyMode,Backfill: endpointConnectBackfill(out, userMode, logPath, backfilled),Out: out,+ Quiet: summary != nil,Enroll: asymptote.EnrollOptions{DashboardURL: connectOpts.dashboardURL,NoBrowser: connectOpts.noBrowser,@@ -122,6 +130,7 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string, backfill},},}+ signedInAs := ""if userMode {session, err := connectAccountLoad()if err != nil {@@ -145,6 +154,7 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string, backfillBaseURL: session.BaseURL,AccessToken: session.AccessToken,}+ signedInAs = session.User.Email}result, err := connectManagedEndpoint(context.Background(), options)if err != nil {@@ -153,6 +163,15 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string, backfillif endpointOpts.jsonOutput {return json.NewEncoder(os.Stdout).Encode(result)}+ if summary != nil {+ fmt.Fprintln(out, connectedSummaryLine(result.Enrollment, signedInAs))+ _, _ = summary.backfill.WriteTo(out)+ summary.dashboardURL = dashboardHomeURL(result.Enrollment.DashboardURL)+ if result.Backfill != nil {+ summary.uploading = result.Backfill.Events+ }+ return nil+ }fmt.Fprintf(out, "Connected to Beacon Cloud as device %s", result.Enrollment.DeviceID)if result.Enrollment.OrganizationName != "" {fmt.Fprintf(out, " for %s", result.Enrollment.OrganizationName)@@ -177,6 +196,24 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string, backfillreturn nil}+// connectedSummaryLine is the first line of the wizard's short closing: Beacon works, and where its+// telemetry goes. The account is the one that authorized the device, falling back to the signed-in+// session and then the organization.+func connectedSummaryLine(enrollment asymptote.Enrollment, signedInAs string) string {+ account := enrollment.Email+ if account == "" {+ account = signedInAs+ }+ if account == "" {+ account = enrollment.OrganizationName+ }+ line := "Beacon is installed and connected to Beacon Cloud"+ if account != "" {+ line += " as " + account+ }+ return fmt.Sprintf("%s (device %s, %s privacy).", line, enrollment.DeviceID, managedprivacy.Label(enrollment.PrivacyMode))+}+func selectedManagedPrivacyMode(userMode bool) (string, error) {if connectOpts.privacyMode != "" {return managedprivacy.Normalize(connectOpts.privacyMode)diff --git a/cli/beacon/cmd/endpoint_hooks.go b/cli/beacon/cmd/endpoint_hooks.goindex 750264b7..41d52130 100644--- a/cli/beacon/cmd/endpoint_hooks.go+++ b/cli/beacon/cmd/endpoint_hooks.go@@ -3,6 +3,7 @@ package cmdimport ("encoding/json""fmt"+ "io""os""strings"@@ -59,6 +60,13 @@ func runEndpointHooksInstall(cmd *cobra.Command, args []string) error {}func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {+ return installEndpointHookTargetTo(os.Stdout, os.Stdout, name, cfg)+}++// installEndpointHookTargetTo installs one hook target. report gets the files written; notes gets+// what the person still has to do or know for the runtime to collect (a restart, a trust prompt, a+// scope caveat). The onboarding wizard's short closing drops the first and keeps the second.+func installEndpointHookTargetTo(report, notes io.Writer, name string, cfg endpointconfig.Config) error {switch strings.TrimSpace(name) {case "antigravity":status, err := endpointhooks.InstallAntigravity(endpointhooks.AntigravityOptions{@@ -69,7 +77,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Antigravity hooks installed: %s\n", status.ConfigPath)+ fmt.Fprintf(report, "Antigravity hooks installed: %s\n", status.ConfigPath)case "cursor":status, err := endpointhooks.InstallCursor(endpointhooks.CursorOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -79,7 +87,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Cursor hooks installed: %s\n", status.HooksJSONPath)+ fmt.Fprintf(report, "Cursor hooks installed: %s\n", status.HooksJSONPath)case "claude":status, err := endpointhooks.InstallClaude(endpointhooks.ClaudeOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -89,7 +97,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Claude Code hooks installed: %s\n", status.SettingsPath)+ fmt.Fprintf(report, "Claude Code hooks installed: %s\n", status.SettingsPath)case "codex":status, err := endpointhooks.InstallCodex(endpointhooks.CodexOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -99,7 +107,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Codex CLI endpoint hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "Codex CLI endpoint hooks installed: %s\n", status.HooksPath)case "vscode":status, err := endpointhooks.InstallVSCode(endpointhooks.VSCodeOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -109,7 +117,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("VS Code hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "VS Code hooks installed: %s\n", status.HooksPath)case "factory":status, err := endpointhooks.InstallFactory(endpointhooks.FactoryOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -119,7 +127,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Factory hooks installed: %s\n", status.SettingsPath)+ fmt.Fprintf(report, "Factory hooks installed: %s\n", status.SettingsPath)case "opencode":status, err := endpointhooks.InstallOpenCode(endpointhooks.OpenCodeOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -129,7 +137,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("opencode plugin installed: %s\n", status.PluginPath)+ fmt.Fprintf(report, "opencode plugin installed: %s\n", status.PluginPath)case "cline":status, err := endpointhooks.InstallCline(endpointhooks.ClineOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -139,7 +147,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Cline plugin installed: %s\n", status.PluginPath)+ fmt.Fprintf(report, "Cline plugin installed: %s\n", status.PluginPath)case "pi":status, err := endpointhooks.InstallPi(endpointhooks.PiOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -149,9 +157,9 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Pi extension installed: %s\n", status.ExtensionPath)+ fmt.Fprintf(report, "Pi extension installed: %s\n", status.ExtensionPath)if endpointhooks.Level(endpointOpts.hookLevel) == endpointhooks.LevelProject {- fmt.Println("Project-level Pi extensions are subject to Pi's project-trust prompt; a user-level install needs no further interaction.")+ fmt.Fprintln(notes, "Project-level Pi extensions are subject to Pi's project-trust prompt; a user-level install needs no further interaction.")}case "omp":status, err := endpointhooks.InstallOmp(endpointhooks.OmpOptions{@@ -162,13 +170,13 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Oh My Pi extension installed: %s\n", status.ExtensionPath)+ fmt.Fprintf(report, "Oh My Pi extension installed: %s\n", status.ExtensionPath)if endpointhooks.Level(endpointOpts.hookLevel) == endpointhooks.LevelProject {// Unlike Pi, Oh My Pi has no per-directory trust gate -- its own isProjectTrusted()// always returns true because `.omp` project inputs are loaded unconditionally. So the// note here is about scope rather than about a prompt: a project install covers one// checkout, and the operator's other Oh My Pi sessions stay uninstrumented.- fmt.Println("Project-level Oh My Pi extensions cover only this working directory; a user-level install follows the operator across checkouts.")+ fmt.Fprintln(notes, "Project-level Oh My Pi extensions cover only this working directory; a user-level install follows the operator across checkouts.")}case "prime":status, err := endpointhooks.InstallPrime(endpointhooks.PrimeOptions{@@ -179,7 +187,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Prime Agent extension installed: %s\n", status.ExtensionPath)+ fmt.Fprintf(report, "Prime Agent extension installed: %s\n", status.ExtensionPath)case "omo":status, err := endpointhooks.InstallOmo(endpointhooks.OmoOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -189,7 +197,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Senpi extension installed: %s\n", status.ExtensionPath)+ fmt.Fprintf(report, "Senpi extension installed: %s\n", status.ExtensionPath)case "openclaw":status, err := endpointhooks.InstallOpenClaw(endpointhooks.OpenClawOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -199,21 +207,21 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("OpenClaw plugin installed: %s\n", status.PluginPath)+ fmt.Fprintf(report, "OpenClaw plugin installed: %s\n", status.PluginPath)if endpointhooks.Level(endpointOpts.hookLevel) == endpointhooks.LevelProject {// OpenClaw reads a workspace plugin root relative to the gateway's working directory,// which for a daemonized gateway is wherever the service manager started it rather// than the checkout the operator is thinking of. A user-level install follows the// gateway regardless, which is why it is the default.- fmt.Println("Project-level OpenClaw plugins are discovered relative to the gateway's workspace, not the directory you install from; a user-level install follows the gateway.")+ fmt.Fprintln(notes, "Project-level OpenClaw plugins are discovered relative to the gateway's workspace, not the directory you install from; a user-level install follows the gateway.")}// OpenClaw gates conversation hooks behind a config key Beacon does not write, and an// allowlisted config has to name the plugin. Printed at install time because the symptom// otherwise is partial telemetry that looks like working telemetry.for _, advice := range status.ConfigAdvice {- fmt.Println(advice)+ fmt.Fprintln(notes, advice)}- fmt.Println("Restart the gateway, or run `openclaw plugins reload beacon-endpoint`, for OpenClaw to pick the plugin up.")+ fmt.Fprintln(notes, "Restart the gateway, or run `openclaw plugins reload beacon-endpoint`, for OpenClaw to pick the plugin up.")case "grok":status, err := endpointhooks.InstallGrok(endpointhooks.GrokOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -223,9 +231,9 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Grok hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "Grok hooks installed: %s\n", status.HooksPath)if strings.Contains(status.Message, "/hooks-trust") {- fmt.Println(status.Message)+ fmt.Fprintln(notes, status.Message)}case "openhands":status, err := endpointhooks.InstallOpenHands(endpointhooks.OpenHandsOptions{@@ -236,15 +244,15 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("OpenHands hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "OpenHands hooks installed: %s\n", status.HooksPath)// Said at user scope only, because it is the case where a successful install still collects// nothing. OpenHands reads the first hooks.json it finds rather than merging the two, and// the agent server behind the CLI and the GUI reads only the project file -- so a// user-scope install is right for someone driving the SDK directly and silently inert for// everyone else. Better to say it here than to have somebody discover it from an empty log.if endpointhooks.Level(endpointOpts.hookLevel) != endpointhooks.LevelProject {- fmt.Println("OpenHands reads a repository's own .openhands/hooks.json in preference to this one, " +- "and its agent server (used by the CLI and the GUI) reads only the repository file. " ++ fmt.Fprintln(notes, "OpenHands reads a repository's own .openhands/hooks.json in preference to this one, "++ "and its agent server (used by the CLI and the GUI) reads only the repository file. "+"Run the install again with --level project inside a repository to cover those.")}case "dsh":@@ -259,12 +267,12 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {// Both paths, because the install is two files and the mount is the half an operator is// least likely to guess at. Naming only the hooks file would send somebody looking for a// mount that is not there.- fmt.Printf("DeepSeek Harness hooks installed: %s\n", status.HooksPath)- fmt.Printf("DeepSeek Harness hook bridge mounted in: %s\n", status.PatchPath)+ fmt.Fprintf(report, "DeepSeek Harness hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "DeepSeek Harness hook bridge mounted in: %s\n", status.PatchPath)// Said on every install, because a running dsh will not pick this up on its own unless the// profile enabled HMR -- and the symptom otherwise is a successful install collecting// nothing until the next restart, which reads as a broken install.- fmt.Println("Restart dsh (or rely on its config watcher, if your profile enables HMR) for the hooks to take effect.")+ fmt.Fprintln(notes, "Restart dsh (or rely on its config watcher, if your profile enables HMR) for the hooks to take effect.")case "kimi":status, err := endpointhooks.InstallKimi(endpointhooks.KimiOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -274,11 +282,11 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Kimi Code hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "Kimi Code hooks installed: %s\n", status.HooksPath)// Said on every install, because Kimi Code reads config.toml once at startup: a running// session will not pick these up, and the symptom is a successful install collecting// nothing until the next `kimi`, which reads as a broken install.- fmt.Println("Start a new Kimi Code session (or run /reload) for the hooks to take effect.")+ fmt.Fprintln(notes, "Start a new Kimi Code session (or run /reload) for the hooks to take effect.")case "kiro":status, err := endpointhooks.InstallKiro(endpointhooks.KiroOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -288,7 +296,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Kiro hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "Kiro hooks installed: %s\n", status.HooksPath)// No scope caveat, unlike OpenHands just above. Kiro merges hook files across scopes// rather than resolving them by precedence, so a user-scope install keeps working inside a// repository that has hooks of its own, and one install covers the IDE and the CLI at@@ -306,8 +314,8 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {// the other: Beacon owns the hooks file, while the settings key that makes Muse read it// lives in the user's own settings.json. Anyone verifying the install by hand needs to look// at both files.- fmt.Printf("Muse Code hooks installed: %s\n", status.HooksPath)- fmt.Printf("Muse Code settings updated: %s\n", status.SettingsPath)+ fmt.Fprintf(report, "Muse Code hooks installed: %s\n", status.HooksPath)+ fmt.Fprintf(report, "Muse Code settings updated: %s\n", status.SettingsPath)case "qwen":status, err := endpointhooks.InstallQwen(endpointhooks.QwenOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -317,12 +325,12 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Qwen Code hooks installed: %s\n", status.SettingsPath)+ fmt.Fprintf(report, "Qwen Code hooks installed: %s\n", status.SettingsPath)// Printed only when it applies. A project-level install into an untrusted folder writes a// file that does nothing until the user trusts the folder, and silence there would read as// "collecting".if strings.Contains(status.Message, "trusted") {- fmt.Println(status.Message)+ fmt.Fprintln(notes, status.Message)}case "hermes":status, err := endpointhooks.InstallHermes(endpointhooks.HermesOptions{@@ -333,8 +341,8 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Hermes Agent hooks installed: %s\n", status.ConfigPath)- fmt.Println("Hermes may prompt to trust new shell hooks on first use; use HERMES_ACCEPT_HOOKS=1 or hooks_auto_accept: true for non-TTY runs.")+ fmt.Fprintf(report, "Hermes Agent hooks installed: %s\n", status.ConfigPath)+ fmt.Fprintln(notes, "Hermes may prompt to trust new shell hooks on first use; use HERMES_ACCEPT_HOOKS=1 or hooks_auto_accept: true for non-TTY runs.")case "devin-cli":status, err := endpointhooks.InstallDevin(endpointhooks.DevinOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -344,7 +352,7 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Devin CLI hooks installed: %s\n", status.ConfigPath)+ fmt.Fprintf(report, "Devin CLI hooks installed: %s\n", status.ConfigPath)case "devin-desktop":status, err := endpointhooks.InstallDevinDesktop(endpointhooks.DevinDesktopOptions{Level: endpointhooks.Level(endpointOpts.hookLevel),@@ -354,8 +362,8 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {if err != nil {return err}- fmt.Printf("Devin Desktop hooks installed: %s\n", status.ConfigPath)- fmt.Println("Devin Desktop hook files are installed; generate a Desktop event and check the runtime log to validate execution.")+ fmt.Fprintf(report, "Devin Desktop hooks installed: %s\n", status.ConfigPath)+ fmt.Fprintln(notes, "Devin Desktop hook files are installed; generate a Desktop event and check the runtime log to validate execution.")case "":default:return fmt.Errorf("unsupported hook harness %q", name)diff --git a/cli/beacon/cmd/endpoint_install.go b/cli/beacon/cmd/endpoint_install.goindex 010e0ddb..2f1d62e2 100644--- a/cli/beacon/cmd/endpoint_install.go+++ b/cli/beacon/cmd/endpoint_install.go@@ -1,6 +1,7 @@package cmdimport (+ "bytes""encoding/json""errors""fmt"@@ -15,6 +16,7 @@ import ("github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/schema""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/service""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/writer"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/onboarding""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/version""github.com/spf13/cobra")@@ -133,6 +135,11 @@ func endpointInstallOptions(selection endpointTargetSelection, serviceKind servi}}+// errSetupCancelled replaces the wizard's own "onboarding cancelled", which read as a failure+// and left the person to guess what state the machine was in. The wizard runs before anything is+// written, so the answer is always the same: nothing changed, and here is how to start again.+var errSetupCancelled = fmt.Errorf("setup cancelled; nothing was installed. Run `beacon endpoint install` again when you are ready, or set %s=0 to install without the guided setup", onboardingEnvEnabled)+func runEndpointInstall(cmd *cobra.Command, args []string) error {selection, err := resolveEndpointTargets(endpointOpts.harnesses, harness.DiscoverAll())if err != nil {@@ -150,11 +157,25 @@ func runEndpointInstall(cmd *cobra.Command, args []string) error {// non-interactive path (package postinstall, MDM, CI) is gated out inside.onboarded, err := maybeRunOnboarding(cmd)if err != nil {+ if errors.Is(err, onboarding.ErrWizardCancelled) {+ return errSetupCancelled+ }return err}// Confirming Beacon Cloud connects this endpoint; --connect does the same for// the paths the wizard did not own.connectAfterInstall := onboarded.Connect || endpointOpts.connect+ // A wizard install that connects to Beacon Cloud closes on a short summary (cloudSummary)+ // instead of the paths and per-runtime lines below, which are for operators and scripts.+ // Warnings still go to stderr. With nothing else said, the install, the backfill and the+ // connect would pass in silence, so one line says what is happening first.+ var summary *cloudSummary+ details := io.Writer(os.Stdout)+ if onboarded.briefClose() {+ summary = &cloudSummary{}+ details = io.Discard+ fmt.Fprintln(cmd.OutOrStdout(), "Installing Beacon and connecting to Beacon Cloud...")+ }result, err := endpointLifecycleInstall(endpointInstallOptions(selection, serviceKind))if err != nil {return err@@ -167,20 +188,20 @@ func runEndpointInstall(cmd *cobra.Command, args []string) error {fmt.Fprintf(cmd.ErrOrStderr(), "beacon: %v\n", err)}}- fmt.Printf("Endpoint config written to %s\n", result.ConfigPath)- fmt.Printf("Collector config written to %s\n", result.CollectorConfigPath)- fmt.Printf("Service definition written to %s\n", result.PlistPath)- fmt.Printf("Install manifest written to %s\n", result.ManifestPath)- fmt.Printf("Runtime log: %s\n", result.LogPath)+ fmt.Fprintf(details, "Endpoint config written to %s\n", result.ConfigPath)+ fmt.Fprintf(details, "Collector config written to %s\n", result.CollectorConfigPath)+ fmt.Fprintf(details, "Service definition written to %s\n", result.PlistPath)+ fmt.Fprintf(details, "Install manifest written to %s\n", result.ManifestPath)+ fmt.Fprintf(details, "Runtime log: %s\n", result.LogPath)switch {case result.InventoryJobPath != "":- fmt.Printf("Scheduled inventory job: %s\n", result.InventoryJobPath)+ fmt.Fprintf(details, "Scheduled inventory job: %s\n", result.InventoryJobPath)case result.InventoryJobDetail != "":- fmt.Printf("Scheduled inventory job not installed: %s\n", result.InventoryJobDetail)+ fmt.Fprintf(details, "Scheduled inventory job not installed: %s\n", result.InventoryJobDetail)}- reportManagedForwarder(os.Stdout, cmd.ErrOrStderr(), result.ManagedForwarder)+ reportManagedForwarder(details, cmd.ErrOrStderr(), result.ManagedForwarder)printLingerGap(cmd.ErrOrStderr(), result)- installHookTargetsFromEndpointInstall(cmd.ErrOrStderr(), selection.Hooks)+ installHookTargetsFromEndpointInstall(details, cmd.ErrOrStderr(), selection.Hooks)refreshAgentSkills(cmd.ErrOrStderr())installAgentSkillsFromOnboarding(cmd, onboarded)// Read recent history from the agents' own session stores so the dashboard has sessions@@ -188,31 +209,65 @@ func runEndpointInstall(cmd *cobra.Command, args []string) error {// install; a connect below ships what it wrote rather than sweeping again.backfilled := falseif endpointBackfillEnabled() {- reportEndpointBackfill(cmd.OutOrStdout(), runEndpointBackfill(result.LogPath, endpointUserMode()))+ backfillOut := cmd.OutOrStdout()+ if summary != nil {+ backfillOut = &summary.backfill+ }+ reportEndpointBackfill(backfillOut, runEndpointBackfill(result.LogPath, endpointUserMode()))backfilled = true}- finishCloudSetup(cmd, onboarded, connectAfterInstall, func() error {- return connectEndpoint(cmd, endpointUserMode(), result.LogPath, backfilled)+ finishCloudSetup(cmd, onboarded, connectAfterInstall, summary, func() error {+ return connectEndpointFor(cmd, endpointUserMode(), result.LogPath, backfilled, summary)})return nil}+// cloudSummary is the closing of a wizard install that connects to Beacon Cloud, said in place of+// the full install, connect and Beacon Cloud MCP reports. Those are written for an operator reading+// a log. Someone who has just confirmed the wizard needs to know that it worked, what history is on+// its way, where to look, and what is left to do in their agents, in that order:+//+// Beacon is installed and connected to Beacon Cloud as <account> (device <id>, <mode> privacy).+// Session backfill: <n> events from the last 30 days (<runtime> <n>, ...).+// Dashboard: <url> (...)+// Beacon Cloud MCP added to <apps>; sign in to beacon-managed once in each app (...).+//+// Warnings, and the retry commands they name, still go to stderr. `beacon endpoint connect`,+// `beacon mcp connect` and `install --connect` without the wizard keep their full output.+type cloudSummary struct {+ // backfill holds the install's session backfill report until the connected line is said.+ backfill bytes.Buffer+ // dashboardURL is the hosted dashboard, set by a successful connect.+ dashboardURL string+ // uploading is how many events of session history the connect staged for upload.+ uploading int+}++// onboardingOpenDashboard is a seam for tests, which must never open a real browser.+var onboardingOpenDashboard = auth.OpenBrowser+// finishCloudSetup connects the endpoint when the wizard or --connect asked for it, and then// registers Beacon Cloud MCP when the wizard kept it selected. MCP is registered only once the-// endpoint forwards to Beacon Cloud, since there is nothing for it to search otherwise.-func finishCloudSetup(cmd *cobra.Command, onboarded onboardingOutcome, connectAfterInstall bool, connect func() error) {+// endpoint forwards to Beacon Cloud, since there is nothing for it to search otherwise. summary is+// non-nil when the install closes on the wizard's short summary; connect fills it in.+func finishCloudSetup(cmd *cobra.Command, onboarded onboardingOutcome, connectAfterInstall bool, summary *cloudSummary, connect func() error) {if !connectAfterInstall {if onboarded.ConnectCloudMCP {// An endpoint that was already connected keeps its device key and is not// re-enrolled, but the person still asked for Beacon Cloud MCP.- connectCloudMCPFromOnboarding(cmd)+ connectCloudMCPFromOnboarding(cmd, false)}return}// The install is complete and stands on its own; a failed connect is reported with the// retry command rather than turning a working install into an error.- fmt.Fprintln(cmd.OutOrStdout())+ out := cmd.OutOrStdout()+ fmt.Fprintln(out)if err := connect(); err != nil {+ if summary != nil {+ fmt.Fprintln(out, "Beacon is installed on this machine, but it is not connected to Beacon Cloud yet.")+ _, _ = summary.backfill.WriteTo(out)+ }fmt.Fprintf(cmd.ErrOrStderr(), "beacon: managed ingest was not connected (%v). Run `beacon endpoint connect` to try again.\n", err)if onboarded.ConnectCloudMCP {fmt.Fprintln(cmd.ErrOrStderr(), "beacon: Beacon Cloud MCP was not registered either; run `beacon mcp connect` once the endpoint is connected.")@@ -220,11 +275,40 @@ func finishCloudSetup(cmd *cobra.Command, onboarded onboardingOutcome, connectAfreturn}recordDestinationAsymptote(cmd)+ if summary != nil {+ showDashboard(cmd, summary)+ }if onboarded.ConnectCloudMCP {- connectCloudMCPFromOnboarding(cmd)+ connectCloudMCPFromOnboarding(cmd, summary != nil)+ return+ }+ suggestMCPConnect(out, onboarded.Connect)+}++// showDashboard names the hosted dashboard and opens it, since that is where someone who just+// finished the wizard goes next. The browser is opened only where the person can see it: not with+// --no-browser, not over SSH (a browser there would open on the remote machine's screen, if+// anywhere), and not on a Linux machine without a display. A browser that fails to open is not+// worth a warning, because the URL is on screen either way.+func showDashboard(cmd *cobra.Command, summary *cloudSummary) {+ url := summary.dashboardURL+ if url == "" {+ url = dashboardHomeURL("")+ }+ line := "Dashboard: " + url+ if summary.uploading > 0 {+ line += " (your recent sessions appear within a few minutes)"+ } else {+ line += " (sessions appear within a minute of agent activity)"+ }+ fmt.Fprintln(cmd.OutOrStdout(), line)+ if endpointOpts.noBrowser || os.Getenv("SSH_CONNECTION") != "" || os.Getenv("SSH_TTY") != "" {+ return+ }+ if onboardingDisplayCheck() != nil {return}- suggestMCPConnect(cmd.OutOrStdout(), onboarded.Connect)+ _ = onboardingOpenDashboard(url)}// suggestMCPConnect points a person who chose Beacon Cloud in the wizard, but turned Beacon@@ -369,7 +453,7 @@ func runEndpointRepair(cmd *cobra.Command, args []string) error {fmt.Printf("Endpoint repaired. Manifest: %s\n", result.ManifestPath)reportManagedForwarder(os.Stdout, cmd.ErrOrStderr(), result.ManagedForwarder)printLingerGap(cmd.ErrOrStderr(), result)- installHookTargetsFromEndpointInstall(cmd.ErrOrStderr(), selection.Hooks)+ installHookTargetsFromEndpointInstall(os.Stdout, cmd.ErrOrStderr(), selection.Hooks)refreshAgentSkills(cmd.ErrOrStderr())return nil}@@ -422,7 +506,9 @@ func printLingerGap(out io.Writer, result lifecycle.InstallResult) {}// installHookTargetsFromEndpointInstall installs the hook targets that ride an endpoint-// install or repair, and reports the ones it could not write as warnings on out.+// install or repair, says what it wrote on report, and reports the ones it could not write as+// warnings on out. What a runtime still needs from the person (a restart, a trust prompt) goes to+// stdout whatever report is, because that runtime collects nothing until it is done.//// By the time this runs the collector, its config, the service unit, and the OTLP settings// are all in place, so the endpoint works. A hook that could not be written, most often a@@ -430,7 +516,7 @@ func printLingerGap(out io.Writer, result lifecycle.InstallResult) {// from being retried, and it used to turn that complete install into a non-zero exit that// read as a broken endpoint. Every target is still attempted, so one runtime's settings// file cannot stop another runtime's hooks from being installed.-func installHookTargetsFromEndpointInstall(out io.Writer, targets []string) {+func installHookTargetsFromEndpointInstall(report, out io.Writer, targets []string) {if len(targets) == 0 {return}@@ -440,7 +526,7 @@ func installHookTargetsFromEndpointInstall(out io.Writer, targets []string) {}var failed []stringfor _, target := range targets {- if err := installEndpointHookTarget(target, cfg); err != nil {+ if err := installEndpointHookTargetTo(report, os.Stdout, target, cfg); err != nil {failed = append(failed, target)fmt.Fprintf(out, "Warning: %s hooks were not installed: %v\n", target, err)}diff --git a/cli/beacon/cmd/endpoint_install_summary_test.go b/cli/beacon/cmd/endpoint_install_summary_test.gonew file mode 100644index 00000000..f113a1c9--- /dev/null+++ b/cli/beacon/cmd/endpoint_install_summary_test.go@@ -0,0 +1,298 @@+package cmd++import (+ "context"+ "errors"+ "io"+ "path/filepath"+ "strings"+ "testing"+ "time"++ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/account"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/asymptote"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/lifecycle"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/service"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/mcpconnect"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/onboarding"+)++// stubDashboardOpener records the URLs the install would open, on a machine that has a display+// and is not reached over SSH, without --no-browser.+func stubDashboardOpener(t *testing.T) *[]string {+ t.Helper()+ prevOpen, prevDisplay, prevNoBrowser := onboardingOpenDashboard, onboardingDisplayCheck, endpointOpts.noBrowser+ t.Cleanup(func() {+ onboardingOpenDashboard, onboardingDisplayCheck, endpointOpts.noBrowser = prevOpen, prevDisplay, prevNoBrowser+ })+ opened := &[]string{}+ onboardingOpenDashboard = func(url string) error {+ *opened = append(*opened, url)+ return nil+ }+ onboardingDisplayCheck = func() error { return nil }+ endpointOpts.noBrowser = false+ t.Setenv("SSH_CONNECTION", "")+ t.Setenv("SSH_TTY", "")+ return opened+}++// stubCloudConnect makes connectEndpointFor enroll as [email protected] without a network,+// returning a connect that staged events of session history, or err.+func stubCloudConnect(t *testing.T, events int, err error) *asymptote.ConnectOptions {+ t.Helper()+ prevLoad, prevConnect, prevConnectOpts := connectAccountLoad, connectManagedEndpoint, connectOpts+ t.Cleanup(func() {+ connectAccountLoad, connectManagedEndpoint, connectOpts = prevLoad, prevConnect, prevConnectOpts+ })+ connectOpts.privacyMode = ""+ connectAccountLoad = func() (*account.Session, error) {+ return &account.Session{+ BaseURL: "https://beacon.sh", AccessToken: "bcn_cli_secret", ExpiresAt: time.Now().Add(time.Hour),+ Scopes: []string{account.ScopeProfileRead, account.ScopeDeviceEnroll},+ User: account.User{ID: "usr_1", Email: "[email protected]"},+ }, nil+ }+ captured := &asymptote.ConnectOptions{}+ connectManagedEndpoint = func(_ context.Context, options asymptote.ConnectOptions) (*asymptote.ConnectResult, error) {+ *captured = options+ if err != nil {+ return nil, err+ }+ return &asymptote.ConnectResult{+ Enrollment: asymptote.Enrollment{DeviceID: "dev_7f3a", DashboardURL: "https://beacon.sh", PrivacyMode: options.PrivacyMode},+ Forwarder: "test",+ ForwarderState: service.Status{Loaded: true, Running: true},+ VectorConfig: "/tmp/vector.toml",+ SecretsFile: "/tmp/secrets.json",+ Backfill: &asymptote.BackfillResult{Events: events},+ }, nil+ }+ return captured+}++// Finishing the wizard with Beacon Cloud used to end on some forty lines of paths and per-harness+// steps, and nothing sent the person to the dashboard. It now closes on four lines and opens it.+func TestWizardInstallClosesOnAShortSummaryAndOpensTheDashboard(t *testing.T) {+ recordEndpointLifecycle(t)+ h := newOnboardingHarness(t)+ fx := newMCPFixture(t, "claude_code", "cursor", "vscode")+ mcpIngestURL = func() string { return strings.TrimSuffix(fx.url, "/mcp") }+ opened := stubDashboardOpener(t)+ captured := stubCloudConnect(t, 12, nil)+ // Claude Code has more history than its share of the budget; Codex fits.+ stubBackfill(t, 1<<20, 4000,+ endpointBackfillRunner{Name: "Claude Code", Sync: "beacon endpoint claude sync", Run: writingRunner("claude", 100, nil).Run},+ writingRunner("Codex", 2, nil))+ logPath := filepath.Join(t.TempDir(), "runtime.jsonl")+ endpointLifecycleInstall = func(lifecycle.InstallOptions) (lifecycle.InstallResult, error) {+ return lifecycle.InstallResult{LogPath: logPath, ConfigPath: "/tmp/config.json"}, nil+ }+ endpointOpts.harnesses = ""+ onboardingRunWizard = func(io.Reader, io.Writer, onboarding.WizardOptions) (onboarding.WizardResult, error) {+ return onboarding.WizardResult{+ Completed: true, Destination: onboarding.DestinationAsymptote, PrivacyMode: "standard",+ ConnectCloudMCP: true, InstallSkills: true,+ }, nil+ }++ if err := runEndpointInstall(h.cmd, nil); err != nil {+ t.Fatal(err)+ }+ if h.stderr.Len() != 0 {+ t.Fatalf("stderr: %s", h.stderr)+ }+ if !captured.Quiet {+ t.Fatal("the wizard's connect printed its progress lines")+ }+ t.Logf("final screen:\n%s", h.stdout)+ lines := strings.Split(strings.TrimSpace(h.stdout.String()), "\n")+ want := []string{+ "Installing Beacon and connecting to Beacon Cloud...",+ "",+ "Beacon is installed and connected to Beacon Cloud as [email protected] (device dev_7f3a, Standard privacy).",+ "Session backfill: ",+ " Claude Code: stopped at the backfill size limit; `beacon endpoint claude sync` reads the rest.",+ "Dashboard: https://beacon.sh/dashboard (your recent sessions appear within a few minutes)",+ "Beacon Cloud MCP added to Claude Code, Cursor, VS Code; sign in to beacon-managed once in each app (Claude Code: /mcp in a new session).",+ }+ if len(lines) != len(want) {+ t.Fatalf("final screen has %d lines, want %d:\n%s", len(lines), len(want), h.stdout)+ }+ for i, prefix := range want {+ if !strings.HasPrefix(lines[i], prefix) || (prefix == "" && lines[i] != "") {+ t.Fatalf("line %d = %q, want %q:\n%s", i+1, lines[i], prefix, h.stdout)+ }+ }+ if !strings.Contains(lines[3], "(Claude Code ") || !strings.Contains(lines[3], "Codex 2") {+ t.Fatalf("backfill line = %q", lines[3])+ }+ if len(*opened) != 1 || (*opened)[0] != "https://beacon.sh/dashboard" {+ t.Fatalf("dashboard opened %v, want https://beacon.sh/dashboard once", *opened)+ }+ if strings.Contains(h.stdout.String(), "bcn_cli_secret") {+ t.Fatal("the account token reached the output")+ }+}++func TestWizardCloudConnectOpensTheDashboardOnlyWhereThePersonCanSeeIt(t *testing.T) {+ for _, tc := range []struct {+ name string+ connectErr error+ setup func(t *testing.T)+ wantOpen bool+ wantLine bool+ }{+ {name: "connected", wantOpen: true, wantLine: true},+ {name: "connect failed", connectErr: errors.New("enroll failed")},+ {name: "--no-browser", setup: func(*testing.T) { endpointOpts.noBrowser = true }, wantLine: true},+ {name: "SSH_CONNECTION", setup: func(t *testing.T) { t.Setenv("SSH_CONNECTION", "10.0.0.2 51234 10.0.0.1 22") }, wantLine: true},+ {name: "SSH_TTY", setup: func(t *testing.T) { t.Setenv("SSH_TTY", "/dev/ttys004") }, wantLine: true},+ {name: "no display", setup: func(*testing.T) {+ onboardingDisplayCheck = func() error { return errors.New("DISPLAY and WAYLAND_DISPLAY are not set") }+ }, wantLine: true},+ } {+ t.Run(tc.name, func(t *testing.T) {+ h := newOnboardingHarness(t)+ opened := stubDashboardOpener(t)+ stubCloudConnect(t, 0, tc.connectErr)+ if tc.setup != nil {+ tc.setup(t)+ }+ summary := &cloudSummary{}+ summary.backfill.WriteString("Session backfill: no new agent session activity from the last 30 days.\n")+ finishCloudSetup(h.cmd, onboardingOutcome{Connect: true}, true, summary, func() error {+ return connectEndpointFor(h.cmd, true, filepath.Join(t.TempDir(), "runtime.jsonl"), true, summary)+ })+ if got := len(*opened) == 1; got != tc.wantOpen || len(*opened) > 1 {+ t.Fatalf("opened %v, want opened = %t", *opened, tc.wantOpen)+ }+ if tc.wantOpen && (*opened)[0] != "https://beacon.sh/dashboard" {+ t.Fatalf("opened %q", (*opened)[0])+ }+ text := h.stdout.String()+ if got := strings.Contains(text, "Dashboard: https://beacon.sh/dashboard (sessions appear within a minute of agent activity)"); got != tc.wantLine {+ t.Fatalf("Dashboard line shown = %t, want %t:\n%s", got, tc.wantLine, text)+ }+ // The backfill report is said either way: a failed connect still leaves that history+ // in the local log.+ if !strings.Contains(text, "Session backfill: no new agent session activity") {+ t.Fatalf("backfill report missing:\n%s", text)+ }+ if tc.connectErr != nil && !strings.Contains(h.stderr.String(), "beacon endpoint connect") {+ t.Fatalf("a failed connect must name the retry: %q", h.stderr)+ }+ })+ }+}++// A browser that fails to open is no reason to say anything: the URL is already on screen.+func TestWizardDashboardOpenFailureIsSilent(t *testing.T) {+ h := newOnboardingHarness(t)+ stubDashboardOpener(t)+ onboardingOpenDashboard = func(string) error { return errors.New("no browser") }+ stubCloudConnect(t, 3, nil)+ summary := &cloudSummary{}+ finishCloudSetup(h.cmd, onboardingOutcome{Connect: true}, true, summary, func() error {+ return connectEndpointFor(h.cmd, true, filepath.Join(t.TempDir(), "runtime.jsonl"), true, summary)+ })+ if h.stderr.Len() != 0 {+ t.Fatalf("stderr: %s", h.stderr)+ }+ if !strings.Contains(h.stdout.String(), "Dashboard: https://beacon.sh/dashboard (your recent sessions appear within a few minutes)") {+ t.Fatalf("stdout:\n%s", h.stdout)+ }+}++// `beacon endpoint connect`, and `install --connect` without the wizard, keep the full report and+// open nothing.+func TestExplicitConnectKeepsTheFullReport(t *testing.T) {+ h := newOnboardingHarness(t)+ opened := stubDashboardOpener(t)+ captured := stubCloudConnect(t, 0, nil)+ finishCloudSetup(h.cmd, onboardingOutcome{}, true, nil, func() error {+ return connectEndpoint(h.cmd, true, filepath.Join(t.TempDir(), "runtime.jsonl"), true)+ })+ if captured.Quiet {+ t.Fatal("an explicit connect was asked to be quiet")+ }+ if len(*opened) != 0 {+ t.Fatalf("opened %v", *opened)+ }+ for _, want := range []string{"Connected to Beacon Cloud as device dev_7f3a", "Managed privacy: Standard", "Next: run any supported agent"} {+ if !strings.Contains(h.stdout.String(), want) {+ t.Fatalf("missing %q:\n%s", want, h.stdout)+ }+ }+ if strings.Contains(h.stdout.String(), "Dashboard: ") {+ t.Fatalf("the explicit connect gained the wizard's closing:\n%s", h.stdout)+ }+}++func TestCancelledWizardSaysNothingWasInstalled(t *testing.T) {+ calls := recordEndpointLifecycle(t)+ h := newOnboardingHarness(t)+ endpointOpts.harnesses = ""+ h.askErr = onboarding.ErrWizardCancelled+ err := runEndpointInstall(h.cmd, nil)+ want := "setup cancelled; nothing was installed. Run `beacon endpoint install` again when you are ready, or set BEACON_ONBOARDING=0 to install without the guided setup"+ if err == nil || err.Error() != want {+ t.Fatalf("error = %v, want %q", err, want)+ }+ if len(*calls) != 0 {+ t.Fatalf("a cancelled wizard still installed: %+v", *calls)+ }+}++func TestConnectedSummaryLine(t *testing.T) {+ for _, tc := range []struct {+ enrollment asymptote.Enrollment+ signedInAs string+ want string+ }{+ {asymptote.Enrollment{DeviceID: "dev_1", Email: "[email protected]", PrivacyMode: "metadata_only"}, "[email protected]",+ "Beacon is installed and connected to Beacon Cloud as [email protected] (device dev_1, Metadata only privacy)."},+ {asymptote.Enrollment{DeviceID: "dev_1"}, "[email protected]",+ "Beacon is installed and connected to Beacon Cloud as [email protected] (device dev_1, Standard privacy)."},+ {asymptote.Enrollment{DeviceID: "dev_1", OrganizationName: "Acme"}, "",+ "Beacon is installed and connected to Beacon Cloud as Acme (device dev_1, Standard privacy)."},+ {asymptote.Enrollment{DeviceID: "dev_1"}, "",+ "Beacon is installed and connected to Beacon Cloud (device dev_1, Standard privacy)."},+ } {+ if got := connectedSummaryLine(tc.enrollment, tc.signedInAs); got != tc.want {+ t.Errorf("connectedSummaryLine(%+v, %q) = %q, want %q", tc.enrollment, tc.signedInAs, got, tc.want)+ }+ }+}++// The wizard's MCP line: where it was added and the one thing left to do. A harness that takes the+// server only by hand gets a pointer to the steps instead of the steps.+func TestBriefCloudMCPSaysItInOneLine(t *testing.T) {+ fx := newMCPFixture(t, "claude_code", "cursor", "copilot_cli")+ mcpIngestURL = func() string { return strings.TrimSuffix(fx.url, "/mcp") }+ var out strings.Builder+ if err := connectCloudMCP(context.Background(), &out, cloudMCPRequest{yes: true, brief: true}); err != nil {+ t.Fatal(err)+ }+ want := "Beacon Cloud MCP added to Claude Code, Cursor; sign in to beacon-managed once in each app (Claude Code: /mcp in a new session).\n" ++ "To use Beacon Cloud MCP in GitHub Copilot CLI, add it by hand: `beacon mcp connect --dry-run` prints the steps.\n"+ if out.String() != want {+ t.Fatalf("brief output:\n%s\nwant:\n%s", out.String(), want)+ }++ out.Reset()+ if err := connectCloudMCP(context.Background(), &out, cloudMCPRequest{yes: true, brief: true, harnesses: []string{"cursor"}}); err != nil {+ t.Fatal(err)+ }+ if got := out.String(); got != "Beacon Cloud MCP is already set up in Cursor; sign in to beacon-managed once in each app.\n" {+ t.Fatalf("second run: %q", got)+ }+}++func TestPrintMCPSummaryWithNothingToAdd(t *testing.T) {+ var out strings.Builder+ printMCPSummary(&out, nil, mcpconnect.Options{})+ if got := out.String(); !strings.Contains(got, "not added to any app") || !strings.Contains(got, "beacon mcp connect") {+ t.Fatalf("output = %q", got)+ }+}diff --git a/cli/beacon/cmd/endpoint_onboarding.go b/cli/beacon/cmd/endpoint_onboarding.goindex 4e931a06..08fdd223 100644--- a/cli/beacon/cmd/endpoint_onboarding.go+++ b/cli/beacon/cmd/endpoint_onboarding.go@@ -112,6 +112,14 @@ type onboardingOutcome struct {InstallSkills bool}+// briefClose reports whether the install closes on the wizard's short summary (cloudSummary)+// rather than its full report: the person confirmed Beacon Cloud in the wizard, and this install+// connects the endpoint. Every other path, `install --connect` without the wizard included, keeps+// the full output.+func (o onboardingOutcome) briefClose() bool {+ return o.Connect+}+// maybeRunOnboarding runs the one-time account and destination wizard when this// install is interactive.//diff --git a/cli/beacon/cmd/endpoint_test.go b/cli/beacon/cmd/endpoint_test.goindex c63f50ad..e82b1749 100644--- a/cli/beacon/cmd/endpoint_test.go+++ b/cli/beacon/cmd/endpoint_test.go@@ -2508,8 +2508,11 @@ func TestEndpointInstallHookFailureIsAWarningAndOtherHooksStillInstall(t *testint.Fatal(err)}- var out bytes.Buffer- installHookTargetsFromEndpointInstall(&out, []string{"claude", "codex"})+ var report, out bytes.Buffer+ installHookTargetsFromEndpointInstall(&report, &out, []string{"claude", "codex"})+ if !strings.Contains(report.String(), "Codex CLI endpoint hooks installed:") || strings.Contains(report.String(), "Warning:") {+ t.Fatalf("report = %q, want the Codex hooks written and no warnings", report.String())+ }if !strings.Contains(out.String(), "Warning: claude hooks were not installed") {t.Fatalf("expected a claude warning, got:\n%s", out.String())diff --git a/cli/beacon/cmd/history_env_test.go b/cli/beacon/cmd/history_env_test.goindex 899cdbcf..b1e11df0 100644--- a/cli/beacon/cmd/history_env_test.go+++ b/cli/beacon/cmd/history_env_test.go@@ -21,6 +21,9 @@ func TestMain(m *testing.M) {}_ = os.Setenv(endpointconfig.HistoryStoreEnv, filepath.Join(dir, "absent", "history.db"))_ = os.Setenv(endpointBackfillEnv, "0")+ // A wizard install under test that reaches the end of a Beacon Cloud connect must not open+ // the developer's browser; tests that check the opening stub this themselves.+ onboardingOpenDashboard = func(string) error { return nil }code := m.Run()_ = os.RemoveAll(dir)os.Exit(code)diff --git a/cli/beacon/cmd/mcp_connect.go b/cli/beacon/cmd/mcp_connect.goindex 5753dd31..a4f442fb 100644--- a/cli/beacon/cmd/mcp_connect.go+++ b/cli/beacon/cmd/mcp_connect.go@@ -224,6 +224,9 @@ type cloudMCPRequest struct {dryRun boolyes boolforce bool+ // brief says the outcome in one line instead of the plan and per-harness steps, for the+ // onboarding wizard's short closing. Failures are still printed one per harness.+ brief bool}// connectRefusal is why connect will not run here, or "" when it may.@@ -280,6 +283,10 @@ func connectCloudMCP(ctx context.Context, out io.Writer, req cloudMCPRequest) erurl, checked = canonical, "checked"}if len(targets) == 0 {+ if req.brief {+ fmt.Fprintln(out, "Beacon Cloud MCP was not added: no app it supports was detected. Run `beacon mcp connect --harness <name>` to add one.")+ return nil+ }fmt.Fprintln(out, "No harness Beacon can connect was detected. Pass --harness to name one.")printUnsupported(out, unsupported)return nil@@ -290,17 +297,19 @@ func connectCloudMCP(ctx context.Context, out io.Writer, req cloudMCPRequest) erreturn err}- fmt.Fprintf(out, "Beacon Cloud MCP: %s (%s)\n", url, checked)- fmt.Fprintf(out, "Server name: %s\n", mcpconnect.ServerName)- if opts.TokenEnv != "" {- fmt.Fprintf(out, "Auth: a personal MCP token read from $%s; Beacon writes only the variable's name\n", opts.TokenEnv)- } else {- fmt.Fprintln(out, "Auth: OAuth; Beacon writes only the URL, and each harness signs in on first use")+ if !req.brief {+ fmt.Fprintf(out, "Beacon Cloud MCP: %s (%s)\n", url, checked)+ fmt.Fprintf(out, "Server name: %s\n", mcpconnect.ServerName)+ if opts.TokenEnv != "" {+ fmt.Fprintf(out, "Auth: a personal MCP token read from $%s; Beacon writes only the variable's name\n", opts.TokenEnv)+ } else {+ fmt.Fprintln(out, "Auth: OAuth; Beacon writes only the URL, and each harness signs in on first use")+ }+ fmt.Fprintln(out)+ printPlan(out, home, plan)+ printManual(out, plan, opts)+ printUnsupported(out, unsupported)}- fmt.Fprintln(out)- printPlan(out, home, plan)- printManual(out, plan, opts)- printUnsupported(out, unsupported)writes := 0for _, it := range plan {@@ -313,6 +322,10 @@ func connectCloudMCP(ctx context.Context, out io.Writer, req cloudMCPRequest) erreturn nil}if writes == 0 {+ if req.brief {+ printMCPSummary(out, plan, opts)+ return nil+ }fmt.Fprintln(out, "\nNothing to change.")printNextSteps(out, plan, opts)return nil@@ -328,7 +341,9 @@ func connectCloudMCP(ctx context.Context, out io.Writer, req cloudMCPRequest) erif err != nil {return err}- fmt.Fprintln(out)+ if !req.brief {+ fmt.Fprintln(out)+ }var failed []stringfor _, it := range applied {if !it.Writes() {@@ -339,9 +354,15 @@ func connectCloudMCP(ctx context.Context, out io.Writer, req cloudMCPRequest) erfmt.Fprintf(out, "✗ %s: %v\n", it.Target.DisplayName, it.Err)continue}- fmt.Fprintf(out, "✓ %s: %s %s\n", it.Target.DisplayName, pastTense(it.Action), displayPath(home, it.Path))+ if !req.brief {+ fmt.Fprintf(out, "✓ %s: %s %s\n", it.Target.DisplayName, pastTense(it.Action), displayPath(home, it.Path))+ }+ }+ if req.brief {+ printMCPSummary(out, applied, opts)+ } else {+ printNextSteps(out, applied, opts)}- printNextSteps(out, applied, opts)if len(failed) > 0 {return fmt.Errorf("could not connect %s", strings.Join(failed, ", "))}@@ -451,6 +472,57 @@ func printNextSteps(out io.Writer, items []mcpconnect.Item, opts mcpconnect.Opti}}+// printMCPSummary says where Beacon Cloud MCP is set up and what is left to do, in one line, for+// the onboarding wizard's short closing. A detected harness that takes the server only by hand gets+// a second line naming the command that prints its steps. `beacon mcp connect` prints the plan and+// every harness's own sign-in step.+func printMCPSummary(out io.Writer, items []mcpconnect.Item, opts mcpconnect.Options) {+ var added, present, manual []string+ claudeCode := false+ for _, it := range items {+ switch {+ case it.Err != nil:+ continue+ case it.Writes():+ added = append(added, it.Target.DisplayName)+ case it.Action == mcpconnect.ActionPresent:+ present = append(present, it.Target.DisplayName)+ case it.Action == mcpconnect.ActionManual:+ manual = append(manual, it.Target.DisplayName)+ continue+ default:+ continue+ }+ if it.Target.Name == "claude_code" {+ claudeCode = true+ }+ }+ var line string+ switch {+ case len(added) > 0:+ line = "Beacon Cloud MCP added to " + strings.Join(added, ", ")+ if len(present) > 0 {+ line += " (already in " + strings.Join(present, ", ") + ")"+ }+ case len(present) > 0:+ line = "Beacon Cloud MCP is already set up in " + strings.Join(present, ", ")+ }+ switch {+ case line == "" && len(manual) == 0:+ fmt.Fprintln(out, "Beacon Cloud MCP was not added to any app; run `beacon mcp connect` to see why.")+ case line == "":+ case opts.TokenEnv != "":+ fmt.Fprintf(out, "%s; each reads a personal MCP token from $%s.\n", line, opts.TokenEnv)+ case claudeCode:+ fmt.Fprintf(out, "%s; sign in to %s once in each app (Claude Code: /mcp in a new session).\n", line, mcpconnect.ServerName)+ default:+ fmt.Fprintf(out, "%s; sign in to %s once in each app.\n", line, mcpconnect.ServerName)+ }+ if len(manual) > 0 {+ fmt.Fprintf(out, "To use Beacon Cloud MCP in %s, add it by hand: `beacon mcp connect --dry-run` prints the steps.\n", strings.Join(manual, ", "))+ }+}+func runMCPDisconnect(cmd *cobra.Command, args []string) error {out := cmd.OutOrStdout()home, err := mcpHome()diff --git a/cli/beacon/internal/endpoint/asymptote/connect.go b/cli/beacon/internal/endpoint/asymptote/connect.goindex e2cf7dcc..2cd58253 100644--- a/cli/beacon/internal/endpoint/asymptote/connect.go+++ b/cli/beacon/internal/endpoint/asymptote/connect.go@@ -54,6 +54,9 @@ type ConnectOptions struct {// nothing recorded before the connection point.Backfill *ConnectBackfillOut io.Writer+ // Quiet leaves the progress lines (which Vector was found, that the account authorized the+ // device) out of Out and keeps the warnings, for a caller that closes on a summary of its own.+ Quiet bool// Now is injectable for tests.Now func() time.Time}@@ -101,6 +104,10 @@ func Connect(ctx context.Context, opts ConnectOptions) (_ *ConnectResult, err erif out == nil {out = io.Discard}+ progress := out+ if opts.Quiet {+ progress = io.Discard+ }now := opts.Nowif now == nil {now = time.Now@@ -141,7 +148,7 @@ func Connect(ctx context.Context, opts ConnectOptions) (_ *ConnectResult, err erif err != nil {return nil, err}- fmt.Fprintf(out, "Using Vector %s at %s\n", vector.Version, vector.Path)+ fmt.Fprintf(progress, "Using Vector %s at %s\n", vector.Version, vector.Path)previous, err := LoadEnrollment(opts.UserMode)if err != nil && !errors.Is(err, ErrNotEnrolled) {@@ -230,9 +237,9 @@ func Connect(ctx context.Context, opts ConnectOptions) (_ *ConnectResult, err erreturn nil, fmt.Errorf("could not record that connect is in progress: %w", err)}if opts.AccountEnroll != nil {- fmt.Fprintf(out, "Account authorized device enrollment for %s (device %s, key %s)\n", displayOrg(result), result.DeviceID, result.KeyPrefix)+ fmt.Fprintf(progress, "Account authorized device enrollment for %s (device %s, key %s)\n", displayOrg(result), result.DeviceID, result.KeyPrefix)} else {- fmt.Fprintf(out, "Approved for %s (device %s, key %s)\n", displayOrg(result), result.DeviceID, result.KeyPrefix)+ fmt.Fprintf(progress, "Approved for %s (device %s, key %s)\n", displayOrg(result), result.DeviceID, result.KeyPrefix)}// Secrets first, then the config that references them, then the unit that runs it.diff --git a/cli/beacon/internal/endpoint/asymptote/connect_test.go b/cli/beacon/internal/endpoint/asymptote/connect_test.goindex 1157f768..d0194268 100644--- a/cli/beacon/internal/endpoint/asymptote/connect_test.go+++ b/cli/beacon/internal/endpoint/asymptote/connect_test.go@@ -253,6 +253,40 @@ func TestConnectUsesAccountEnrollmentWithoutOpeningBrowser(t *testing.T) {}}+// The onboarding wizard closes on a summary of its own, so it asks Connect for its warnings only.+func TestConnectQuietLeavesOutTheProgressLines(t *testing.T) {+ for _, quiet := range []bool{false, true} {+ testenv.SetHome(t, t.TempDir())+ isolateVectorDiscovery(t)+ accountServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ _ = json.NewEncoder(w).Encode(map[string]any{+ "device_id": "dev-account",+ "device_key": "bcn_device_abcdefgh_" + strings.Repeat("k", 43),+ "key_prefix": "bcn_device_abcdefgh",+ "ingest_url": "https://ingest.example.test",+ "organization_id": "org-1",+ "scopes": []string{"ingest:write"},+ })+ }))+ fd := newFakeDashboard(t)+ opts := connectOptions(t, fd, &fakeForwarder{supported: true}, fakeVector(t, "0.56.0", 0))+ opts.AccountEnroll = &AccountEnrollOptions{BaseURL: accountServer.URL, AccessToken: "bcn_cli_account_token", HTTPClient: accountServer.Client()}+ var out strings.Builder+ opts.Out = &out+ opts.Quiet = quiet+ _, err := Connect(context.Background(), opts)+ accountServer.Close()+ if err != nil {+ t.Fatal(err)+ }+ for _, line := range []string{"Using Vector 0.56.0", "Account authorized device enrollment"} {+ if strings.Contains(out.String(), line) == quiet {+ t.Fatalf("quiet=%t: output %q, line %q", quiet, out.String(), line)+ }+ }+ }+}+func TestConnectStopsBeforeTheBrowserWhenVectorIsMissingOrOld(t *testing.T) {home := t.TempDir()testenv.SetHome(t, home)diff --git a/cli/beacon/internal/onboarding/wizard.go b/cli/beacon/internal/onboarding/wizard.goindex c176b259..2f5f5829 100644--- a/cli/beacon/internal/onboarding/wizard.go+++ b/cli/beacon/internal/onboarding/wizard.go@@ -16,6 +16,9 @@ import (var ErrWizardCancelled = errors.New("onboarding cancelled")+// signInBrowserHint follows the sign-in URL once a browser has been opened for it.+const signInBrowserHint = "Open it in the browser where you are signed in to beacon.sh. If a different browser opened, copy the URL there."+// Account is what a completed sign-in tells the wizard.//// It carries no token. This package draws a terminal and holds no credential, and@@ -632,6 +635,11 @@ func (m wizardModel) View() string {body = "Open this URL to sign in:"}raw = m.prompt.URL+ if m.prompt.URL != "" && m.prompt.WillOpen && m.prompt.BrowserErr == nil {+ // The default browser is not always the one signed in to beacon.sh. Copying+ // the URL to the one that is saves signing in a second time.+ raw += "\n\n" + wizardDim.Width(contentWidth).Render(signInBrowserHint)+ }if m.prompt.URL != "" && m.prompt.SSHForward != "" && (!m.prompt.WillOpen || m.prompt.BrowserErr != nil) {raw += "\n\n" + wizardDim.Render("From another computer over SSH, forward the port first:") +"\n" + m.prompt.SSHForwarddiff --git a/cli/beacon/internal/onboarding/wizard_test.go b/cli/beacon/internal/onboarding/wizard_test.goindex 3abceb3d..2ba43ef0 100644--- a/cli/beacon/internal/onboarding/wizard_test.go+++ b/cli/beacon/internal/onboarding/wizard_test.go@@ -448,6 +448,38 @@ func TestSignInWaitShowsAnUnwrappedURLAndAClock(t *testing.T) {}}+// The browser that opens is the default one, which is not always the one signed in to+// beacon.sh. Once a browser has been opened, the wait says where the URL belongs; when none+// was, there is no other browser to warn about.+func TestSignInWaitSaysWhichBrowserTheURLBelongsIn(t *testing.T) {+ url := "https://beacon.sh/cli/auth?port=54123&state=abc"+ for _, tc := range []struct {+ name string+ prompt SignInPrompt+ want bool+ }{+ {"browser opened", SignInPrompt{URL: url, WillOpen: true}, true},+ {"browser failed", SignInPrompt{URL: url, WillOpen: true, BrowserErr: errors.New("no xdg-open")}, false},+ {"no browser", SignInPrompt{URL: url}, false},+ } {+ model := signInWizard(t, neverReturns)+ model.screen = signInScreen+ model, _ = advanceWizard(t, model, "enter")+ next, _ := model.Update(signInPromptMsg{attempt: 1, prompt: tc.prompt})+ model = next.(wizardModel)+ model.stopSignIn()++ flat := strings.Join(strings.Fields(model.View()), " ")+ got := strings.Contains(flat, "Open it in the browser where you are signed in to beacon.sh. If a different browser opened, copy the URL there.")+ if got != tc.want {+ t.Fatalf("%s: hint shown = %t, want %t:\n%s", tc.name, got, tc.want, model.View())+ }+ if !strings.Contains(model.View(), url) {+ t.Fatalf("%s: the URL must stay on one unbroken line:\n%s", tc.name, model.View())+ }+ }+}+// Abandoning the browser must not end the install. It used to: the wait was// uncancellable, so ctrl+c during it killed the whole command.func TestEscDuringSignInGoesBackWithoutEndingTheInstall(t *testing.T) {diff --git a/docs/changelog/cli.mdx b/docs/changelog/cli.mdxindex 9c2c4350..650d3c3d 100644--- a/docs/changelog/cli.mdx+++ b/docs/changelog/cli.mdx@@ -11,6 +11,7 @@ Stay up to date with the latest changes to the Agent Beacon CLI.## October 2026+- **Setup ends at the dashboard** · Confirming Beacon Cloud in the `beacon endpoint install` wizard used to end on some forty lines of file paths, connect details, an MCP table and per-runtime steps, and nothing pointed to the hosted dashboard. It now ends on four lines: the account, device and privacy mode; the session backfill; the dashboard URL; and where Beacon Cloud MCP was added. Beacon then opens the dashboard in your browser, except with `--no-browser`, over SSH, or on Linux without a display. The sign-in wait screen now also asks you to open the URL in the browser where you are signed in to beacon.sh, and cancelling the wizard says that nothing was installed and how to start again. `beacon endpoint connect` and `beacon mcp connect` print the same output as before. See [Onboarding](/cli/endpoint-onboarding#when-setup-finishes).- **Self-update installs only Beacon-signed packages, over https** · The macOS self-updater took the Apple team a package must be signed by from `update-manifest.json`, which is unsigned, matched it as a substring of the signature output, and skipped the check when the manifest named no team. Whoever could rewrite the manifest could have any notarized package installed as root. The team is now built into `beacon` (Asymptote Labs, `3A98D35XJR`) and must match the package's installer signer exactly, for self-update and the enterprise edition install alike. The manifest and the package must also be fetched over `https`, plain `http` only to a loopback mirror and never through a redirect, so a `managed.json` that names an `http://` update URL on another host stops updating until it is changed to `https`.- **The Jamf hook repair script no longer hands the console user root** · `jamf/claude/common/repair-hooks.sh` runs as root. It granted the console user permission to add and delete entries in `/var/log/beacon-agent`, which let them replace the runtime log with a link that the root collector then opened, and it ran `chown -R` on `~/.beacon` as root, which a planted hard link turned into ownership of a root-run binary. The directory grant is gone, and the script now removes every grant that adds or deletes entries there, including ones earlier runs gave a previous console user and the one the Jamf guide's snippet used to add. It creates and fixes up `~/.beacon` as the user, refuses a symlinked directory, and moves aside one the user does not own. The Jamf guide explains how to remove the old grant by hand.- **The scheduled inventory job follows every moved runtime directory** · The job starts without your shell's environment, so a per-user install or repair records the variables that move a runtime's user directory into it. It recorded `CODEX_HOME`, `HERMES_HOME`, `CLINE_DIR`, `GEMINI_CLI_HOME` and `CLAUDE_CONFIG_DIR`, and now also `KIRO_HOME`, `KIMI_CODE_HOME`, `DSH_HOME`, `OH_PERSISTENCE_DIR`, `OPENCLAW_STATE_DIR`, `XDG_CONFIG_HOME` (Muse, and VS Code on Linux), `PI_CODING_AGENT_DIR`, `OMO_CODING_AGENT_DIR`, `SENPI_CODING_AGENT_DIR`, `PRIME_AGENT_CODING_AGENT_DIR`, and Oh My Pi's `PI_CONFIG_DIR`, `OMP_PROFILE` and `PI_PROFILE`. With one of these set only in your shell, the job used to inventory the default directory while the runtime read the moved one. See [Inventory heartbeats](/cli/endpoint-inventory#inventory-heartbeats).diff --git a/docs/cli/endpoint-install.mdx b/docs/cli/endpoint-install.mdxindex a912b72c..f74e249d 100644--- a/docs/cli/endpoint-install.mdx+++ b/docs/cli/endpoint-install.mdx@@ -32,7 +32,7 @@ The `claude` harness writes both Claude Code's OpenTelemetry settings and its us| `--health-port <port>` | Local collector health-check port. Defaults to `13133`, moved by the same amount as `--otlp-http-port` when that is changed (HTTP port `4328` gives `13143`), so a second collector on alternate OTLP ports does not collide with the first || `--collector <path>` | Path to a `beacon-otelcol` binary || `--no-start` | Write files without starting the collector service |-| `--no-browser` | During interactive setup, print the sign-in URL instead of opening a browser. Useful where no browser can be opened. Open the URL on this machine, or on another computer after forwarding the port it names over SSH |+| `--no-browser` | During interactive setup, print the sign-in URL instead of opening a browser, and do not open the hosted dashboard when setup finishes. Useful where no browser can be opened. Open the URL on this machine, or on another computer after forwarding the port it names over SSH || `--service <kind>` | Service manager to use: `auto` (default), `launchd`, `systemd`, or `none` for a supervised collector process || `--dry-run` | Print planned actions without changing endpoint files or services || `--include-runtime-metrics` | Include generic process, runtime, and harness operational OTLP metrics in Beacon JSONL. By default, low-signal metrics such as process CPU, memory, Node.js event loop, V8 heap, GitHub Copilot CLI, and OpenClaw operational metrics are filtered out |@@ -98,7 +98,7 @@ signs in through beacon.sh, then asks where this machine's telemetry should go:| Answer | What happens ||--------|--------------|-| Beacon Cloud (default) | Shows what will be sent, asks for Standard or Metadata-only capture, then installs Beacon and connects this endpoint. The confirm screen names the signed-in account and states that forwarding starts, then names the operator, the destination, and the capture mode, and says how to turn off research and AI training, change the mode, stop sending, or delete the data. It also says that the last 30 days of agent sessions are uploaded, before you accept. An endpoint that is already enrolled keeps its device key and is not re-enrolled. |+| Beacon Cloud (default) | Shows what will be sent, asks for Standard or Metadata-only capture, then installs Beacon and connects this endpoint. The confirm screen names the signed-in account and states that forwarding starts, then names the operator, the destination, and the capture mode, and says how to turn off research and AI training, change the mode, stop sending, or delete the data. It also says that the last 30 days of agent sessions are uploaded, before you accept. Once connected, the install ends on a [short summary](/cli/endpoint-onboarding#when-setup-finishes) and opens the hosted dashboard. An endpoint that is already enrolled keeps its device key and is not re-enrolled. || Local only | Explicitly opts out of managed forwarding. Nothing is sent anywhere; the session backfill stays in the local log. |`--connect` presets Beacon Cloud and skips the destination question. Whetherdiff --git a/docs/cli/endpoint-onboarding.mdx b/docs/cli/endpoint-onboarding.mdxindex 7f183a70..a592597e 100644--- a/docs/cli/endpoint-onboarding.mdx+++ b/docs/cli/endpoint-onboarding.mdx@@ -34,13 +34,17 @@ The first interactive `beacon endpoint install` opens a full-screen terminal wiz5. Review the destination, privacy mode and agent tools, then confirm installation.Move between choices with the arrow keys, continue with <kbd>enter</kbd>, and cancel-with <kbd>esc</kbd>.+with <kbd>esc</kbd>. Cancelling ends the install before anything is written, and the+error says so: run `beacon endpoint install` again when you are ready, or set+`BEACON_ONBOARDING=0` to install without the guided setup.Signing in happens inside the wizard. The full-screen view stays up while yourbrowser is open, showing the sign-in URL, a spinner, and how long is left before theattempt times out. The URL is printed before any browser is opened, so it is usableeven when none can be, and <kbd>esc</kbd> during the wait returns to the sign-in-screen rather than ending the install.+screen rather than ending the install. Once a browser has opened, the screen also asks+you to open the URL in the browser where you are signed in to beacon.sh, and to copy it+there if a different browser opened.If sign-in cannot finish -- an offline machine, no browser, or the wait expiring --the wizard offers to try again, to show the URL for you to open yourself, or to@@ -107,11 +111,12 @@ the beginning of `inventory_state.jsonl` so the hosted dashboard receives theendpoint's current inventory baseline.The managed destination is recorded only once enrollment succeeds. If it fails, the-local install still succeeds and prints `beacon endpoint connect` as the retry-command, and the next `beacon endpoint install` offers the question again rather than-treating the machine as settled. Verify forwarding with `beacon endpoint status---json`. The onboarding record itself is written only after the install succeeds, so-a failed install leaves nothing behind and asks again next time.+local install still succeeds, says that the machine is not connected yet, and prints+`beacon endpoint connect` as the retry command, and the next `beacon endpoint install`+offers the question again rather than treating the machine as settled. Verify+forwarding with `beacon endpoint status --json`. The onboarding record itself is+written only after the install succeeds, so a failed install leaves nothing behind and+asks again next time.## Agent tools@@ -155,6 +160,41 @@ deployments, `--system` installs, CI, `--dry-run`, `TERM=dumb`, and any piped orredirected stdin skip it silently, including a redirect to `/dev/null`. These pathsremain account-free.+## When setup finishes++When you confirm Beacon Cloud, the install says `Installing Beacon and connecting to+Beacon Cloud...` while it works, then ends on a short summary rather than the list of+files it wrote:++```text title="End of a Beacon Cloud setup"+Beacon is installed and connected to Beacon Cloud as [email protected] (device dev_7f3a, Standard privacy).+Session backfill: 8 events from the last 30 days (Claude Code 6, Codex 2).+ Claude Code: stopped at the backfill size limit; `beacon endpoint claude sync` reads the rest.+Dashboard: https://beacon.sh/dashboard (your recent sessions appear within a few minutes)+Beacon Cloud MCP added to Claude Code, Cursor, VS Code; sign in to beacon-managed once in each app (Claude Code: /mcp in a new session).+```++In order, the lines give:++1. The account, device and privacy mode this machine forwards with.+2. What the [session backfill](/cli/endpoint-install#session-backfill) read, with the+ sync command for any runtime that had more history than the backfill takes.+3. The hosted dashboard. Sessions from the backfill take a few minutes to appear there;+ new sessions appear within a minute of agent activity.+4. Where Beacon Cloud MCP was added and what is left to do in each app. A harness that+ takes it only by hand is named on a line of its own, and+ `beacon mcp connect --dry-run` prints its steps. If you turned Beacon Cloud MCP off,+ this line says to run `beacon mcp connect` instead.++Beacon then opens the dashboard in your default browser, except with `--no-browser`,+in an SSH session, or on Linux without a display. The URL is printed either way.++A runtime that needs a restart or a trust prompt before it collects still says so above+the summary, and warnings still go to stderr. Run `beacon endpoint status` for the+paths and service state the summary leaves out. Choosing Local, setup on an endpoint+that was already connected, `beacon endpoint connect`, `beacon mcp connect`, and+installs that skip the wizard keep their full output.+## Flags| Flag | Description |diff --git a/docs/get-started/quickstart.mdx b/docs/get-started/quickstart.mdxindex 314a2dd0..399ef85f 100644--- a/docs/get-started/quickstart.mdx+++ b/docs/get-started/quickstart.mdx@@ -89,7 +89,9 @@ For the local dashboard:beacon endpoint dashboard --open```-If you're using Beacon Cloud, your sessions will also appear in the hosted dashboard.+If you're using Beacon Cloud, your sessions will also appear in the hosted dashboard,+which the install opens when setup finishes, at+[beacon.sh/dashboard](https://beacon.sh/dashboard).## Check your setup