# lpm completions (/docs/dev/completions)



```bash
lpm completions <shell>
```

Emits a clap-driven completion script for the given shell to stdout. Pipe the output into your shell's completion-load path and `lpm <TAB>` will start completing subcommands, flags, and value-enums.

The script is generated from the live CLI definition, so it stays in sync with the binary at every release — no separately maintained completion files to drift out of date.

## Supported shells [#supported-shells]

| Shell      | Argument     | Typical install path                                                                             |
| ---------- | ------------ | ------------------------------------------------------------------------------------------------ |
| Bash       | `bash`       | `/etc/bash_completion.d/lpm` (system) or `~/.local/share/bash-completion/completions/lpm` (user) |
| Zsh        | `zsh`        | A directory in `$fpath`, e.g. `${fpath[1]}/_lpm` or `~/.zfunc/_lpm`                              |
| Fish       | `fish`       | `~/.config/fish/completions/lpm.fish`                                                            |
| PowerShell | `powershell` | Sourced from `$PROFILE` via `Invoke-Expression`                                                  |
| Elvish     | `elvish`     | Source from `~/.config/elvish/rc.elv`                                                            |

## Examples [#examples]

```bash
# Zsh — point fpath at a user dir, generate, restart the shell
mkdir -p ~/.zfunc && lpm completions zsh > ~/.zfunc/_lpm
echo 'fpath=(~/.zfunc $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc

# Bash (system-wide, requires sudo)
lpm completions bash | sudo tee /etc/bash_completion.d/lpm > /dev/null

# Bash (per-user)
mkdir -p ~/.local/share/bash-completion/completions
lpm completions bash > ~/.local/share/bash-completion/completions/lpm

# Fish
lpm completions fish > ~/.config/fish/completions/lpm.fish

# PowerShell — append to your profile
lpm completions powershell | Out-String | Invoke-Expression
# Or, persistently:
lpm completions powershell >> $PROFILE
```

## Flags [#flags]

`lpm completions` takes the target shell as a positional argument and otherwise has no specific flags. The [global flags](/docs/commands#global-flags) (`--json`, `--verbose`, etc.) do not affect the generated script.

## See also [#see-also]

* [`lpm self-update`](/docs/infra/self-update) — keep the binary current so completions reflect the latest commands
* [Installation](/docs/installation) — get LPM installed before generating completions
