Skip to content

openclaw completion

生成 shell 补全脚本,并可选择将其安装到你的 shell profile 中。

用法

bash
openclaw completion
openclaw completion --shell zsh
openclaw completion --install
openclaw completion --shell fish --install
openclaw completion --write-state
openclaw completion --shell bash --write-state

选项

  • -s, --shell <shell>:目标 shell(zshbashpowershellfish;默认:zsh
  • -i, --install:通过向 shell profile 添加 source 行来安装补全
  • --write-state:将补全脚本写入 $OPENCLAW_STATE_DIR/completions,而不是打印到 stdout
  • -y, --yes:跳过安装确认提示

注意事项

  • --install 会在你的 shell profile 中写入一个小的"OpenClaw Completion"代码块,并将其指向缓存的脚本。
  • 不带 --install--write-state 时,命令会将脚本打印到 stdout。
  • 补全生成会预先加载命令树,因此嵌套子命令也会包含在内。