使用 --non-interactive 标志在脚本或 CI 中自动化 openclaw onboard。
基础非交互示例
openclaw onboard --non-interactive \
--mode local \
--auth-choice apiKey \
--anthropic-api-key "$ANTHROPIC_API_KEY" \
--secret-input-mode plaintext \
--gateway-port 18789 \
--gateway-bind loopback \
--install-daemon \
--daemon-runtime node \
--skip-bootstrap \
--skip-skills添加 --json 获取机器可读摘要。
关键参数说明
| 参数 | 说明 |
|---|---|
--non-interactive | 非交互模式(脚本必须) |
--skip-bootstrap | 跳过默认引导文件创建(预置工作区时使用) |
--secret-input-mode ref | 存储环境变量引用而非明文密钥 |
--json | 输出机器可读摘要 |
各 Provider 示例
Anthropic API Key:
openclaw onboard --non-interactive \
--mode local \
--auth-choice apiKey \
--anthropic-api-key "$ANTHROPIC_API_KEY" \
--gateway-port 18789 \
--gateway-bind loopbackOllama(本地模型):
openclaw onboard --non-interactive \
--mode local \
--auth-choice ollama \
--custom-model-id "qwen3.5:27b" \
--accept-risk \
--gateway-port 18789 \
--gateway-bind loopback自定义 Provider:
openclaw onboard --non-interactive \
--mode local \
--auth-choice custom-api-key \
--custom-base-url "https://llm.example.com/v1" \
--custom-model-id "foo-large" \
--custom-api-key "$CUSTOM_API_KEY" \
--custom-provider-id "my-custom" \
--custom-compatibility anthropic \
--gateway-port 18789 \
--gateway-bind loopback添加额外 Agent
openclaw agents add work \
--workspace ~/.openclaw/workspace-work \
--model openai/gpt-5.5 \
--bind whatsapp:biz \
--non-interactive \
--json相关链接
- start-wizard-cli-reference — CLI 设置完整参考
- start-onboarding — 个人助手设置指南