CLI 자동화

--non-interactive를 사용하여 openclaw onboard를 자동화할 수 있습니다.

참고: --json은 비대화형 모드를 의미하지 않습니다. 스크립트에서는 --non-interactive(및 --workspace)를 사용하세요.

기본 비대화형 예제

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-skills

--json을 추가하면 머신이 읽을 수 있는 요약을 출력합니다.

--secret-input-mode ref를 사용하면 평문 값 대신 환경 변수 기반 참조를 인증 프로필에 저장합니다. 대화형 온보딩 마법사 흐름에서는 환경 변수 참조와 설정된 프로바이더 참조(file 또는 exec) 간 선택이 가능합니다.

비대화형 ref 모드에서는 프로바이더 환경 변수가 프로세스 환경에 설정되어 있어야 합니다. 해당 환경 변수 없이 인라인 키 플래그를 전달하면 즉시 실패합니다.

예시:

openclaw onboard --non-interactive \
  --mode local \
  --auth-choice openai-api-key \
  --secret-input-mode ref \
  --accept-risk

프로바이더별 예제

Gemini 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice gemini-api-key \
  --gemini-api-key "$GEMINI_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
Z.AI 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice zai-api-key \
  --zai-api-key "$ZAI_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
Vercel AI Gateway 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice ai-gateway-api-key \
  --ai-gateway-api-key "$AI_GATEWAY_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
Cloudflare AI Gateway 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice cloudflare-ai-gateway-api-key \
  --cloudflare-ai-gateway-account-id "your-account-id" \
  --cloudflare-ai-gateway-gateway-id "your-gateway-id" \
  --cloudflare-ai-gateway-api-key "$CLOUDFLARE_AI_GATEWAY_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
Moonshot 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice moonshot-api-key \
  --moonshot-api-key "$MOONSHOT_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
Mistral 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice mistral-api-key \
  --mistral-api-key "$MISTRAL_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
Synthetic 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice synthetic-api-key \
  --synthetic-api-key "$SYNTHETIC_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
OpenCode 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice opencode-zen \
  --opencode-zen-api-key "$OPENCODE_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
```
Go 카탈로그를 사용하려면 `--auth-choice opencode-go --opencode-go-api-key "$OPENCODE_API_KEY"`로 변경하세요.
Ollama 예제
```bash
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice ollama \
  --custom-model-id "qwen3.5:27b" \
  --accept-risk \
  --gateway-port 18789 \
  --gateway-bind loopback
```
커스텀 프로바이더 예제
```bash
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
```

`--custom-api-key`는 선택 사항입니다. 생략하면 온보딩이 `CUSTOM_API_KEY`를 확인합니다.

Ref 모드 변형:

```bash
export CUSTOM_API_KEY="your-key"
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice custom-api-key \
  --custom-base-url "https://llm.example.com/v1" \
  --custom-model-id "foo-large" \
  --secret-input-mode ref \
  --custom-provider-id "my-custom" \
  --custom-compatibility anthropic \
  --gateway-port 18789 \
  --gateway-bind loopback
```

이 모드에서는 온보딩이 `apiKey`를 `{ source: "env", provider: "default", id: "CUSTOM_API_KEY" }`로 저장합니다.

에이전트 추가

openclaw agents add <name>으로 별도의 워크스페이스, 세션, 인증 프로필을 가진 에이전트를 추가할 수 있습니다. --workspace 없이 실행하면 마법사가 시작됩니다.

openclaw agents add work \
  --workspace ~/.openclaw/workspace-work \
  --model openai/gpt-5.2 \
  --bind whatsapp:biz \
  --non-interactive \
  --json

설정되는 항목:

  • agents.list[].name
  • agents.list[].workspace
  • agents.list[].agentDir

참고:

  • 기본 워크스페이스는 ~/.openclaw/workspace-<agentId> 형식을 따릅니다.
  • bindings를 추가하여 인바운드 메시지를 라우팅할 수 있습니다(마법사로도 가능).
  • 비대화형 플래그: --model, --agent-dir, --bind, --non-interactive.

관련 문서