명령줄 탭 자동 완성

Unlike other popular package managers, which usually require plugins, pnpm supports command line tab-completion for Bash, Fish, PowerShell, and Zsh.

pnpm completion <shell> prints completion code to standard output. Supported shell names are bash, fish, pwsh, and zsh.

Bash 자동 완성을 설정하려면 다음을 실행하세요:

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

Fish 자동 완성을 설정하려면 다음을 실행하세요:

pnpm completion fish > ~/.config/fish/completions/pnpm.fish

To setup autocompletion for Zsh, run:

pnpm completion zsh > ~/completion-for-pnpm.zsh
echo 'source ~/completion-for-pnpm.zsh' >> ~/.zshrc

To setup autocompletion for PowerShell, run:

pnpm completion pwsh >> $PROFILE

Any other shell name fails with ERR_PNPM_UNSUPPORTED_SHELL.

Since v12.4.0, the generated completions cover the pn alias as well, in Bash, Fish, PowerShell, and Zsh.

g-plane/pnpm-shell-completion#

pnpm-shell-completion is a shell plugin maintained by Pig Fang on GitHub.

기능:

  • 워크스페이스의 패키지에서도 pnpm remove 명령에 대한 자동 완성을 제공합니다(--filter 옵션 지정 시).