OpenClaw 命令行完整版 OpenClaw 常用指令大全_持续更新

内容管家 AI领域评论80字数 1985阅读6分37秒阅读模式
OpenClaw 命令行完整版 OpenClaw 常用指令大全_持续更新插图

OpenClaw 完整命令行参考指南 全命令汇总 持续更新

OpenClaw 提供了丰富的命令行工具,支持从基础设置到高级自动化的完整功能集。本文档汇总了所有可用的 CLI 命令和选项。以下内容同步自 OpenClaw 官方 CLI 文档(2026-05-29 同步),包含完整命令树、全局标志、输出模式、Chat 斜杠命令等内容。本文会持续更新,建议收藏。

openclaw is the main CLI entry point. Each core command has either a
dedicated reference page or is documented with the command it aliases; this
index lists the commands, the global flags, and the output styling rules that
apply across the CLI.

Use the setup commands by intent:

  • openclaw setup creates the baseline config and workspace without walking the full guided onboarding flow.
  • openclaw onboard is the full guided first-run path for gateway, model auth, workspace, channels, skills, and health.
  • openclaw configure changes targeted parts of an existing setup, such as model auth, gateway, channels, plugins, or skills.
  • openclaw channels add configures channel accounts after the baseline exists; run it without flags for guided channel setup or with channel-specific flags for scripts.

Command pages

Area Commands
Setup and onboarding crestodian · setup · onboard · configure · config · completion · doctor · dashboard
Reset and uninstall backup · reset · uninstall · update
Messaging and agents message · agent · agents · acp · mcp
Health and sessions status · health · sessions
Gateway and logs gateway · logs · system
Models and inference models · infer · capability (alias for infer) · memory · commitments · wiki
Network and nodes directory · nodes · devices · node
Runtime and sandbox approvals · exec-policy (see approvals) · sandbox · tui · chat/terminal (aliases for tui --local) · browser
Automation cron · tasks · hooks · webhooks · transcripts
Discovery and docs dns · docs
Pairing and channels pairing · qr · channels
Security and plugins security · secrets · skills · plugins · proxy
Legacy aliases daemon (gateway service) · clawbot (namespace)
Plugins (optional) path · policy · voicecall (if installed)

Global flags

Flag Purpose
--dev Isolate state under ~/.openclaw-dev and shift default ports
--profile Isolate state under ~/.openclaw-
--container Target a named container for execution
--no-color Disable ANSI colors (NO_COLOR=1 is also respected)
--update Shorthand for openclaw update (source installs only)
-V, --version, -v Print version and exit

Output modes

  • ANSI colors and progress indicators render only in TTY sessions.
  • OSC-8 hyperlinks render as clickable links where supported; otherwise the

CLI falls back to plain URLs.

  • --json (and --plain where supported) disables styling for clean output.
  • Long-running commands show a progress indicator (OSC 9;4 when supported).

Palette source of truth: src/terminal/palette.ts.

Command tree

openclaw [--dev] [--profile <name>] <command>
  crestodian
  setup
  onboard
  configure
  config
    get
    set
    unset
    file
    schema
    validate
  completion
  doctor
  dashboard
  backup
    create
    verify
  security
    audit
  secrets
    reload
    audit
    configure
    apply
  reset
  uninstall
  update
    wizard
    status
  channels
    list
    status
    capabilities
    resolve
    logs
    add
    remove
    login
    logout
  directory
    self
    peers list
    groups list|members
  skills
    search
    install
    update
    list
    info
    check
  plugins
    list
    inspect
    install
    uninstall
    update
    enable
    disable
    doctor
    marketplace list
  memory
    status
    index
    search
  transcripts
    list
    show
    path
  path
    resolve
    find
    set
    validate
    emit
  commitments
    list
    dismiss
  wiki
    status
    doctor
    init
    ingest
    compile
    lint
    search
    get
    apply
    bridge import
    unsafe-local import
    obsidian status|search|open|command|daily
  message
    send
    broadcast
    poll
    react
    reactions
    read
    edit
    delete
    pin
    unpin
    pins
    permissions
    search
    thread create|list|reply
    emoji list|upload
    sticker send|upload
    role info|add|remove
    channel info|list
    member info
    voice status
    event list|create
    timeout
    kick
    ban
  agent
  agents
    list
    add
    delete
    bindings
    bind
    unbind
    set-identity
  acp
  mcp
    serve
    list
    show
    set
    unset
  status
  health
  sessions
    cleanup
  tasks
    list
    audit
    maintenance
    show
    notify
    cancel
    flow list|show|cancel
  gateway
    call
    usage-cost
    health
    status
    probe
    discover
    install
    uninstall
    start
    stop
    restart
    run
  daemon
    status
    install
    uninstall
    start
    stop
    restart
  logs
  system
    event
    heartbeat last|enable|disable
    presence
  models
    list
    status
    set
    set-image
    aliases list|add|remove
    fallbacks list|add|remove|clear
    image-fallbacks list|add|remove|clear
    scan
  infer (alias: capability)
    list
    inspect
    model run|list|inspect|providers|auth login|logout|status
    image generate|edit|describe|describe-many|providers
    audio transcribe|providers
    tts convert|voices|providers|status|enable|disable|set-provider
    video generate|describe|providers
    web search|fetch|providers
    embedding create|providers
    auth add|login|login-github-copilot|setup-token|paste-token
    auth order get|set|clear
  sandbox
    list
    recreate
    explain
  cron
    status
    list
    get
    add
    edit
    rm
    enable
    disable
    runs
    run
  nodes
    status
    describe
    list
    pending
    approve
    reject
    rename
    invoke
    notify
    push
    canvas snapshot|present|hide|navigate|eval
    canvas a2ui push|reset
    camera list|snap|clip
    screen record
    location get
  devices
    list
    remove
    clear
    approve
    reject
    rotate
    revoke
  node
    run
    status
    install
    uninstall
    stop
    restart
  approvals
    get
    set
    allowlist add|remove
  exec-policy
    show
    preset
    set
  browser
    status
    start
    stop
    reset-profile
    tabs
    open
    focus
    close
    profiles
    create-profile
    delete-profile
    screenshot
    snapshot
    navigate
    resize
    click
    type
    press
    hover
    drag
    select
    upload
    fill
    dialog
    wait
    evaluate
    console
    pdf
  hooks
    list
    info
    check
    enable
    disable
    install
    update
  webhooks
    gmail setup|run
  proxy
    start
    run
    coverage
    sessions
    query
    blob
    purge
  pairing
    list
    approve
  qr
  clawbot
    qr
  docs
  dns
    setup
  tui
  chat (alias: tui --local)
  terminal (alias: tui --local)

Plugins can add additional top-level commands (for example openclaw voicecall).

Chat slash commands

Chat messages support /... commands. See slash commands.

Highlights:

  • /status — quick diagnostics.
  • /trace — session-scoped plugin trace/debug lines.
  • /config — persisted config changes.
  • /debug — runtime-only config overrides (memory, not disk; requires commands.debug: true).

Usage tracking

openclaw status --usage and the Control UI surface provider usage/quota when
OAuth/API credentials are available. Data comes directly from provider usage
endpoints and is normalized to X% left. Providers with current usage
windows: Anthropic, GitHub Copilot, Gemini CLI, OpenAI Codex, MiniMax,
Xiaomi, and z.ai.

See Usage tracking for details.

Related

安装与初始化

推荐安装方式

使用安装脚本是最简单的方式,会自动检测并安装 Node.js:

# macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash

# Windows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex

跳过向导仅安装二进制:

curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

npm/pnpm 安装

# npm 安装
npm install -g openclaw@latest
openclaw onboard --install-daemon

# pnpm 安装
pnpm add -g openclaw@latest
pnpm approve-builds -g
openclaw onboard --install-daemon

高频使用命令速查

基础设置与配置

  • openclaw setup — 初始化配置和工作区(不运行完整向导)
  • openclaw onboard — 完整交互式向导:网关、模型认证、工作区、频道、技能、健康检查
  • openclaw configure — 更改已有配置的特定部分(模型认证、网关、频道、插件、技能)
  • openclaw crestodian — 安全的免配置设置和修复助手
  • openclaw config get/set/unset/file/schema/validate — 非交互式配置管理
  • openclaw completion — 生成/安装 Shell 补全脚本

