openclaw completion
为常见 Shell 生成命令自动补全脚本,提升命令行使用效率。
命令签名
bash
openclaw completion <shell>支持的 Shell
| Shell | 参数值 |
|---|---|
| Bash | bash |
| Zsh | zsh |
| Fish | fish |
| PowerShell | powershell |
安装方法
Bash
bash
# 写入 .bashrc(立即生效需重新加载)
openclaw completion bash >> ~/.bashrc
# 或写入独立文件
openclaw completion bash > /etc/bash_completion.d/openclawZsh
bash
# 写入 .zshrc
openclaw completion zsh >> ~/.zshrc
# 或放到补全目录(需 fpath 包含该目录)
openclaw completion zsh > "${fpath[1]}/_openclaw"Fish
bash
openclaw completion fish > ~/.config/fish/completions/openclaw.fishPowerShell
powershell
# 追加到 PowerShell 配置
openclaw completion powershell >> $PROFILE
# 或在当前会话加载
openclaw completion powershell | Out-String | Invoke-Expression示例
bash
# 生成 Bash 补全脚本(输出到终端)
openclaw completion bash
# 为 Zsh 生成并安装
openclaw completion zsh >> ~/.zshrc && source ~/.zshrc
# Fish 安装
openclaw completion fish > ~/.config/fish/completions/openclaw.fish验证
安装补全后,输入 openclaw 并按 Tab 键,应能看到可用的子命令和选项提示。
bash
openclaw a<TAB>
# 输出: acp agent agents approvalsTIP
修改 Shell 配置文件后,需要重新加载(source ~/.bashrc)或重新打开终端才能生效。
另请参阅
- CLI 概览 — 所有命令一览
openclaw docs— 文档访问
