Skip to content

Completion Commands

Enable tab completion for bash, zsh, or fish shells.

Global options available on completion commands: --json, --no-color.

ShellConfig File
bash~/.bashrc
zsh~/.zshrc
fish~/.config/fish/config.fish

Install shell completions for your current shell.

Terminal window
bb completion install [options]
OptionDescription
--jsonOutput as JSON

The installer auto-detects your shell and adds the necessary configuration.

After installing, restart your shell or source your config:

Terminal window
# Bash
source ~/.bashrc
# Zsh
source ~/.zshrc
# Fish
source ~/.config/fish/config.fish
Terminal window
# Install completions
bb completion install
# Install with JSON output
bb completion install --json
# Test it works
bb <Tab> # Shows: auth, repo, pr, snippet, browse, api, config, completion
bb repo <Tab> # Shows: clone, create, list, view, delete, default-reviewers

Remove shell completions.

Terminal window
bb completion uninstall [options]
OptionDescription
--jsonOutput as JSON
Terminal window
# Remove completions
bb completion uninstall
# Remove completions with JSON output
bb completion uninstall --json

Completions are derived from the live command tree, so they always reflect the commands and flags the CLI actually ships — there is no separate list to fall out of date.

Tab completion works for:

  • Commands: auth, repo, pr, snippet, browse, api, config, completion
  • Subcommands: login, clone, create, list, etc.
  • Options: --json, --no-color, --workspace, --repo, --help
  • Flag values for enum options (see below)

-w is reserved as the global shorthand for --workspace.

When a flag accepts a fixed set of values, completing right after it suggests the valid values:

Terminal window
$ bb pr merge 42 --strategy <Tab>
merge_commit squash fast_forward
squash_fast_forward rebase_fast_forward rebase_merge
$ bb pr list --state <Tab>
OPEN MERGED DECLINED SUPERSEDED
$ bb snippet list --role <Tab>
owner contributor member
$ bb pr diff --color <Tab>
auto always never
$ bb api -X <Tab>
GET POST PUT PATCH
HEAD OPTIONS DELETE

In zsh and fish, each completion is shown with its description; bash shows the bare names.

Terminal window
$ bb pr<Tab>
pr
$ bb pr <Tab>
activity approve checks checkout comments create decline
diff edit list merge ready reviewers view
$ bb pr create --<Tab>
# the command's own flags, plus inherited global flags:
--title --body --source --destination
--draft --close-source-branch --reviewer --default-reviewers
--json --jq --workspace --repo
--no-color --no-unicode --no-truncate --locale --help