CLI: add config path subcommand to print active config file path (#26256)

Merged via squash.

Prepared head SHA: b11c593a34
Co-authored-by: cyb1278588254 <48212932+cyb1278588254@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
cyb1278588254
2026-03-02 12:33:20 +08:00
committed by GitHub
parent dc2290aeb1
commit 96ffbb5aaf
6 changed files with 54 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
---
summary: "CLI reference for `openclaw config` (get/set/unset config values)"
summary: "CLI reference for `openclaw config` (get/set/unset values and config file path)"
read_when:
- You want to read or edit config non-interactively
title: "config"
@@ -7,12 +7,14 @@ title: "config"
# `openclaw config`
Config helpers: get/set/unset values by path. Run without a subcommand to open
Config helpers: get/set/unset values by path and print the active config file.
Run without a subcommand to open
the configure wizard (same as `openclaw configure`).
## Examples
```bash
openclaw config file
openclaw config get browser.executablePath
openclaw config set browser.executablePath "/usr/bin/google-chrome"
openclaw config set agents.defaults.heartbeat.every "2h"
@@ -47,4 +49,8 @@ openclaw config set gateway.port 19001 --strict-json
openclaw config set channels.whatsapp.groups '["*"]' --strict-json
```
## Subcommands
- `config file`: Print the active config file path (resolved from `OPENCLAW_CONFIG_PATH` or default location).
Restart the gateway after edits.

View File

@@ -380,7 +380,7 @@ Interactive configuration wizard (models, channels, skills, gateway).
### `config`
Non-interactive config helpers (get/set/unset). Running `openclaw config` with no
Non-interactive config helpers (get/set/unset/file). Running `openclaw config` with no
subcommand launches the wizard.
Subcommands:
@@ -388,6 +388,7 @@ Subcommands:
- `config get <path>`: print a config value (dot/bracket path).
- `config set <path> <value>`: set a value (JSON5 or raw string).
- `config unset <path>`: remove a value.
- `config file`: print the active config file path.
### `doctor`