Turn on shell completions

Tab completion for bash, zsh, fish, PowerShell, and Elvish.

Written By Dustin

Last updated About 3 hours ago

The CLI generates its own completion script from its live command surface:

tovio completions <shell>

Supported shells: bash, zsh, fish, powershell, elvish. The script goes to stdout; where you put it depends on the shell.

bash

tovio completions bash > /etc/bash_completion.d/tovio

Or, without root, write it somewhere in your home directory and source it from ~/.bashrc.

zsh

tovio completions zsh > "${fpath[1]}/_tovio"

The file must be named _tovio and live on your fpath before compinit runs.

fish

tovio completions fish > ~/.config/fish/completions/tovio.fish

PowerShell

tovio completions powershell | Out-String | Invoke-Expression

Add that line to your profile ($PROFILE) to make it stick.

Regenerate after every upgrade

This is the part people skip. The script is a snapshot of the command surface at the version that produced it, so an old file will offer flags that have been renamed or removed and stay silent about new ones. TOVIO is pre-1.0 and the surface still moves — regenerate whenever you rebuild the CLI.

Why the everyday surface is small

Completion is more useful than it looks here, because most of the command surface is hidden from the default help index rather than absent. tovio help shows about seventeen everyday commands; the Team and Advanced tiers are still runnable and still complete. Use tovio help --team, tovio help --advanced, or tovio help --all to see them.