fix(cli): explain how to configure the installer PATH

This commit is contained in:
yiling
2026-11-13 21:11:18 +08:00
parent 83e902862c
commit 2be1093b91
3 changed files with 13 additions and 2 deletions
+2
View File
@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Changed
- **cli**: Show copyable commands and shell configuration instructions when the standalone CLI installation directory is missing from PATH.
## [0.6.6] - 2026-11-13
### Added
+3 -1
View File
@@ -32,12 +32,14 @@ powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://github.com/s
Native builds use Bun 1.4.4's runtime; x64 CPUs need SSE4.2. See [Bun's system requirements](https://bun.com/docs/installation). Alpine/musl is not included in these native downloads. Native downloads are available for releases containing the installer assets; use npm for earlier releases.
On macOS/Linux the default directory is `~/.local/bin`. Add it to your shell's PATH if needed:
On macOS/Linux the default directory is `~/.local/bin`. If it is missing from your current PATH, the installer prints a command to run in your current Bash/Zsh terminal:
```sh
export PATH="$HOME/.local/bin:$PATH"
```
To keep the CLI available in future terminals, add the same export line to `~/.bashrc` (Bash) or `~/.zshrc` (Zsh). For Bash login shells, use your existing login profile, such as `~/.bash_profile` or `~/.profile`. Open a new terminal after saving. If you already added it, you do not need to add it again. For a custom installation directory, use the exact command printed by the installer.
On Windows the installer uses `%LOCALAPPDATA%\Shumai\bin` and updates the user PATH. Open a new terminal afterward. Administrator access is not required.
Re-run the installer to upgrade. To pin a version, roll back, or choose an installation directory, download the installer and pass its options (replace `X.Y.Z` with a release containing native binaries):
+8 -1
View File
@@ -84,7 +84,14 @@ main() {
printf 'Installed shumai-cli %s to %s\n' "$version" "$destination"
case ":${PATH:-}:" in
*":$install_dir:"*) ;;
*) printf 'Add this directory to PATH in your shell configuration: %s\n' "$install_dir" ;;
*)
escaped_install_dir=$(printf '%s' "$install_dir" | sed "s/'/'\\\\''/g")
printf '\nTo use shumai-cli in this terminal (Bash/Zsh), run:\n'
printf " export PATH='%s':\"\$PATH\"\n" "$escaped_install_dir"
printf '\nFor future terminals, add that line to ~/.bashrc (Bash) or ~/.zshrc (Zsh).\n'
printf 'For Bash login shells, use your existing login profile\n(e.g. ~/.bash_profile or ~/.profile).\n'
printf 'Open a new terminal after saving. If already configured, skip this step.\n'
;;
esac
resolved=$(command -v shumai-cli || true)
if [ -n "$resolved" ] && [ "$resolved" != "$destination" ]; then