Skip to content

Onboarding PATH step: report what it wrote, check the real PATH, and cover the user's shell #3823

Closed

Description

@malibio

Problem

The onboarding wizard's PATH step (app-lib/src/commands/onboarding.rs, src/lib/components/onboarding/onboarding-wizard.svelte) makes assumptions about how and where NodeSpace is installed:

  1. A silent no-op reported as success. configure_path appends the export to ~/.zshrc and ~/.bash_profile only when the file already exists (append_path_to_file returns Ok(false) for a missing file), ignores that result, and sets path_configured = true. On a Mac with neither file the wizard shows success and nodespace stays off PATH.
  2. It does not check reality. "Already configured" is a text search of those two files (file_contains_nodespace_path), not whether nodespace resolves. With the Homebrew cask, nodespace is already linked into /opt/homebrew/bin and the step is still offered. skill_setup::check_cli_on_path exists and answers the real question, but the step never uses it. The step is unconditional (steps.push('path')).
  3. Two files only. The installer script also writes .bashrc and .profile; detection and writing both ignore them, so a user of the installer script can get a second, duplicate export. Other shells are not covered.
  4. No restart notice. A new PATH reaches new shells only. An already-running terminal or agent session still cannot find nodespace, and the wizard does not say so.

Expected

  • The step reports what it actually wrote: which file changed, or that nothing could be written and why.
  • When no rc file exists for the user's login shell, it creates the right one for that shell (SHELL), rather than reporting success.
  • The step is offered only when nodespace does not resolve on the user's login-shell PATH; when it already does (Homebrew, the installer script), it says so and moves on.
  • Detection and writing cover the same set of files, so a second run never duplicates the line.
  • On success it says that open terminals and agent sessions need restarting.

Scope

  • configure_path, append_path_to_file, file_contains_nodespace_path, check_onboarding_status: derive state from the real PATH and report written / unchanged / failed per file
  • wizard PATH step: skip or confirm-only when the CLI already resolves; show the written files and the restart note
  • remove the PATH export on uninstall for every file it may have been written to (remove_path_from_file already exists for two)
  • tests: missing rc file, rc file present, line already present, CLI already on PATH, shell is not zsh/bash

Verify

On a user account with no ~/.zshrc: the wizard creates it, reports it, and a new terminal resolves nodespace. With the cask installed, the step does not ask to change anything. Running the step twice leaves one export line.

Activity

  1. self-assigned this
    on Oct 15, 2026
  2. added a commit that references this issue on Oct 15, 2026
    9b252ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions