Skip to main content

CLI Automation

Use --non-interactive to automate openclaw onboard.
--json does not imply non-interactive mode. Use --non-interactive (and --workspace) for scripts.

Baseline non-interactive example

Add --json for a machine-readable summary. Use --secret-input-mode ref to store env-backed refs in auth profiles instead of plaintext values. Interactive selection between env refs and configured provider refs (file or exec) is available in the onboarding wizard flow. In non-interactive ref mode, provider env vars must be set in the process environment. Passing inline key flags without the matching env var now fails fast. Example:

Provider-specific examples

--custom-api-key is optional. If omitted, onboarding checks CUSTOM_API_KEY.Ref-mode variant:
In this mode, onboarding stores apiKey as { source: "env", provider: "default", id: "CUSTOM_API_KEY" }.

Add another agent

Use openclaw agents add <name> to create a separate agent with its own workspace, sessions, and auth profiles. Running without --workspace launches the wizard.
What it sets:
  • agents.list[].name
  • agents.list[].workspace
  • agents.list[].agentDir
Notes:
  • Default workspaces follow ~/.openclaw/workspace-<agentId>.
  • Add bindings to route inbound messages (the wizard can do this).
  • Non-interactive flags: --model, --agent-dir, --bind, --non-interactive.