Shell Completion¶
Weld provides tab completion for commands, options, and arguments. Completions are context-aware—they suggest relevant files, flag values, and subcommands based on what you've typed.
Automatic Installation¶
Completions are installed automatically on first run of any weld command. You'll see a one-time message:
After restarting your shell (or sourcing the config file), completions will work immediately. No additional setup required for bash, zsh, or fish.
Manual Installation¶
If automatic installation didn't work, you prefer manual control, or you're using PowerShell, use one of the methods below.
Quick Install¶
The simplest manual method:
This auto-detects your shell and installs the completion script to the appropriate location. Restart your shell or source your config file to activate.
Bash¶
Option 1: User-level installation
# Generate completion script
weld --show-completion > ~/.weld-complete.bash
# Add to ~/.bashrc
echo 'source ~/.weld-complete.bash' >> ~/.bashrc
# Reload
source ~/.bashrc
Option 2: System-wide installation (Linux)
# Requires sudo
weld --show-completion | sudo tee /etc/bash_completion.d/weld > /dev/null
# Reload bash
source /etc/bash_completion.d/weld
macOS with Homebrew
# Ensure bash-completion is installed
brew install bash-completion@2
# Install weld completion
weld --show-completion > $(brew --prefix)/etc/bash_completion.d/weld
# Reload
source ~/.bashrc
Zsh¶
Option 1: User-level installation
# Generate completion script
weld --show-completion > ~/.weld-complete.zsh
# Add to ~/.zshrc
echo 'source ~/.weld-complete.zsh' >> ~/.zshrc
# Reload
source ~/.zshrc
Option 2: Using fpath (recommended for zsh)
# Create completions directory if needed
mkdir -p ~/.zfunc
# Generate completion
weld --show-completion > ~/.zfunc/_weld
# Add to ~/.zshrc (before compinit)
echo 'fpath=(~/.zfunc $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
# Reload
source ~/.zshrc
Oh My Zsh
# Install to Oh My Zsh completions
weld --show-completion > ~/.oh-my-zsh/completions/_weld
# Reload
source ~/.zshrc
Fish¶
# Create completions directory if needed
mkdir -p ~/.config/fish/completions
# Generate completion
weld --show-completion > ~/.config/fish/completions/weld.fish
# Fish auto-loads from completions directory - no reload needed
# Or manually reload:
source ~/.config/fish/completions/weld.fish
PowerShell¶
Windows PowerShell
# Show your profile path
echo $PROFILE
# Generate and append completion to profile
weld --show-completion >> $PROFILE
# Reload profile
. $PROFILE
PowerShell Core (Cross-platform)
# Create profile directory if needed
New-Item -Path (Split-Path $PROFILE) -ItemType Directory -Force
# Generate completion
weld --show-completion | Out-File -Append -FilePath $PROFILE
# Reload
. $PROFILE
What Gets Completed¶
Weld completions include:
| Context | Completions |
|---|---|
| Commands | weld <TAB> → init, plan, implement, commit, etc. |
| Subcommands | weld prompt <TAB> → list, show, export |
| Flags | weld plan --<TAB> → --output, --focus, --provider, etc. |
| Flag values | weld plan --provider <TAB> → claude, codex |
| File arguments | weld plan <TAB> → *.md files |
| Task types | weld prompt show <TAB> → discover, research, plan_generation, etc. |
Troubleshooting¶
Completions not working after installation¶
- Restart your terminal - Most shells don't reload config automatically
- Check the source line - Ensure your shell config actually sources the completion file
- Verify the file exists -
ls -la ~/.weld-complete.*or check the path used
"command not found" in completion script¶
The completion script calls weld to generate completions. Ensure weld is in your PATH:
If weld was installed with uv tool or pipx, ensure the tool bin directory is in PATH:
Completions are slow¶
Completions run weld each time to generate context-aware suggestions. If this is slow:
- Check if weld startup is slow:
time weld --help - Ensure you're not running weld from a network drive
- On Windows, antivirus can slow Python startup
Zsh: "command not found: compdef"¶
The completion system isn't initialized. Add to ~/.zshrc before sourcing completions:
Zsh: Insecure directories warning¶
Zsh may warn about insecure completion directories. Fix permissions:
Or disable the check (not recommended):
Fish: Completions not loading¶
Fish should auto-load from ~/.config/fish/completions/. If not:
- Check file exists:
ls ~/.config/fish/completions/weld.fish - Check for syntax errors:
fish -c "source ~/.config/fish/completions/weld.fish" - Clear completion cache:
rm -rf ~/.cache/fish/completions
PowerShell: Script execution disabled¶
Enable script execution:
Reinstalling after weld upgrade¶
After upgrading weld, regenerate completions to pick up new commands:
Uninstalling Completions¶
Remove the completion script and source line from your shell config:
Bash/Zsh:
Fish:
PowerShell: