#1641

fix(install): symlink into ~/.local/bin and update all existing shell profiles

Openscienidejpwants to merge intofrom

Summary

After running scripts/install.sh, strix often reports command not found in:

  1. Already-open terminal sessions, IDE terminals, and AI coding agents where ~/.local/bin is already on $PATH (via XDG / Ubuntu .profile / pipx / uv), because ~/.strix/bin is a new directory requiring a shell reload.
  2. Login and non-interactive shells (e.g., when both ~/.bashrc and ~/.profile or ~/.zshrc and ~/.zshenv exist), because setup_path() broke after the first matching config file (~/.bashrc), which exits early in non-interactive shells before reaching the appended export PATH=... line.

Changes

  • Update all existing shell config files for the active shell (e.g. both ~/.bashrc and ~/.profile, or ~/.zshrc and ~/.zshenv) instead of stopping at the first file found.
  • Symlink ~/.local/bin/strix -> ~/.strix/bin/strix on POSIX systems when ~/.local/bin exists or is already on $PATH, making strix immediately available in current terminals and non-interactive agent environments without needing to restart the shell.
  • Preserve the symlink on upgrades/re-runs by skipping symlinks in check_existing_installation() and verify_installation() whose target resolves to $INSTALL_DIR/strix.
  • Tests: Add test_installer_symlinks_local_bin_and_updates_all_existing_shell_configs in tests/test_install_script.py.

Activity

4
greptile-apps[bot]6d ago

Confidence Score: 3/5

[Medium impact] The changes affect how Strix is found after installation in users' shells.

Fix the skipped startup-file repairs and fatal optional-link errors before merging.

Findings

  1.  Login profiles remain unrepaired ▶
  2.  Optional link stops installation ▶
  3.  Personal install changes every login ▶
Fix with agent prompt
### Issue 1
scripts/install.sh:257
If an existing install already added `INSTALL_DIR` to the current shell's `PATH`, this check skips every profile update. An older install that updated only `.bashrc` therefore leaves `.bash_profile` unrepaired. Login shells without `~/.local/bin` on their path still cannot find `strix` after the rerun. Remove the current-shell `PATH` check and let `add_to_path` check each file for duplicates.

### Issue 2
scripts/install.sh:283-285
If `~/.local/bin` exists but is not writable, such as a root-owned directory or read-only mount, `ln -sf` fails under `set -e`. The installer then exits after installing the binary and skips verification and the Docker check. Treat failures from this optional directory/link setup as warnings rather than fatal errors.

### Issue 3
scripts/install.sh:254-256
If root runs the installer using `sh` or `ash` with an existing personal profile, the new loop also appends root's private install directory to `/etc/profile`. The old loop stopped at the personal file. Every user's login shell now inherits that root-specific path. Keep the all-files update limited to personal files, or retain `/etc/profile` only as an explicit fallback.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The installer now updates all existing startup files for the selected shell and adds a link in ~/.local/bin. The new test checks both changes and a repeat install.

  • Every existing shell profile gets the Strix PATH entry.
  • The installer adds Strix to an existing ~/.local/bin command path.

Reviews (1) · Last reviewed commit: "fix(install): symlink into ~/.local/bin ..." · Reviewed by Greptile

greptile-apps[bot]reviewed6d ago