> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcanonic.app/llms.txt
> Use this file to discover all available pages before exploring further.

# canonic completion

> Print a shell completion script for canonic.

```bash theme={null}
canonic completion                     # auto-detects your shell
canonic completion --shell zsh
canonic completion --shell bash
canonic completion --shell fish
```

Prints a shell completion script for `canonic` (and the `can` alias) to stdout. It's powered by Click's built-in completion machinery, so it stays in sync with the command tree automatically. Wire it into your shell:

```bash theme={null}
# zsh: add to ~/.zshrc
eval "$(canonic completion --shell zsh)"

# bash
canonic completion --shell bash > ~/.bash_completion.d/canonic

# fish
canonic completion --shell fish > ~/.config/fish/completions/canonic.fish
```

| Flag      | Description                                                                  |
| --------- | ---------------------------------------------------------------------------- |
| `--shell` | `bash`, `zsh`, or `fish`. Auto-detected from the running shell when omitted. |

Exits `1` with a clear message if the shell can't be detected and `--shell` is omitted, or if the given `--shell` isn't one of the three supported.
