Skip to content

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.

rawi completion [options]
OptionDescriptionDefault
-s, --shell <shell>Shell type (bash, zsh, fish, or auto-detect)auto
--installInstall completion script to shell profilefalse
Terminal window
# Copy completion for current shell
rawi completion
# Copy for specific shell
rawi completion --shell bash
rawi completion --shell zsh
Terminal window
# Copy and install to shell profile automatically
rawi completion --install
rawi completion --shell bash --install

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
  1. Copy Template: Advanced completion scripts are copied from the rawi installation to your ~/.rawi/completion/ directory
  2. Install (Optional): With --install, a source line is added to your shell profile
  3. Load: The completion functions are loaded when you start a new shell session

If you prefer manual installation:

Terminal window
# For Bash
echo '[ -f "$HOME/.rawi/completion/rawi-completion.bash" ] && source "$HOME/.rawi/completion/rawi-completion.bash"' >> ~/.bashrc
source ~/.bashrc
# For Zsh
echo '[ -f "$HOME/.rawi/completion/rawi-completion.zsh" ] && source "$HOME/.rawi/completion/rawi-completion.zsh"' >> ~/.zshrc
source ~/.zshrc

Once installed, you get intelligent completion for:

Terminal window
rawi <TAB>
# Shows: ask, chat, exec, act, configure, provider, history, info, completion
Terminal window
rawi ask --<TAB>
# Shows: --profile, --session, --act, --file, --verbose, etc.
Terminal window
rawi ask --provider <TAB>
# Shows: openai, anthropic, google, ollama, etc.
rawi ask --profile <TAB>
# Shows: default, work, personal (your actual profiles)
  • Bash - Full completion support with dynamic values
  • Zsh - Enhanced completion with descriptions and smart parsing
  • Fish - Advanced completion with rich descriptions (if installed)
  1. Verify files exist:

    Terminal window
    ls ~/.rawi/completion/
  2. Check if completion is loaded:

    Terminal window
    type _rawi # Should show completion function
  3. Reload shell:

    Terminal window
    source ~/.bashrc # or ~/.zshrc

When rawi is updated with new commands:

Terminal window
# Recopy the updated completion scripts
rawi completion --shell bash
source ~/.bashrc