Skip to content

shell 命令

Shell 集成和命令补全。

语法

bash
vx shell <subcommand> [options]

子命令

init

生成 shell 集成脚本。

bash
vx shell init <shell>

支持的 shell:

  • bash
  • zsh
  • fish
  • powershell

completions

生成命令补全脚本。

bash
vx shell completions <shell>

示例

设置 Shell 集成

bash
# 添加到 ~/.bashrc
eval "$(vx shell init bash)"
zsh
# 添加到 ~/.zshrc
eval "$(vx shell init zsh)"
fish
# 添加到 ~/.config/fish/config.fish
vx shell init fish | source
powershell
# 添加到 $PROFILE
Invoke-Expression (& vx shell init powershell | Out-String)

安装命令补全

bash
vx shell completions bash > ~/.local/share/bash-completion/completions/vx
zsh
vx shell completions zsh > ~/.zfunc/_vx
fish
vx shell completions fish > ~/.config/fish/completions/vx.fish
powershell
vx shell completions powershell > ~\Documents\PowerShell\Completions\vx.ps1

参见

基于 MIT 许可证发布