Files
openclaw/docs/cli/config.md

69 lines
1.7 KiB
Markdown
Raw Normal View History

2026-01-16 06:57:16 +00:00
---
summary: "CLI reference for `openclaw config` (get/set/unset/file/validate)"
2026-01-16 06:57:16 +00:00
read_when:
- You want to read or edit config non-interactively
title: "config"
2026-01-16 06:57:16 +00:00
---
2026-01-30 03:15:10 +01:00
# `openclaw config`
2026-01-16 06:57:16 +00:00
Config helpers: get/set/unset/validate values by path and print the active
config file. Run without a subcommand to open
2026-01-30 03:15:10 +01:00
the configure wizard (same as `openclaw configure`).
2026-01-16 06:57:16 +00:00
## Examples
```bash
openclaw config file
2026-01-30 03:15:10 +01:00
openclaw config get browser.executablePath
openclaw config set browser.executablePath "/usr/bin/google-chrome"
openclaw config set agents.defaults.heartbeat.every "2h"
openclaw config set agents.list[0].tools.exec.node "node-id-or-name"
openclaw config unset tools.web.search.apiKey
openclaw config validate
openclaw config validate --json
2026-01-16 06:57:16 +00:00
```
## Paths
Paths use dot or bracket notation:
```bash
2026-01-30 03:15:10 +01:00
openclaw config get agents.defaults.workspace
openclaw config get agents.list[0].id
2026-01-16 06:57:16 +00:00
```
Use the agent list index to target a specific agent:
```bash
2026-01-30 03:15:10 +01:00
openclaw config get agents.list
openclaw config set agents.list[1].tools.exec.node "node-id-or-name"
```
2026-01-16 06:57:16 +00:00
## Values
Values are parsed as JSON5 when possible; otherwise they are treated as strings.
Use `--strict-json` to require JSON5 parsing. `--json` remains supported as a legacy alias.
2026-01-16 06:57:16 +00:00
```bash
2026-01-30 03:15:10 +01:00
openclaw config set agents.defaults.heartbeat.every "0m"
openclaw config set gateway.port 19001 --strict-json
openclaw config set channels.whatsapp.groups '["*"]' --strict-json
2026-01-16 06:57:16 +00:00
```
## Subcommands
- `config file`: Print the active config file path (resolved from `OPENCLAW_CONFIG_PATH` or default location).
2026-01-16 06:57:16 +00:00
Restart the gateway after edits.
## Validate
Validate the current config against the active schema without starting the
gateway.
```bash
openclaw config validate
openclaw config validate --json
```