Every discrete behavior in install.sh that the npm package must replicate.
- Check
gitis installed - Check
nodeis installed - Check
npmis installed - Print install instructions per platform if missing
- Detect macOS / Linux / Windows via
uname -s - Map to
macos,linux,windows,unknown
- Create
~/.agents/parent directory -
git clonerepo to~/.agents/superpowers
- Detect existing install via
.gitdirectory - Stash local changes before pull
-
git pull origin main
- Run
~/.agents/superpowers/.agents/superpowers-agent bootstrap - Mark success with
.install_successsentinel file
- Detect user's shell (zsh/bash/fish/other)
- Detect shell profile file (~/.zshrc, ~/.bash_profile, ~/.bashrc, ~/.config/fish/config.fish, ~/.profile)
- Check if
~/.local/binalready in profile - Append PATH export if missing (fish syntax variant)
- Create profile file if it doesn't exist
- Detect AGENTS.md, CLAUDE.md, GEMINI.md in CWD
- Prompt user (y/N) to update
- Backup each file with timestamp suffix
- Copy files from global install to CWD
- Restore backup on copy failure
-
set -euo pipefailequivalent (fail-fast) - Trap EXIT for cleanup
- Remove incomplete
$INSTALL_DIRon failure (if no.install_success)
- Colored output (RED/GREEN/YELLOW/BLUE)
- Structured log helpers (info/success/warning/error with icons)
- ASCII banner header
- Final success message with next-steps
| Shell Behavior | npm Equivalent |
|---|---|
git clone to ~/.agents/superpowers |
npm install -g (npm handles distribution) |
git pull for updates |
npm update -g |
superpowers-agent bootstrap |
postinstall lifecycle script |
Symlinks in ~/.local/bin |
bin field in package.json (npm creates shims) |
uname platform detection |
Already handled by CLI via process.platform |
| Dependency checks (git/node/npm) | node/npm guaranteed; git checked at runtime |
| Interactive project file updates | Remains via superpowers-agent setup-skills |
| Shell profile PATH modification | No longer needed (npm global bin is already in PATH) |