Skip to content

Commit f43e2b7

Browse files
committed
docs(console): update shell completion documentation
1 parent 6f9f2fb commit f43e2b7

1 file changed

Lines changed: 34 additions & 14 deletions

File tree

docs/1-essentials/04-console-commands.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ Interactive components are only supported on Mac and Linux. On Windows, Tempest
240240

241241
## Shell completion
242242

243-
Tempest provides shell completion for Zsh and Bash. This allows you to press `Tab` to autocomplete command names and options.
243+
Tempest provides shell completion for Zsh and Bash on Linux and macOS. This allows you to press `Tab` to autocomplete command names and options. On Windows, use WSL.
244+
245+
Completion relies on two things: a **completion script** sourced by your shell, and a **helper binary** that performs the actual matching. The helper binary is not bundled with Tempest. It is downloaded from the GitHub release matching your installed Tempest version.
244246

245247
### Installing completions
246248

@@ -250,28 +252,46 @@ Run the install command and follow the prompts:
250252
<dim>./</dim>tempest completion:install
251253
```
252254

253-
The installer will detect your current shell, copy the completion script to the appropriate location, and provide instructions for enabling it.
255+
This will:
256+
257+
1. Detect your shell (or use `--shell=zsh` / `--shell=bash`).
258+
2. Generate completion metadata (`commands.json`) for all registered commands.
259+
3. Download the platform-specific helper binary from the matching Tempest release.
260+
4. Install the completion script to the appropriate location.
254261

255-
For Zsh, you'll need to ensure the completions directory is in your `fpath` and reload completions:
262+
After installation, add the following line to your shell configuration file and restart your terminal:
256263

257-
```zsh
258-
# Add to ~/.zshrc
259-
fpath=(~/.zsh/completions $fpath)
260-
autoload -Uz compinit && compinit
264+
```bash
265+
# Zsh: add to ~/.zshrc
266+
source ~/.tempest/completion/tempest.zsh
267+
268+
# Bash: add to ~/.bashrc
269+
source ~/.tempest/completion/tempest.bash
261270
```
262271

263-
For Bash, source the completion file in your `~/.bashrc`:
272+
### Keeping completions up to date
264273

265-
```bash
266-
source ~/.bash_completion.d/tempest.bash
274+
After adding or removing commands, regenerate the metadata:
275+
276+
```console
277+
<dim>./</dim>tempest completion:generate
267278
```
268279

269-
### Additional commands
280+
After updating Tempest to a new version, update the helper binary:
281+
282+
```console
283+
<dim>./</dim>tempest completion:update-bin
284+
```
270285

271-
You may also use these related commands:
286+
### Available commands
272287

273-
- `completion:show` — Output the completion script to stdout (useful for custom installation)
274-
- `completion:uninstall` — Remove the installed completion script
288+
| Command | Description |
289+
|-------------------------|--------------------------------------------------------------------------|
290+
| `completion:install` | Install the completion script and download the helper binary. |
291+
| `completion:generate` | Regenerate the completion metadata JSON. |
292+
| `completion:update-bin` | Re-download the helper binary for the current Tempest version. |
293+
| `completion:show` | Output the completion script to stdout (useful for custom installation). |
294+
| `completion:uninstall` | Remove the installed completion script. |
275295

276296
## Middleware
277297

0 commit comments

Comments
 (0)