Guides

CLI 자동화

--non-interactive를 사용하여 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을 추가하세요.

자동화에서 워크스페이스 파일을 미리 준비하고 온보딩이 기본 부트스트랩 파일을 생성하지 않게 하려면 --skip-bootstrap을 사용하세요.

일반 텍스트 값 대신 인증 프로필에 환경 변수 기반 참조를 저장하려면 --secret-input-mode ref를 사용하세요. 온보딩 흐름에서는 환경 변수 참조와 구성된 제공자 참조(file 또는 exec) 중에서 대화형으로 선택할 수 있습니다.

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

예시:

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

제공자별 예시

Anthropic API key example
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice apiKey \
  --anthropic-api-key "$ANTHROPIC_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
Gemini example
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 example
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 example
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 example
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 example
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice moonshot-api-key \
  --moonshot-api-key "$MOONSHOT_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
Mistral example
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice mistral-api-key \
  --mistral-api-key "$MISTRAL_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
Synthetic example
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice synthetic-api-key \
  --synthetic-api-key "$SYNTHETIC_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
OpenCode example
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 example
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice ollama \
  --custom-model-id "qwen3.5:27b" \
  --accept-risk \
  --gateway-port 18789 \
  --gateway-bind loopback
Custom provider example
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 \
  --custom-image-input \
  --gateway-port 18789 \
  --gateway-bind loopback

--custom-api-key는 선택 사항입니다. 생략하면 온보딩이 CUSTOM_API_KEY를 확인합니다. OpenClaw는 일반적인 비전 모델 ID를 이미지 지원으로 자동 표시합니다. 알 수 없는 커스텀 비전 ID에는 --custom-image-input을 추가하고, 텍스트 전용 메타데이터를 강제하려면 --custom-text-input을 추가하세요.

Ref 모드 변형:

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 \
  --custom-image-input \
  --gateway-port 18789 \
  --gateway-bind loopback

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

Anthropic 설정 토큰은 지원되는 온보딩 토큰 경로로 계속 사용할 수 있지만, OpenClaw는 이제 사용할 수 있는 경우 Claude CLI 재사용을 선호합니다. 프로덕션에서는 Anthropic API 키를 사용하는 것이 좋습니다.

다른 에이전트 추가

openclaw agents add <name>을 사용하여 자체 워크스페이스, 세션, 인증 프로필을 가진 별도의 에이전트를 생성합니다. --workspace 없이 실행하면 마법사가 시작됩니다.

openclaw agents add work \
  --workspace ~/.openclaw/workspace-work \
  --model openai/gpt-5.5 \
  --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.

관련 문서