diff --git a/src/content/changelog/workers/2026-01-09-wrangler-tab-completion.mdx b/src/content/changelog/workers/2026-01-09-wrangler-tab-completion.mdx new file mode 100644 index 00000000000000..b10ba944c4e9c5 --- /dev/null +++ b/src/content/changelog/workers/2026-01-09-wrangler-tab-completion.mdx @@ -0,0 +1,40 @@ +--- +title: Shell tab completions for Wrangler CLI +description: Wrangler now supports shell tab completions for Bash, Zsh, Fish, and PowerShell, making it faster to navigate commands and flags. +products: + - workers +date: 2026-01-09 +--- + +Wrangler now includes built-in shell tab completion support, making it faster and easier to navigate commands without memorizing every option. Press Tab as you type to autocomplete commands, subcommands, flags, and even option values like log levels. + +Tab completions are supported for Bash, Zsh, Fish, and PowerShell. + +### Setup + +Generate the completion script for your shell and add it to your configuration file: + +```sh +# Bash +wrangler complete bash >> ~/.bashrc + +# Zsh +wrangler complete zsh >> ~/.zshrc + +# Fish +wrangler complete fish >> ~/.config/fish/config.fish + +# PowerShell +wrangler complete powershell >> $PROFILE +``` + +After adding the script, restart your terminal or source your configuration file for the changes to take effect. Then you can simply press Tab to see available completions: + +```sh +wrangler d # completes to 'deploy', 'dev', 'd1', etc. +wrangler kv # shows subcommands: namespace, key, bulk +``` + +Tab completions are dynamically generated from Wrangler's command registry, so they stay up-to-date as new commands and options are added. This feature is powered by [`@bomb.sh/tab`](https://github.com/bombshell-dev/tab/). + +See the [`wrangler complete` documentation](/workers/wrangler/commands/#complete) for more details. diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index c74fb1f739f978..2f330e076c92be 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -24,6 +24,7 @@ Wrangler offers a number of commands to manage your Cloudflare Workers. - [`docs`](#docs) - Open this page in your default browser. - [`init`](#init) - Create a new project from a variety of web frameworks and templates. +- [`complete`](#complete) - Generate shell completion scripts for Wrangler commands. - [`containers`](#containers) - Interact with Containers. - [`d1`](#d1) - Interact with D1. - [`vectorize`](#vectorize) - Interact with Vectorize indexes. @@ -1054,3 +1055,66 @@ wrangler check startup - If you don't use a Wrangler config file with your Pages project (i.e. a Wrangler config file containing `pages_build_output_dir`), use this flag to force `wrangler check startup` to treat your project as a Pages project. + +--- + +## `complete` + +Generate shell completion scripts for Wrangler commands. Shell completions allow you to autocomplete commands, subcommands, and flags by pressing Tab as you type. + +```txt +wrangler complete +``` + +- `SHELL` + - The shell to generate completions for. Supported values: `bash`, `zsh`, `fish`, `powershell`. + +### Setup + +Generate and add the completion script to your shell configuration file: + + + +```sh +wrangler complete bash >> ~/.bashrc +``` + +Then restart your terminal or run `source ~/.bashrc`. + + + +```sh +wrangler complete zsh >> ~/.zshrc +``` + +Then restart your terminal or run `source ~/.zshrc`. + + + +```sh +wrangler complete fish >> ~/.config/fish/config.fish +``` + +Then restart your terminal or run `source ~/.config/fish/config.fish`. + + + +```powershell +wrangler complete powershell >> $PROFILE +``` + +Then restart PowerShell or run `. $PROFILE`. + + + + +### Usage + +After setup, press Tab to autocomplete commands, subcommands, and flags: + +```sh +wrangler d # completes to 'deploy', 'dev', 'd1', etc. +wrangler kv # shows subcommands: namespace, key, bulk +``` + +