Completion Commands
Enable tab completion for bash, zsh, or fish shells.
Global options available on completion commands: --json, --no-color.
Supported Shells
Section titled “Supported Shells”| Shell | Config File |
|---|---|
| bash | ~/.bashrc |
| zsh | ~/.zshrc |
| fish | ~/.config/fish/config.fish |
bb completion install
Section titled “bb completion install”Install shell completions for your current shell.
bb completion install [options]Options
Section titled “Options”| Option | Description |
|---|---|
--json | Output as JSON |
The installer auto-detects your shell and adds the necessary configuration.
Post-Installation
Section titled “Post-Installation”After installing, restart your shell or source your config:
# Bashsource ~/.bashrc
# Zshsource ~/.zshrc
# Fishsource ~/.config/fish/config.fishExamples
Section titled “Examples”# Install completionsbb completion install
# Install with JSON outputbb completion install --json
# Test it worksbb <Tab> # Shows: auth, repo, pr, snippet, browse, api, config, completionbb repo <Tab> # Shows: clone, create, list, view, delete, default-reviewersbb completion uninstall
Section titled “bb completion uninstall”Remove shell completions.
bb completion uninstall [options]Options
Section titled “Options”| Option | Description |
|---|---|
--json | Output as JSON |
Examples
Section titled “Examples”# Remove completionsbb completion uninstall
# Remove completions with JSON outputbb completion uninstall --jsonWhat Gets Completed
Section titled “What Gets Completed”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.
Flag-value completion
Section titled “Flag-value completion”When a flag accepts a fixed set of values, completing right after it suggests the valid values:
$ bb pr merge 42 --strategy <Tab>merge_commit squash fast_forwardsquash_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 PATCHHEAD OPTIONS DELETEIn zsh and fish, each completion is shown with its description; bash shows the bare names.
Example Session
Section titled “Example Session”$ bb pr<Tab>pr
$ bb pr <Tab>activity approve checks checkout comments create declinediff 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