You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/1-essentials/04-console-commands.md
+27-15Lines changed: 27 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -240,7 +240,9 @@ Interactive components are only supported on Mac and Linux. On Windows, Tempest
240
240
241
241
## Shell completion
242
242
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 executable** (`vendor/bin/tempest-complete`) that performs the actual matching.
244
246
245
247
### Installing completions
246
248
@@ -250,28 +252,38 @@ Run the install command and follow the prompts:
250
252
<dim>./</dim>tempest completion:install
251
253
```
252
254
253
-
The installer will detect your current shell, copy the completion script to the appropriate location, and provide instructions for enabling it.
254
-
255
-
For Zsh, you'll need to ensure the completions directory is in your `fpath` and reload completions:
255
+
This will:
256
256
257
-
```zsh
258
-
# Add to ~/.zshrc
259
-
fpath=(~/.zsh/completions $fpath)
260
-
autoload -Uz compinit && compinit
261
-
```
257
+
1. Detect your shell (or use `--shell=zsh` / `--shell=bash`).
258
+
2. Generate completion metadata (`commands.json`) for all registered commands.
259
+
3. Install the completion script to the appropriate location.
262
260
263
-
For Bash, source the completion file in your `~/.bashrc`:
261
+
After installation, add the following line to your shell configuration file and restart your terminal:
264
262
265
263
```bash
266
-
source~/.bash_completion.d/tempest.bash
264
+
# Zsh: add to ~/.zshrc
265
+
source~/.tempest/completion/tempest.zsh
266
+
267
+
# Bash: add to ~/.bashrc
268
+
source~/.tempest/completion/tempest.bash
267
269
```
268
270
269
-
### Additional commands
271
+
### Keeping completions up to date
272
+
273
+
After adding or removing commands, regenerate the metadata:
274
+
275
+
```console
276
+
<dim>./</dim>tempest completion:generate
277
+
```
270
278
271
-
You may also use these related commands:
279
+
### Available commands
272
280
273
-
-`completion:show` — Output the completion script to stdout (useful for custom installation)
274
-
-`completion:uninstall` — Remove the installed completion script
0 commit comments