Skip to main content
For the complete documentation index, see llms.txt.

Completion

mapbox completion prints a shell completion script on stdout.

mapbox completion

Prints a completion script for one shell on stdout. It makes no request, needs no token, and writes nothing to disk.

The script is generated from the command tree this binary built, so it completes exactly the commands this build has — a command group a spec sync added is in it, and any withheld operations are absent from it for the same reason they're absent from --help. Nothing about it is maintained by hand, and it cannot fall behind the binary that printed it.

Commands, command groups and flag names are completed. Values are not — completing a style id, a tileset id or a username would mean an API request and a live token in the middle of a keystroke.

--output/-o does not apply: the script is the result, and an envelope around it would stop the shell sourcing it. Passing it explicitly earns a warning on stderr; the ordinary > file redirect does not, and an exported MAPBOX_OUTPUT does not.

# bash: any file bash-completion loads
mapbox completion bash > ~/.local/share/bash-completion/completions/mapbox

# zsh: any directory on $fpath, and the filename has to be `_mapbox`
mapbox completion zsh > ~/.zfunc/_mapbox

# fish
mapbox completion fish > ~/.config/fish/completions/mapbox.fish

# for the current shell only, no file
source <(mapbox completion bash)
# PowerShell: append to the profile, which is what $PROFILE names
mapbox completion powershell | Out-String | Invoke-Expression
mapbox completion powershell >> $PROFILE

Parameters:

ParameterDescription
<SHELL>Required. One of bash, zsh, fish, powershell.
Was this page helpful?