openclaw config
Manage OpenClaw configuration values programmatically.Usage
Commands
get
Get a configuration value by dot path.Configuration path using dot notation (e.g.,
gateway.port)Output in JSON format
set
Set a configuration value by dot path.Configuration path using dot notation
Value to set (JSON5 or raw string)
Parse value as JSON5 (required for objects/arrays)
unset
Remove a configuration value by dot path.Configuration path using dot notation
Path Notation
Configuration paths use dot notation with support for:- Nested objects:
gateway.auth.token - Arrays:
channels.telegram.accounts[0].token - Bracket notation:
gateway["auth"]["token"] - Escaped dots:
path.with\.dot.in\.key
Examples
After modifying configuration, restart the gateway for changes to take effect:
openclaw gateway restartCommon Configuration Paths
Gateway
gateway.mode- Gateway mode (local or remote)gateway.port- WebSocket port (default: 18789)gateway.bind- Bind mode (loopback, lan, tailnet, auto, custom)gateway.auth.mode- Auth mode (token, password, none)gateway.auth.token- Auth tokengateway.auth.password- Auth password
Agents
agents.defaults.workspace- Default workspace directoryagents.defaults.model.primary- Primary model (e.g., anthropic:claude-4.5-sonnet)agents.defaults.thinkingDefault- Default thinking levelagents.defaults.contextTokens- Max context tokens
Channels
channels.telegram.accounts.default.token- Telegram bot tokenchannels.discord.accounts.default.token- Discord bot tokenchannels.slack.accounts.default.botToken- Slack bot tokenchannels.slack.accounts.default.appToken- Slack app token
Discovery
discovery.wideArea.domain- Wide-area discovery domain
JSON5 Syntax
When setting complex values, use JSON5 syntax with--json:
Configuration File
The configuration file is located at~/.openclaw/openclaw.json and supports:
- JSON5 syntax - Comments, trailing commas, unquoted keys
- Environment variables -
${ENV_VAR}substitution - Includes -
$include: "path/to/other.json5"
Example Configuration
Environment Variable Substitution
Use${VAR_NAME} in config values to reference environment variables:
Configuration Validation
The CLI validates configuration on load. Check for errors with:- Invalid JSON5 syntax
- Missing required fields
- Invalid enum values
- Type mismatches

