Skip to content

Commit 7859805

Browse files
fidgetcodingruvnet
andcommitted
[bot:cli-maxxing] fix multi-shell + mid-script PATH bugs (2026-04-17)
Fresh-install reliability fixes surfaced on marina@Mac install where modern zsh-default macOS + just-installed brew/nvm couldn't be seen by downstream curl|bash steps in the pipeline. BUG A — mid-script PATH not re-sourced: install.sh now defines reload_path() and refreshes brew shellenv + nvm + ~/.local/bin between Step 1 and the downstream steps. Every child step + bonus + update.sh has a defensive source_runtime_path() at the top so they also work standalone. BUG B — shell mismatch on modern macOS: step-1 now writes shell integrations to BOTH .zshrc/.bashrc AND .zprofile/.bash_profile on macOS, matching Homebrew's own install pattern. SHELL_RCS + SHELL_PROFILES arrays replace the single SHELL_RC scalar. Linux behavior preserved via getent passwd detection. Files changed (14): - install.sh — reload_path() + breadcrumb mkdir + missing-step reporter - step-1/step-1-install.sh — dual-shell integration + crumb - step-2/step-2-install.sh — source_runtime_path + crumb + pipx for xlsx2csv (PEP 668) - step-3/step-3-install.sh — source_runtime_path + crumb + memory self-test probe fix - step-6/step-6-install.sh — source_runtime_path + crumb - step-8/step-8-install.sh — source_runtime_path + crumb - step-9/step-9-install.sh — source_runtime_path + crumb + claude nvm-glob fallback - step-final/step-final-install.sh — source_runtime_path + crumb + cbrain in Optional section - bonus-arc/bonus-arc.sh — source_runtime_path + crumb - bonus-ghostty/bonus-ghostty.sh — source_runtime_path + crumb - update.sh — source_runtime_path + refresh - uninstall.sh — multi-shell cleanup (all 4 rcs) - README.md — Troubleshooting section added - CHEATSHEET.md — Reset PATH recovery block Breadcrumbs land in ~/.cli-maxxing/step-N.done (+ ghostty.done, arc.done). install.sh reports which expected crumbs are missing and recommends a terminal-restart + re-run. step-6/step-8 crumbs are intentionally excluded from the top-level report (those are invoked separately by users, not direct children of install.sh). Shellcheck clean at warning+. Security audit: no must-fix findings. Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent ca5247e commit 7859805

14 files changed

Lines changed: 1485 additions & 549 deletions

File tree

CHEATSHEET.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,44 @@ These are available in your terminal after Step 3 installs the Ruflo CLI.
236236

237237
---
238238

239+
## Reset PATH (stuck install)
240+
241+
If you ran the installer, opened a fresh terminal, and `claude --version` still says "command not found" — your `~/.zshrc` is probably missing the lines that wire Homebrew, nvm, `~/.local/bin`, and the cli-maxxing aliases together. This is the exact block we used on marina@Mac to unstick her install. Paste it verbatim into your terminal — it creates `~/.zshrc` if it doesn't exist, appends the four things that need to be on PATH, then sources it and verifies `claude` works.
242+
243+
```bash
244+
cat > ~/.zshrc <<'EOF'
245+
# Homebrew (Apple Silicon default; also works on Intel via brew --prefix)
246+
if [ -x /opt/homebrew/bin/brew ]; then
247+
eval "$(/opt/homebrew/bin/brew shellenv)"
248+
elif [ -x /usr/local/bin/brew ]; then
249+
eval "$(/usr/local/bin/brew shellenv)"
250+
fi
251+
252+
# nvm (Node Version Manager)
253+
export NVM_DIR="$HOME/.nvm"
254+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
255+
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
256+
257+
# User-local binaries (cbrain, ctg, cbraintg land here)
258+
export PATH="$HOME/.local/bin:$PATH"
259+
260+
# cli-maxxing aliases
261+
alias cskip='claude --dangerously-skip-permissions'
262+
alias cc='claude'
263+
alias ccr='claude --resume'
264+
alias ccc='claude --continue'
265+
EOF
266+
267+
source ~/.zshrc
268+
claude --version
269+
```
270+
271+
**What to expect:** `claude --version` should print something like `2.1.112 (Claude Code)`. If it does, you're unstuck — close this terminal, open a fresh one, and continue from where you left off. If it still errors, the issue is upstream of PATH (Claude Code itself didn't install, or Node is broken) — paste the error into a `cskip` session and Claude can diagnose.
272+
273+
> **Using bash instead of zsh?** Swap `~/.zshrc` for `~/.bashrc` in the block above. Everything else is identical.
274+
275+
---
276+
239277
## Tips
240278