状态监控

  • openclaw status — 查看网关状态、会话健康状况
  • openclaw status --usage — 查看提供商使用量/配额
  • openclaw gateway status — 检查网关服务状态
  • openclaw channels status — 检查频道健康状况
  • openclaw models status — 查看模型状态
  • openclaw health — 网关健康快照(RPC)
  • openclaw logs — 查看网关日志
  • openclaw doctor — 健康检查和引导修复

消息与通信

  • openclaw message send — 发送消息
  • openclaw message broadcast — 广播消息
  • openclaw message poll/react/read/edit/delete — 消息操作
  • openclaw message pin/unpin/pins — 消息置顶
  • openclaw message thread create|list|reply — 消息线程
  • openclaw message emoji list|upload — 表情管理
  • openclaw channels list/add/remove — 频道管理
  • openclaw channels login/logout — 频道登录/登出

推理与模型管理

  • openclaw models list/status/set — 模型列表和状态
  • openclaw models aliases/fallbacks — 别名和故障转移管理
  • openclaw infer model run — 运行模型推理
  • openclaw infer image generate/edit/describe — 图像生成/编辑/描述
  • openclaw infer audio transcribe — 音频转文字
  • openclaw infer tts convert — 文本转语音
  • openclaw infer video generate/describe — 视频生成/描述
  • openclaw infer web search/fetch — 网页搜索/抓取
  • openclaw infer embedding create — 创建嵌入向量

自动化与调度

  • openclaw cron list/add/edit/rm — 定时任务管理
  • openclaw tasks list/show/cancel — 后台任务管理
  • openclaw tasks flow list|show|cancel — Task Flow 状态
  • openclaw hooks list/enable/disable — 钩子管理
  • openclaw webhooks gmail setup|run — Gmail Pub/Sub

MCP 与代理

  • openclaw mcp serve — 通过 MCP 暴露会话
  • openclaw mcp list/show/set/unset — MCP 服务器定义管理
  • openclaw agent — 发送代理轮次
  • openclaw agents list/add/delete/bind/unbind — 代理管理
  • openclaw acp — ACP 桥接(IDE 集成)

知识与记忆

  • openclaw memory status/index/search — 记忆文件管理
  • openclaw wiki status/search/compile/apply — Wiki 知识库
  • openclaw wiki obsidian status|search|openObsidian 集成
  • openclaw commitments list/dismiss — 跟进承诺管理
  • openclaw transcripts list/show — 会话记录

安全与维护

  • openclaw security audit — 安全审计
  • openclaw secrets reload/audit/configure/apply — 密钥管理
  • openclaw approvals get/set — 审批策略
  • openclaw exec-policy show/preset/set — 执行策略
  • openclaw sandbox list/recreate/explain — 沙盒管理
  • openclaw proxy start/run/coverage — 代理调试
  • openclaw backup create/verify — 备份管理
  • openclaw reset — 重置本地配置/状态
  • openclaw uninstall — 卸载网关服务

节点与设备

  • openclaw nodes status/list/describe — 节点状态
  • openclaw nodes invoke — 远程节点执行
  • openclaw nodes canvas snapshot|present|navigate — 画布操作
  • openclaw nodes camera list|snap|clip — 摄像头操作
  • openclaw nodes screen record — 屏幕录制
  • openclaw devices list/approve/reject/rotate/revoke — 设备管理

浏览器控制

  • openclaw browser start/stop/status — 浏览器服务管理
  • openclaw browser open/navigate — 页面导航
  • openclaw browser click/type/press/hover/drag — UI 交互
  • openclaw browser screenshot/snapshot/pdf — 截图和导出

实用技巧

  • 使用 --json 参数获取机器可读的输出
  • 使用 --no-color 禁用颜色输出(适合脚本)
  • 使用 --container <name> 指定容器执行
  • 聊天消息支持 /status, /config, /trace, /debug 等斜杠命令
  • OSC-8 超链接在支持的终端中可点击
  • 大多数插件更改需要网关重启

总结

OpenClaw 的命令行工具集提供了从简单配置到复杂自动化的完整解决方案。通过合理组合这些命令,可以构建强大的 AI 助手工作流,实现跨平台的消息处理、自动化任务执行和智能决策支持。

建议收藏本文,以便随时查阅。

 最后更新:2026-5-29
内容管家

发表评论