Openclaw Config Commands and Uses

O

Complete reference for openclaw config, reading, writing, unsetting, and validating configuration values using dot and bracket path notation.

What does Openclaw Config Manage?

It’s the CLI interface to OpenClaw’s configuration file, the same file the Gateway reads on startup. Instead of opening the file directly, you use config get and config set to read and write specific values using a path syntax that supports both dot notation and array bracket indexing. The config file location is either the default path or whatever OPENCLAW_CONFIG_PATH points to run config file to see exactly which file is active before making any changes.

Finding the Right Subcommand

Start with config file to confirm which config file is in play, then config validate to check the current state before editing. Use config get to read a value before overwriting it. For any config set call that involves arrays, booleans, or numbers, always pass –strict-json, omitting it can silently save a number as a string, which the Gateway will reject at runtime. After any change, restart the Gateway for it to take effect.

Quick Reference

All five subcommands at a glance before the detailed breakdown.

all subcommands

openclaw config file                             # print active config file path
openclaw config get     <path>                    # read a value
openclaw config set     <path> <value>           # write a value
openclaw config unset   <path>                    # remove a value
openclaw config validate                          # validate against schema

Subcommand Reference

Detailed behavior for each subcommand, including edge cases and flags.

openclaw configfile
Prints the active configuration file path, either the default location or the path resolved from the OPENCLAW_CONFIG_PATH environment variable. Run this first to confirm which file any subsequent get / set calls are targeting.
openclaw configget<path>
Retrieves and prints a specific configuration value using dot or bracket notation. Returns the current value as stored in the config file, including type information, useful for confirming whether a value was saved as a string vs. a boolean/number.
Use config get before config set to snapshot the current value. If something breaks after a change, you’ll have the original to restore.
openclaw configset<path><value>
Sets a specific configuration value. OpenClaw attempts to parse the provided value as JSON5 first, if parsing fails, it falls back to treating the value as a raw string. For values that must be arrays, booleans, or numbers, use –strict-json to prevent accidental string coercion.
openclaw configunset<path>
Removes a specific value from the configuration file entirely, reverting it to the Gateway default (if one exists for that key). Use this instead of config set with an empty value, unsetting cleanly removes the key rather than writing an empty string.
openclaw configvalidate
Validates your current configuration against the schema without needing to start the Gateway. Catches type mismatches, missing required fields, and unrecognised keys before they cause a silent runtime failure. Append –json to emit machine-readable JSON output, useful for CI pipelines or automated config checks.
Run config validate after every config set call as a sanity check, especially when writing complex values like arrays or nested objects.

Path Syntax

When specifying paths for get, set, and unset, you can use dot notation or bracket notation. Both forms are equivalent, brackets are particularly useful when targeting specific array indices.

Dot notation
# Traverse nested keysagents.list.id
gateway.port
channels.whatsapp.groups
Bracket notation
# Target a specific array indexagents.list[6].tools
agents.list[0].model
channels.slack[1].token

path syntax examples

# Dot notation — traverse a nested key
openclaw config get agents.list.id

# Bracket notation — target index 6 in the agents array
openclaw config set agents.list[6].tools.exec.node "node-id-or-name"

Array indices are zero-based. Use config get agents.list first to inspect the full array and confirm the index you intend to target before writing to it.

Value Parsing & –strict-json

When using config set, OpenClaw attempts to parse the provided value as JSON5. If it cannot, it defaults to treating the value as a raw string. Understanding this matters, a port number saved as the string “19001” will fail at runtime where the Gateway expects an integer.

ValueWithout --strict-jsonWith --strict-json
19001Parsed as integer ✓Parsed as integer ✓
trueParsed as boolean ✓Parsed as boolean ✓
["*"]May be saved as string ⚠Parsed as array ✓
helloFallback → raw stringFails, not valid JSON5 ✗

–json is supported as a legacy alias for –strict-json. Both behave identically. Prefer –strict-json in new scripts, –json may be repurposed for output formatting in a future version.

shellstrict-json examples

# Ensure port is saved as integer, not string
openclaw config set gateway.port 19001 --strict-json

# Ensure groups is saved as a JSON array, not a raw string
openclaw config set channels.whatsapp.groups '["*"]' --strict-json

# Validate after setting to catch type errors early
openclaw config validate

After Making Changes

recommended change workflow

# 1. Confirm which config file is active
openclaw config file

# 2. Read the current value before overwriting
openclaw config get gateway.port

# 3. Apply the change with strict JSON parsing
openclaw config set gateway.port 19001 --strict-json

# 4. Validate the full config against the schema
openclaw config validate

# 5. Restart the Gateway to apply changes
openclaw gateway restart
Referensi terkait:

  • Openclaw Configure Commands and Uses

    Complete reference for openclaw configure, running the interactive setup wizard, targeting specific configuration sections, and understanding the guardrails that protect your..

About the author

Hairun Wicaksana

Hi, I just another vibecoder from Southeast Asia, currently based in Stockholm. Building startup experiments while keeping close to the KTH Innovation startup ecosystem. I focus on AI tools, automation, and fast product experiments, sharing the journey while turning ideas into working software.

Get in touch

Quickly communicate covalent niche markets for maintainable sources. Collaboratively harness resource sucking experiences whereas cost effective meta-services.