Zum Hauptinhalt springen

CLI-Automatisierung

Verwende --non-interactive, um openclaw onboard zu automatisieren.
--json impliziert keinen nicht interaktiven Modus. Verwende --non-interactive (und --workspace) für Skripte.

Grundlegendes nicht interaktives Beispiel

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
Füge --json für eine maschinenlesbare Zusammenfassung hinzu. Verwende --secret-input-mode ref, um env-gestützte Referenzen in Auth-Profilen anstelle von Klartextwerten zu speichern. Die interaktive Auswahl zwischen env-Referenzen und konfigurierten Provider-Referenzen (file oder exec) ist im Onboarding-Ablauf verfügbar. Im nicht interaktiven ref-Modus müssen Provider-env-vars in der Prozessumgebung gesetzt sein. Das Übergeben von Inline-Key-Flags ohne die passende env var schlägt jetzt sofort fehl. Beispiel:
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice openai-api-key \
  --secret-input-mode ref \
  --accept-risk

Provider-spezifische Beispiele

openclaw onboard --non-interactive \
  --mode local \
  --auth-choice anthropic-cli \
  --gateway-port 18789 \
  --gateway-bind loopback
Erfordert, dass Claude CLI bereits auf demselben Gateway- Host installiert und angemeldet ist.
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice gemini-api-key \
  --gemini-api-key "$GEMINI_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice zai-api-key \
  --zai-api-key "$ZAI_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
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
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
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice moonshot-api-key \
  --moonshot-api-key "$MOONSHOT_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice mistral-api-key \
  --mistral-api-key "$MISTRAL_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice synthetic-api-key \
  --synthetic-api-key "$SYNTHETIC_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice opencode-zen \
  --opencode-zen-api-key "$OPENCODE_API_KEY" \
  --gateway-port 18789 \
  --gateway-bind loopback
Wechsle zu --auth-choice opencode-go --opencode-go-api-key "$OPENCODE_API_KEY" für den Go-Katalog.
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice ollama \
  --custom-model-id "qwen3.5:27b" \
  --accept-risk \
  --gateway-port 18789 \
  --gateway-bind loopback
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 ist optional. Wenn es weggelassen wird, prüft das Onboarding CUSTOM_API_KEY.Ref-Modus-Variante:
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
In diesem Modus speichert das Onboarding apiKey als { source: "env", provider: "default", id: "CUSTOM_API_KEY" }.
Anthropic-Setup-Token ist wieder als Legacy-/manueller Onboarding-Pfad verfügbar. Verwende ihn in der Erwartung, dass Anthropic OpenClaw-Nutzern mitgeteilt hat, dass der OpenClaw- Claude-Login-Pfad Extra Usage erfordert. Für den produktiven Einsatz solltest du einen Anthropic-API-Schlüssel bevorzugen.

Einen weiteren Agenten hinzufügen

Verwende openclaw agents add <name>, um einen separaten Agenten mit eigenem Workspace, Sessions und Auth-Profilen zu erstellen. Wenn du es ohne --workspace ausführst, startet der Assistent.
openclaw agents add work \
  --workspace ~/.openclaw/workspace-work \
  --model openai/gpt-5.4 \
  --bind whatsapp:biz \
  --non-interactive \
  --json
Was gesetzt wird:
  • agents.list[].name
  • agents.list[].workspace
  • agents.list[].agentDir
Hinweise:
  • Standard-Workspaces folgen ~/.openclaw/workspace-<agentId>.
  • Füge bindings hinzu, um eingehende Nachrichten zu routen (der Assistent kann das tun).
  • Nicht interaktive Flags: --model, --agent-dir, --bind, --non-interactive.

Zugehörige Docs