241279
- Claude remembers context within a session. If it's getting confused, use `/compact` to reset.

README.md

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,25 +203,21 @@ When Claude is running in any terminal, you can press **Shift+Tab** to switch be
203203
204204
After the script finishes, you need to activate the tools that were just installed. Do these three things in order:
205205
206-
**1. Reload your shell config** — copy and paste this, then hit Enter:
206+
**1. Close this terminal and open a new one.**
207207
208-
```bash
209-
source ~/.zshrc
210-
```
211-
212-
> On Linux or if you use bash, run `source ~/.bashrc` instead.
208+
This is the most important step. Homebrew, nvm, and the new shell aliases only load when a fresh shell starts. If you skip this, `claude` and `cskip` won't be found even though they're installed. Fully close the Terminal window (Cmd+Q on Mac works too) and open a new one.
213209
214-
**2. Close the terminal window and reopen it.**
215-
216-
**3. Verify Claude is working:**
210+
**2. Verify Claude is working**in the new terminal, run:
217211
218212
```bash
219213
claude --version
220214
```
221215
222-
If you see a version number, you're good. If not, repeat steps 1 and 2.
216+
You should see a version number like `2.1.112 (Claude Code)`. If you see that, you're good.
217+
218+
> If `claude --version` says "command not found," try `source ~/.zshrc` (or `source ~/.bashrc` if you're on Linux or still using bash). macOS uses zsh by default since Catalina, so `.zshrc` is almost always the right one. If that still doesn't work, see the [Troubleshooting](#troubleshooting) section below — specifically "I ran the installer but `claude` command is not found."
223219
224-
**4. Exit and switch to auto-approve mode:**
220+
**3. Exit and switch to auto-approve mode:**
225221
226222
Press **Ctrl+C** to exit Claude, then run `cskip` to continue with auto-approve mode (Claude runs without asking permission for each action). This is the recommended way to work through the remaining setup steps.
227223
@@ -1009,6 +1005,66 @@ Setup is complete. Head to **[You're Ready](#youre-ready)** below for your daily
10091005
10101006
[Back to top](#quick-nav)
10111007
1008+
### I ran the installer but `claude` command is not found
1009+
1010+
First install has a catch: the installer adds Homebrew, nvm, and the shell aliases to your config files, but those only load when a brand new shell starts. On top of that, the script may have been running in bash while your default shell on modern macOS is zsh — so even `source`-ing the file the script wrote can miss.
1011+
1012+
**Fix:**
1013+
1. Fully close the terminal window (Cmd+Q on Mac works too).
1014+
2. Open a fresh terminal.
1015+
3. Run `claude --version`. You should see something like `2.1.112 (Claude Code)`.
1016+
1017+
If it's still missing after a fresh terminal, paste the **Reset PATH (stuck install)** block from [CHEATSHEET.md](CHEATSHEET.md#reset-path-stuck-install) — it rewires `~/.zshrc` with Homebrew shellenv, nvm, `~/.local/bin`, and the four aliases in one shot.
1018+
1019+
### Some steps say "Homebrew not found" during install
1020+
1021+
Step 1 installs Homebrew mid-pipeline and the downstream steps in the same shell session don't see it yet — the installer hadn't refreshed PATH for subsequent commands. Known issue, fixed 2026-04-17.
1022+
1023+
**Fix:** close the terminal, open a fresh one, and re-run the installer:
1024+
```bash
1025+
bash <(curl -fsSL https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/main/install.sh)
1026+
```
1027+
It's idempotent — anything already installed gets skipped.
1028+
1029+
### I see the zsh/bash shell prompt change after install
1030+
1031+
The installer detects your default shell and writes integrations accordingly. On modern macOS, zsh is the default even if `/etc/passwd` still says bash (Terminal.app overrides passwd with the "default login shell" preference), so you may notice your prompt looks different after a fresh terminal.
1032+
1033+
**Fix:** confirm which shell you're actually in:
1034+
```bash
1035+
echo $SHELL
1036+
```
1037+
If you want your passwd entry to match what Terminal.app uses, run:
1038+
```bash
1039+
chsh -s /bin/zsh
1040+
```
1041+
This is optional — everything works fine either way. The installer writes to both `~/.zshrc` and `~/.bashrc` so both shells pick up the aliases.
1042+
1043+
### xlsx2csv failed to install
1044+
1045+
Python 3.9 (the macOS default) ships with PEP 668 restrictions that block `pip install` into the system Python. The installer now uses `pipx` to work around this.
1046+
1047+
**Fix:** re-run Step 2:
1048+
```bash
1049+
bash <(curl -fsSL https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/main/step-2/step-2-install.sh)
1050+
```
1051+
If it's still failing, install manually:
1052+
```bash
1053+
brew install pipx
1054+
pipx install xlsx2csv
1055+
```
1056+
1057+
### I want to completely remove everything
1058+
1059+
Run the uninstall script:
1060+
```bash
1061+
bash <(curl -fsSL https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/main/uninstall.sh)
1062+
```
1063+
1064+
This removes the cli-maxxing aliases (`cskip`, `cc`, `ccr`, `ccc`), the `ctg`/`cbrain`/`cbraintg` scripts in `~/.local/bin/`, all MCP servers, skills, and breadcrumbs this setup dropped. See the [Uninstall](#uninstall) section below for the full list.
1065+
1066+
It does **not** remove Homebrew, nvm, Node.js, or Claude Code itself — those are general-purpose tools you might use outside of cli-maxxing. The uninstall script will show you how to remove them manually if you want a completely clean machine.
1067+
10121068
### Telegram: pressing Enter skips setup
10131069
10141070
This is intentional. If you press Enter without pasting a token, the script skips Telegram setup and continues. You can always re-run Step 8 later when you have your bot token ready.

bonus-arc/bonus-arc.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ success() { echo -e "${GREEN}[OK]${NC} $1"; }
1919
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
2020
fail() { echo -e "${RED}[FAIL]${NC} $1"; exit 1; }
2121

22+
# -----------------------------------------------------------------------------
23+
# Source runtime PATH (brew, nvm, ~/.local/bin) so a freshly-installed brew
24+
# from Step 1 is visible without requiring a new shell.
25+
# Idempotent: multiple brew shellenv evals are safe, nvm re-source is safe,
26+
# and the PATH guard prevents duplicate $HOME/.local/bin entries.
27+
# -----------------------------------------------------------------------------
28+
source_runtime_path() {
29+
for brew_bin in /opt/homebrew/bin/brew /usr/local/bin/brew /home/linuxbrew/.linuxbrew/bin/brew; do
30+
if [ -x "$brew_bin" ]; then
31+
eval "$("$brew_bin" shellenv)"
32+
break
33+
fi
34+
done
35+
export NVM_DIR="$HOME/.nvm"
36+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
37+
case ":$PATH:" in
38+
*":$HOME/.local/bin:"*) ;;
39+
*) export PATH="$HOME/.local/bin:$PATH" ;;
40+
esac
41+
}
42+
2243
# -----------------------------------------------------------------------------
2344
# Detect OS
2445
# -----------------------------------------------------------------------------
@@ -97,9 +118,13 @@ main() {
97118
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
98119
echo ""
99120

121+
source_runtime_path
100122
detect_os
101123
install_arc
102124
print_summary
125+
126+
mkdir -p "$HOME/.cli-maxxing"
127+
touch "$HOME/.cli-maxxing/arc.done"
103128
}
104129

105130
main "$@"

bonus-ghostty/bonus-ghostty.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ success() { echo -e "${GREEN}[OK]${NC} $1"; }
1919
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
2020
fail() { echo -e "${RED}[FAIL]${NC} $1"; exit 1; }
2121

22+
# -----------------------------------------------------------------------------
23+
# Source runtime PATH (brew, nvm, ~/.local/bin) so a freshly-installed brew
24+
# from Step 1 is visible without requiring a new shell.
25+
# Idempotent: multiple brew shellenv evals are safe, nvm re-source is safe,
26+
# and the PATH guard prevents duplicate $HOME/.local/bin entries.
27+
# -----------------------------------------------------------------------------
28+
source_runtime_path() {
29+
for brew_bin in /opt/homebrew/bin/brew /usr/local/bin/brew /home/linuxbrew/.linuxbrew/bin/brew; do
30+
if [ -x "$brew_bin" ]; then
31+
eval "$("$brew_bin" shellenv)"
32+
break
33+
fi
34+
done
35+
export NVM_DIR="$HOME/.nvm"
36+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
37+
case ":$PATH:" in
38+
*":$HOME/.local/bin:"*) ;;
39+
*) export PATH="$HOME/.local/bin:$PATH" ;;
40+
esac
41+
}
42+
2243
# -----------------------------------------------------------------------------
2344
# Detect OS
2445
# -----------------------------------------------------------------------------
@@ -445,13 +466,17 @@ main() {
445466
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
446467
echo ""
447468

469+
source_runtime_path
448470
detect_os
449471
install_ghostty
450472
install_font
451473
configure_ghostty
452474
configure_link_opener
453475
install_window_tiling
454476
print_summary
477+
478+
mkdir -p "$HOME/.cli-maxxing"
479+
touch "$HOME/.cli-maxxing/ghostty.done"
455480
}
456481

457482
main "$@"

install.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,36 @@ NC='\033[0m'
1616

1717
BASE_URL="https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/main"
1818

19+
# -----------------------------------------------------------------------------
20+
# reload_path — re-source brew + nvm into the current shell so chained child
21+
# steps in this pipeline can find node, npm, brew, etc. Needed because Step 1
22+
# installs brew/nvm mid-run and the parent shell otherwise never picks them up.
23+
# -----------------------------------------------------------------------------
24+
reload_path() {
25+
# brew — first found wins
26+
local brew_bin
27+
for brew_bin in /opt/homebrew/bin/brew /usr/local/bin/brew /home/linuxbrew/.linuxbrew/bin/brew; do
28+
if [ -x "$brew_bin" ]; then
29+
eval "$("$brew_bin" shellenv)"
30+
break
31+
fi
32+
done
33+
34+
# nvm — source if installed
35+
export NVM_DIR="$HOME/.nvm"
36+
# shellcheck disable=SC1091
37+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
38+
39+
# ~/.local/bin — prepend idempotently
40+
case ":$PATH:" in
41+
*":$HOME/.local/bin:"*) : ;;
42+
*) export PATH="$HOME/.local/bin:$PATH" ;;
43+
esac
44+
}
45+
46+
# Breadcrumb dir — child step scripts touch step-N.done here on success.
47+
mkdir -p "$HOME/.cli-maxxing"
48+
1949
echo ""
2050
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
2151
echo -e "${BLUE} CLI Maxxing — Install${NC}"
@@ -27,6 +57,9 @@ echo ""
2757
echo -e "${YELLOW}>>> Step 1 — Get Claude Running${NC}"
2858
echo ""
2959
curl -fsSL "$BASE_URL/step-1/step-1-install.sh" | bash
60+
# BUG A fix: Step 1 installs brew+nvm; re-source them into this shell so the
61+
# remaining curl|bash steps (Ghostty/Arc/2/3/9/final) can actually find them.
62+
reload_path
3063
echo ""
3164

