跳到主内容
版本:9.x

命令行 tab 自动补全

提示

Completion for pnpm v9 is incompatible with completion for older pnpm versions. If you already install pnpm completion for version older than v9, you must uninstall it first so that completion for v9 may work properly. You may do so by removing section of code that contains __tabtab in your dot files.

与其他通常需要插件的流行包管理器不同,pnpm 支持 Bash、Zsh、Fish 和类似 shell 的命令行制表符补全。

To setup autocompletion for Bash, run:

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

To see examples of completion, read this article.

Fig(仅限macOS)

You can get IDE-style autocompletions for pnpm with Fig. 它适用于 Bash、Zsh 和 Fish。

要安装,请运行:

brew install fig

g-plane/pnpm-shell-completion

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

特性:

  • Provide completion for pnpm --filter <package>.
  • Provide completion for pnpm remove command, even in workspace's packages (by specifying --filter option).
  • Provide completion for scripts in package.json.