Skip to content

Installer: auto-add ~/.local/bin to PATH (instead of aborting) [Tier 2]#199

Draft
mario4tier wants to merge 1 commit into
devfrom
feat/installer-path-autofix
Draft

Installer: auto-add ~/.local/bin to PATH (instead of aborting) [Tier 2]#199
mario4tier wants to merge 1 commit into
devfrom
feat/installer-path-autofix

Conversation

@mario4tier

Copy link
Copy Markdown
Member

Status: DRAFT — task spec for an agent to implement. Not yet implemented.

What

Make ~/suibase/install fix the PATH for the user automatically (rustup / pipx ensurepath style) when ~/.local/bin is not on PATH, instead of aborting with a bare, no-command message. This branch currently contains only the self-contained spec: docs/dev/INSTALLER_PATH_AUTOFIX_PLAN.md. An agent picks up this branch, implements the change in install, adds a test, and pushes here.

Why

A first-time user (especially on macOS, where ~/.local/bin is not on PATH by default and ~/.profile is not read by zsh) currently hits install printing "Please add ~/.local/bin to your $PATH" with no command and then exit 1. The docs only link to a generic StackOverflow page. Popular tools (rustup, pipx ensurepath, Homebrew, deno/bun/uv) either auto-edit the profile or print an exact copy-paste command — never a generic link.

Where (already scoped in the spec)

  • installsetup_local_bin_as_needed() (creates dir, early-returns if on PATH, tries sourcing ~/.profile, else prints the bare message and exit 1). It already has a commented-out macOS auto-append stub — replace it with a tested implementation.
  • Reuse the existing EXIT_TERMINAL_INSTRUCTION global and is_local_bin_on_path() / echo_info helpers.

Acceptance criteria

  • ~/.local/bin not on PATH → install appends export PATH="$HOME/.local/bin:$PATH" to the correct profile (zsh→~/.zshrc, bash→~/.bashrc / macOS ~/.bash_profile), idempotently, tells the user to restart their shell, and continues (no abort).
  • Re-running never duplicates the line; on-PATH and ~/.profile-fix paths unchanged; quiet mode stays quiet.
  • A hermetic test in scripts/tests/ (temp HOME) covers append + idempotency + non-abort.
  • Docs follow-up: soften the manual snippet in docs/src/how-to/install.md to a fallback once auto-fix lands.

Full design, edge cases, testing matrix, and references are in the plan doc on this branch.

🤖 Generated with Claude Code

Self-contained implementation spec so an agent can pick this up: make
`~/suibase/install` auto-append `~/.local/bin` to the user's shell profile
(rustup / `pipx ensurepath` style) instead of aborting with a no-command
message when it is not on PATH.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

1 participant