Browse docs
On this page

obi completion

Set up tab completion for obi in bash, zsh, or fish, including the names of your own resources.

obi completes commands, the resource types each command works on, and the names of your actual dashboards, alerts, incidents, and other objects when you press Tab.

Shell
obi completion install [bash|zsh|fish]
obi completion bash|zsh|fish

Set up

The install script sets it up for you. If you installed with npm, run this once:

Shell
obi completion install

It reads your shell from $SHELL unless you name one, and puts the completion script in a folder your shell already loads from, so nothing in your shell's startup file changes:

ShellWorks without other setup
fishAlways.
bashWherever the bash-completion package is installed, the default on most Linux distributions. On macOS, install it with Homebrew.
zshWhen a site-functions folder it loads from can be written to, as with Homebrew.

Where that is not possible, it says the one line to add to ~/.bashrc or ~/.zshrc. Open a new shell afterwards.

To set it up yourself, print the script instead:

Shell
source <(obi completion bash)                                # in ~/.bashrc
source <(obi completion zsh)                                 # in ~/.zshrc, after compinit
obi completion fish > ~/.config/fish/completions/obi.fish

What it completes

Text
obi de<Tab>                      describe  delete
obi delete <Tab>                 only the types you can delete
obi get dashboards <Tab>         your dashboards
obi ack incident <Tab>           open incidents, by number
obi get silences --alert <Tab>   your alerts
obi --context <Tab>              your saved contexts
obi get -o <Tab>                 output formats

Names are read from your workspace as you press Tab, so they need a signed-in context. Without one, or if the server does not answer within a few seconds, obi offers no names rather than an error. Where it has nothing to offer, as after -f, your shell completes file names.