Use this guide when pi-stack-ops doesn't install, load, or pass
/stack-ops doctor. Most issues come from missing local tools, a shell PATH
that Pi can't see, or running the extension outside the repository you want to
manage.
The fastest way to find setup problems is to run the doctor command from the project repository where you want to use stacked PRs.
/stack-ops doctor
If the standalone stack-ops command is available in your shell, you can run
the same check there.
stack-ops doctorDoctor checks for the local artifact directory, state.json, stax, gh,
git, semble, and code-review-graph. semble and code-review-graph are
optional, so warnings for those tools don't block the core workflow.
These issues can happen on macOS, Linux, Windows, and WSL.
If Pi reports that /stack-ops is unknown, the package probably isn't installed
in the Pi environment that you're currently running.
-
Install the package again from inside Pi.
pi install npm:pi-stack-ops
-
Restart Pi so it reloads installed package extensions.
-
Run
/stack-ops doctorfrom the repository where you want to work.
pi-stack-ops calls local CLIs for stack and PR operations. The tools must be
installed and visible on the PATH used by Pi.
- Install Git.
- Install GitHub CLI, then run
gh auth login. - Install stax, then verify
stax --version. - Restart your terminal, editor, or Pi session after changing
PATH.
If a command works in one terminal but doctor still reports it missing, start Pi from the same terminal where the command works. GUI apps often inherit a smaller or older environment than your interactive shell.
pi-stack-ops stores runtime files under .pi/stack-ops/ relative to the
current working directory. Start Pi from the repository root before you run
workflow commands.
cd path/to/your/repository
piIf you initialized the wrong directory, remove the misplaced .pi/stack-ops/
directory only after confirming it doesn't contain state you need.
Doctor only checks whether gh exists. It doesn't prove that GitHub auth or
repository permissions are ready.
Run these commands in the same shell you use for Pi:
gh auth status
gh repo viewIf either command fails, run gh auth login and confirm that your account can
read and write pull requests in the target repository.
stax needs to know the repository and trunk branch it works with. If stack
commands fail, initialize or repair stax in the repository first.
stax doctor --fixYou can also follow the stax setup guide for your repository if doctor reports a trunk, remote, or authentication problem.
macOS setup issues usually come from missing Homebrew tools or a PATH mismatch
between Terminal, your editor, and Pi.
Apple Silicon Homebrew commonly installs tools under /opt/homebrew/bin, while
Intel Homebrew commonly installs them under /usr/local/bin. Confirm that the
directory for your machine is on PATH.
echo $PATH
which stax
which gh
which gitIf which can't find a tool, add the correct Homebrew shell environment to your
shell profile and restart Pi.
eval "$(brew shellenv)"For a persistent fix, follow the command printed by brew shellenv for your
shell.
Some Git operations require Apple's command line developer tools. If git or
build tooling fails with an xcrun or developer tools error, install them.
xcode-select --installAfter installation finishes, open a new terminal and run /stack-ops doctor
again.
Linux setup issues usually come from package names, missing permissions, or a
user-local binary directory that isn't on PATH.
Some stax install methods place binaries in ~/.local/bin. Confirm that your
shell and Pi can see that directory.
echo $PATH
ls ~/.local/bin/staxIf needed, add it to your shell profile and restart Pi.
export PATH="$HOME/.local/bin:$PATH"Install GitHub CLI using the method for your distribution, then authenticate.
gh auth loginIf gh is installed through Snap, Flatpak, or another sandboxed package system,
confirm that it can access your repository directory and Git credentials.
Doctor checks whether commands are executable. If you installed a prebuilt binary manually, confirm that it has execute permission.
chmod +x ~/.local/bin/stax ~/.local/bin/stThen open a new terminal and run /stack-ops doctor again.
Windows works best when Pi, Git, GitHub CLI, stax, and the repository all run in
the same environment. If you mix PowerShell, Git Bash, WSL, and GUI-launched
apps, each environment may have a different PATH and different credentials.
Install the required CLIs, then open a new PowerShell session and verify them.
git --version
gh --version
stax --versionIf PowerShell can't find a command, add the directory that contains the
executable to your user Path, then restart PowerShell and Pi.
If PowerShell reports that scripts are disabled, change the policy for your user account, then restart the shell.
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedUse your organization's approved policy if your machine is managed.
WSL has its own Linux filesystem, PATH, Git config, and GitHub CLI auth. If
you run Pi in WSL, install and authenticate the tools inside WSL too.
git --version
gh auth login
stax --versionKeep the repository inside the same environment where you run Pi. For WSL, a path under your Linux home directory is usually more reliable than a mounted Windows path for Git-heavy workflows.
stax supports Windows, but some shell integration features are Unix-specific.
If a stax worktree command prints a path instead of changing directories, run
cd to that path manually. For tmux-based workflows, use WSL or another
Unix-like environment.
Use cleanup only when you want to remove generated runtime artifacts. This doesn't uninstall the Pi package.
To remove logs only, run:
/stack-ops clean
To remove all local stack-ops artifacts for the current repository, run:
/stack-ops clean --all
The full cleanup removes .pi/stack-ops/, including active state, plans,
summaries, validation evidence, blockers, snapshots, logs, and PR body drafts.
After fixing the reported issue, run /stack-ops doctor again. When doctor
passes for required tools, run /stack-ops init, then continue with /draft in
the target repository.