Completions Command
The completions command generates shell completion scripts for the Rumour CLI and prints them directly to stdout. Sourcing or saving this script to your shell's configuration directory enables tab auto-completion for all Rumour subcommands, flags, and options.
Basic Usage
rumour completions <SHELL>
<SHELL>— The target shell. Must be one of the supported values:bash,elvish,fish,powershell,zsh.
Installation Instructions
Choose your shell from the sections below to set up auto-completion.
Zsh
Zsh uses the $fpath array to locate completion functions. To set up completions:
Method 1 — Using a dedicated completions directory (Recommended)
-
Create a directory for custom completions (if it doesn't already exist):
mkdir -p ~/.zfunc -
Generate the completion script and save it as
_rumourin that folder:rumour completions zsh > ~/.zfunc/_rumour -
Ensure the folder is in your
$fpathby adding this line to your~/.zshrcbefore callingcompinit:fpath=(~/.zfunc $fpath)autoload -Uz compinit && compinit -
Restart your terminal or reload your shell configuration:
source ~/.zshrc
Method 2 — Sourcing directly
If you prefer not to manage a separate completions directory, you can source the completion script directly in your ~/.zshrc (note that this is slightly slower during shell startup):
source <(rumour completions zsh)
Bash
Linux (System-wide)
Save the script to the system bash-completion directory:
rumour completions bash | sudo tee /usr/share/bash-completion/completions/rumour > /dev/null
Linux/macOS (User-specific)
- Create the user completions directory:
mkdir -p ~/.local/share/bash-completion/completions
- Generate the script:
rumour completions bash > ~/.local/share/bash-completion/completions/rumour
- Ensure user-level completions are sourced by adding the following to your
~/.bashrc(or~/.bash_profileon macOS):if [ -f ~/.local/share/bash-completion/completions/rumour ]; then. ~/.local/share/bash-completion/completions/rumourfi
Fish
Fish looks for completions automatically inside ~/.config/fish/completions/.
To set up completions, generate the script and write it directly to the designated filename:
mkdir -p ~/.config/fish/completions
rumour completions fish > ~/.config/fish/completions/rumour.fish
No additional configuration or shell restarts are required; Fish will load the completions automatically on the next command.
PowerShell
To enable completions in PowerShell, generate the completion script and load it in your profile.
-
Find the path to your current profile file:
$PROFILE -
Create the profile file if it doesn't exist:
if (!(Test-Path -Path $PROFILE)) {New-Item -ItemType File -Path $PROFILE -Force} -
Generate the script and save it:
rumour completions powershell > "$HOME\.rumour-completion.ps1" -
Add the line to source the script in your
$PROFILE:Add-Content -Path $PROFILE -Value ". `"$HOME\.rumour-completion.ps1`"" -
Restart PowerShell or reload your profile:
. $PROFILE
Elvish
Save the completion script to your Elvish library directory and import it.
-
Create your Elvish completions directory:
mkdir -p ~/.elvish/lib -
Generate the completions:
rumour completions elvish > ~/.elvish/lib/rumour.elv -
Import the library module in your Elvish startup file (
~/.elvish/rc.elv):use rumour
Verifying Autocomplete
Once you have installed the completions and restarted/reloaded your shell, verify that the configuration was successful by typing the start of a command and pressing Tab:
rumour b[Tab]
# Should auto-complete to:
rumour bench
Or check available flags for a subcommand:
rumour run --[Tab]
# Should display flags like:
# --concurrency --dry-run --env-file --help ...