Shell Completions
Spawn supports dynamic shell completions for Bash, Zsh, Fish, PowerShell, and Elvish. Completions are context-aware and include migration names, test names, and all command options.
Features
Section titled “Features”- Dynamic completions: Always reflects current migrations and tests in your project
- Fuzzy-friendly: Works with shell fuzzy finders like fzf-tab
Add to your ~/.zshrc:
# Initialize zsh completion system (skip if using oh-my-zsh, prezto, etc.)autoload -Uz compinit && compinit
source <(COMPLETE=zsh spawn)If you’re using a zsh framework like oh-my-zsh or prezto, it already initializes compinit, so you only need the source line.
Add to your ~/.bashrc:
source <(COMPLETE=bash spawn)Add to your Fish config (~/.config/fish/config.fish):
COMPLETE=fish spawn | sourcePowerShell
Section titled “PowerShell”Add to your PowerShell profile:
Invoke-Expression (& { $env:COMPLETE="powershell"; spawn })Elvish
Section titled “Elvish”Add to your Elvish config:
eval (COMPLETE=elvish spawn | slurp)After setup, use Tab to complete:
# Complete subcommandsspawn migr<TAB># → spawn migration
# Complete migration namesspawn migration build <TAB># → 20260102030405-add-users# → 20260103120000-create-posts
# Complete test namesspawn test run <TAB># → my-test# → another-testFuzzy Finder Integration
Section titled “Fuzzy Finder Integration”When working with many timestamped migrations, a fuzzy finder like fzf-tab can help you quickly filter by typing any part of the migration name.
With fzf-tab installed, pressing Tab opens an interactive fzf menu where you can type add-users to filter to 20260102030405-add-users, even though the completion value starts with a timestamp.