fabro/docs/reference/shell-completions.mdx
Bryan Helmkamp 93aa239056 Add fabro completion subcommand for shell completions
Uses clap_complete to generate tab-completion scripts for zsh, fish,
elvish, and PowerShell. Bash generation is caught gracefully since
clap_complete panics with #[command(flatten)] subcommands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:17:38 -04:00

70 lines
1.1 KiB
Text

---
title: "Shell Completions"
description: "Set up tab completion for the fabro CLI in your shell"
---
The `fabro completion` command generates shell completion scripts for tab-completing commands, flags, and arguments.
## Bash
Add to your `~/.bashrc`:
```bash
eval "$(fabro completion bash)"
```
Or generate a file and source it:
```bash
fabro completion bash > ~/.local/share/bash-completion/completions/fabro
```
## Zsh
Add to your `~/.zshrc` (before `compinit`):
```bash
eval "$(fabro completion zsh)"
```
Or generate a file:
```bash
fabro completion zsh > "${fpath[1]}/_fabro"
```
You may need to run `compinit` or start a new shell session for changes to take effect.
## Fish
```bash
fabro completion fish | source
```
Or persist to the completions directory:
```bash
fabro completion fish > ~/.config/fish/completions/fabro.fish
```
## PowerShell
Add to your PowerShell profile:
```powershell
fabro completion powershell | Out-String | Invoke-Expression
```
## Elvish
```bash
eval (fabro completion elvish | slurp)
```
## Supported shells
Run `fabro completion --help` to see all supported shells:
```bash
fabro completion --help
```