Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: completion #508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/cli/completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
id: completion
title: pnpm completion
---

Print shell completion code to stdout.

```text
pnpm completion <shell>
```

## Parameters

### &lt;shell&gt;

Shell to print completion code for. Only 4 shells are supported: `bash`, `fish`, `pwsh`, `zsh`.

## Examples

### Activate completion for Bash by sourcing it from ~/.bashrc

```bash
pnpm completion bash > ~/completion-for-pnpm.bash
echo 'source ~/completion-for-pnpm.bash' >> ~/.bashrc
```

### Install completion for Bash directly to its completion directory (for installing pnpm as a Linux distro package)

```bash
mkdir -p /usr/share/bash-completion/completions/
pnpm completion bash > /usr/share/bash-completion/completions/pnpm
```
3 changes: 2 additions & 1 deletion sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"cli/init",
"cli/deploy",
"cli/doctor",
"cli/config"
"cli/config",
"cli/completion"
]
}
],
Expand Down
Loading