#22462: CLI: add config path subcommand to print active config file path
cli
size: XS
Cluster:
Gateway and System Fixes
## Summary
- **Problem:** Users and scripts need to know where the active config file lives (e.g. for backup or tooling).
- **What changed:** Added `openclaw config path` subcommand. By default it prints the path with home shortened (`~/.openclaw/openclaw.json`); use `--absolute` for the full path (e.g. for scripts).
- **What did NOT change:** No change to config loading, get/set/unset, or setup wizard.
## Change Type
- [x] Feature
## Scope
- [x] API / contracts (CLI)
## User-visible / Behavior Changes
- New command: `openclaw config path` and `openclaw config path --absolute`.
## Security Impact
- New permissions/capabilities? **No**
- Secrets/tokens handling changed? **No**
- New/changed network calls? **No**
- Command/tool execution surface changed? **No** (new read-only CLI subcommand)
- Data access scope changed? **No**
## Verification
- `pnpm test src/cli/config-cli.test.ts` passes.
- Manually: `openclaw config path` and `openclaw config path --absolute` print the expected path.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added `openclaw config path` subcommand to display the active config file location. The command prints the path with home directory shortened by default (`~/.openclaw/openclaw.json`) or as an absolute path when `--absolute` flag is used. Implementation is straightforward and well-tested.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no identified risks
- The implementation is minimal and focused, adding only a read-only utility command. The code follows existing patterns in the codebase (using `resolveConfigPath()` and `shortenHomePath()`), includes comprehensive tests, and introduces no behavioral changes to existing functionality.
- No files require special attention
<sub>Last reviewed commit: 2eb4340</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#17916: [ fix ] : correct config directory path during onboarding
by Dijo-404 · 2026-02-16
76.1%
#10248: fix(update): default dev checkout path to ~/openclaw
by kimgyu · 2026-02-06
72.7%
#23522: feat(cli): add --quiet flag and OPENCLAW_NO_TAGLINE env var (#22635)
by dissaozw · 2026-02-22
71.6%
#18179: CLI: add sessions --json-debug diagnostics
by p6l-richard · 2026-02-16
71.5%
#18896: CLI: add vLLM configure command
by franciscojavierarceo · 2026-02-17
71.5%
#11602: fix(config): skip stale legacy config files when openclaw.json exists
by akoscz · 2026-02-08
71.3%
#11529: fix(wizard): strip shell-style backslash escapes from workspace paths
by mcaxtr · 2026-02-07
71.1%
#6235: fix: from source development command
by witcxc · 2026-02-01
71.0%
#13168: perf: short-circuit --version to skip process respawn and full modu...
by RamiNoodle733 · 2026-02-10
70.4%
#23654: security(cli): redact sensitive values in config get output
by SleuthCo · 2026-02-22
70.4%