Installation¶
Homebrew (macOS and Linux)¶
The easiest way to install stackit is via Homebrew:
brew install getstackit/tap/stackit
After installation, you can use either stackit or st (short alias).
Shell integration¶
Recommended
Enable shell integration to automatically change directories when creating worktrees with stackit create -w.
Add one of the following to your shell configuration:
# ~/.zshrc
eval "$(stackit shell zsh)"
# ~/.bashrc
eval "$(stackit shell bash)"
# ~/.config/fish/config.fish
stackit shell fish | source
This is separate from shell completions. You likely want both:
# zsh example:
eval "$(stackit completion zsh)"
eval "$(stackit shell zsh)"
Shell completions¶
Enable tab completion for stackit commands:
# ~/.zshrc
eval "$(stackit completion zsh)"
# ~/.bashrc
eval "$(stackit completion bash)"
# ~/.config/fish/config.fish
stackit completion fish | source
Verify installation¶
Check that stackit is installed correctly:
stackit --version
Initialize your repository¶
In your Git repository, run:
stackit init
This command:
- Detects your trunk branch (usually
mainormaster) - Prepares the repository for stacking
- Offers to install optional integrations:
- GitHub Actions — CI checks for branch locking
- Git hooks — Prevent commits and pushes to locked branches (learn more)
- AI agent files — Integration files for Cursor and Claude Code
You can skip the interactive prompts with stackit init --skip-integrations or install integrations later using the individual commands (stackit github install, stackit precommit install, stackit prepush install, stackit agent install).