completion — Shell Completion
The completion
command copies advanced shell completion scripts to ~/.rawi/completion/
and optionally installs them to your shell profile for automatic loading. This enables intelligent tab completion for commands, options, and values.
Basic Usage
Section titled “Basic Usage”rawi completion [options]
Options
Section titled “Options”Option | Description | Default |
---|---|---|
-s, --shell <shell> | Shell type (bash, zsh, fish, or auto-detect) | auto |
--install | Install completion script to shell profile | false |
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”# Copy completion for current shellrawi completion
# Copy for specific shellrawi completion --shell bashrawi completion --shell zsh
Automatic Installation
Section titled “Automatic Installation”# Copy and install to shell profile automaticallyrawi completion --installrawi completion --shell bash --install
Files Created
Section titled “Files Created”The completion command creates these files:
~/.rawi/completion/rawi-completion.bash
- Bash completion script~/.rawi/completion/rawi-completion.zsh
- Zsh completion script~/.rawi/completion/rawi-completion.fish
- Fish completion script
How It Works
Section titled “How It Works”- Copy Template: Advanced completion scripts are copied from the rawi installation to your
~/.rawi/completion/
directory - Install (Optional): With
--install
, a source line is added to your shell profile - Load: The completion functions are loaded when you start a new shell session
Manual Installation
Section titled “Manual Installation”If you prefer manual installation:
# For Bashecho '[ -f "$HOME/.rawi/completion/rawi-completion.bash" ] && source "$HOME/.rawi/completion/rawi-completion.bash"' >> ~/.bashrcsource ~/.bashrc
# For Zshecho '[ -f "$HOME/.rawi/completion/rawi-completion.zsh" ] && source "$HOME/.rawi/completion/rawi-completion.zsh"' >> ~/.zshrcsource ~/.zshrc
Completion Features
Section titled “Completion Features”Once installed, you get intelligent completion for:
Commands
Section titled “Commands”rawi <TAB># Shows: ask, chat, exec, act, configure, provider, history, info, completion
Options
Section titled “Options”rawi ask --<TAB># Shows: --profile, --session, --act, --file, --verbose, etc.
Values
Section titled “Values”rawi ask --provider <TAB># Shows: openai, anthropic, google, ollama, etc.
rawi ask --profile <TAB># Shows: default, work, personal (your actual profiles)
Supported Shells
Section titled “Supported Shells”- Bash - Full completion support with dynamic values
- Zsh - Enhanced completion with descriptions and smart parsing
- Fish - Advanced completion with rich descriptions (if installed)
Troubleshooting
Section titled “Troubleshooting”Completion Not Working
Section titled “Completion Not Working”-
Verify files exist:
Terminal window ls ~/.rawi/completion/ -
Check if completion is loaded:
Terminal window type _rawi # Should show completion function -
Reload shell:
Terminal window source ~/.bashrc # or ~/.zshrc
Update Completions
Section titled “Update Completions”When rawi is updated with new commands:
# Recopy the updated completion scriptsrawi completion --shell bashsource ~/.bashrc