Alias Commands
Create your own shortcuts for bb commands, mirroring gh alias. An alias
expands in place of the first argument: after bb alias set co "pr checkout $1",
running bb co 42 runs bb pr checkout 42.
Aliases are stored in the aliases map of the configuration file
and are managed with the commands below (not with bb config set).
How expansion works
Section titled “How expansion works”- The first argument after
bbis looked up in your alias map. Built-in command names always win: an alias can never shadow a realbbcommand. $1–$9placeholders in the expansion are filled from the arguments that follow the alias. Missing arguments are an error.- Arguments not consumed by a placeholder are appended to the expanded command.
- Expansion is a single level deep — an alias cannot reference another alias.
bb alias set
Section titled “bb alias set”Create or update an alias.
bb alias set <name> <expansion>Examples
Section titled “Examples”# Shortcut with a placeholder (single quotes keep $1 literal for bb)bb alias set co 'pr checkout $1'bb co 42 # → bb pr checkout 42
# Shortcut for a flag-heavy invocationbb alias set prd "pr create --draft"bb prd -t "My PR" # → bb pr create --draft -t "My PR"
# JSON outputbb alias set co 'pr checkout $1' --jsonShell passthrough (! prefix)
Section titled “Shell passthrough (! prefix)”An expansion starting with ! is run through sh -c instead of being parsed
as a bb command. The arguments after the alias are available as shell
positional parameters ($1, $@), so pipes, xargs, and other shell
constructs work:
bb alias set igrep '!bb issue list --all --json | grep "$1"'bb igrep login # → sh -c 'bb issue list --all --json | grep "$1"' bb-alias loginbb alias list
Section titled “bb alias list”List configured aliases.
bb alias listExamples
Section titled “Examples”bb alias listbb alias list --jsonbb alias delete
Section titled “bb alias delete”Delete an alias.
bb alias delete <name>Examples
Section titled “Examples”bb alias delete cobb alias delete co --json