3265
# Bonus — Ghostty Terminal (optional, won't reinstall if already present)
@@ -71,6 +104,26 @@ echo -e "${GREEN} Core install complete.${NC}"
71104
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
72105
echo ""
73106

107+
# Breadcrumb check — list any expected steps that did NOT touch their .done file.
108+
EXPECTED_CRUMBS=(step-1 step-2 step-3 step-9 step-final ghostty arc)
109+
MISSING_CRUMBS=()
110+
for crumb in "${EXPECTED_CRUMBS[@]}"; do
111+
if [ ! -f "$HOME/.cli-maxxing/${crumb}.done" ]; then
112+
MISSING_CRUMBS+=("$crumb")
113+
fi
114+
done
115+
116+
if [ "${#MISSING_CRUMBS[@]}" -gt 0 ]; then
117+
echo -e "${YELLOW}⚠️ Some steps did not complete. This usually happens on the first install${NC}"
118+
echo -e "${YELLOW} when a new terminal hasn't loaded brew + node yet.${NC}"
119+
echo -e "${YELLOW} → Close this terminal, open a new one, and re-run:${NC}"
120+
echo -e "${YELLOW} bash <(curl -fsSL https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/main/install.sh)${NC}"
121+
echo -e "${YELLOW} The script is idempotent and will resume.${NC}"
122+
echo ""
123+
echo -e "${YELLOW} Missing: ${MISSING_CRUMBS[*]}${NC}"
124+
echo ""
125+
fi
126+
74127
echo " Available commands: cskip, ctg, cc, ccr, ccc"
75128
echo " Available skills: /rswarm, /rmini, /rhive, /w4w, /safetycheck, /gitfix, get-api-docs (auto-triggered)"
76129
echo " Swarm tiers: /rswarm{1,2,3,max}, /rmini{1,2,3,max} — 1=think, 2=think hard, 3=think harder, max=ultrathink"

0 commit comments

Comments
 (0)