#20454: fix(memory): correct search help example to use positional argument [AI-assisted]
cli
size: XS
Cluster:
Doctor and Memory Health Checks
## Summary
- **Problem:** `openclaw memory -h` shows `openclaw memory search --query "deployment notes"` as an example, but `search` takes a positional argument, not a `--query` option — running the example as shown returns `error: unknown option '--query'`
- **Why it matters:** Users copy the example from help text and get an immediate error
- **What changed:** Removed `--query` from the help example in `src/cli/memory-cli.ts`
- **What did NOT change:** The command itself, its argument parsing, or any behavior
## Change Type (select all)
- [x] Bug fix
## Scope (select all touched areas)
- [x] UI / DX
## Linked Issue/PR
- Closes #
## User-visible / Behavior Changes
The help text example for `openclaw memory search` now correctly shows the positional argument syntax.
## Security Impact (required)
- New permissions/capabilities? No
- Secrets/tokens handling changed? No
- New/changed network calls? No
- Command/tool execution surface changed? No
- Data access scope changed? No
## Repro + Verification
### Steps
1. Run `openclaw memory -h`
2. Copy the search example: `openclaw memory search --query "deployment notes"`
3. Run it → `error: unknown option '--query'`
### Expected
Example in help text matches the actual command signature (positional argument).
### Actual
Help text showed `--query` flag which doesn't exist.
## Evidence
- [x] Verified `openclaw memory search --help` shows `<query>` as a positional argument
- [x] Confirmed `openclaw memory search "deployment notes"` works correctly
- [x] `pnpm build && pnpm check` pass clean
## Human Verification (required)
- Verified scenarios: reproduced the broken example, confirmed fix works
- Edge cases checked: no other occurrences of `memory search --query` in docs or tests
- What you did **not** verify: full E2E memory search flow
## Compatibility / Migration
- Backward compatible? Yes
- Config/env changes? No
- Migration needed? No
## Failure Recovery (if this breaks)
- How to disable/revert: revert the one-line change in `src/cli/memory-cli.ts`
## Risks and Mitigations
None — single-line help text change with no behavioral impact.
---
🤖 AI-assisted via Claude Code (claude-sonnet-4-6). Fix identified by reproducing the error from the help text example. One-line change, fully verified.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixed help text example for `openclaw memory search` to use the correct positional argument syntax instead of the non-existent `--query` flag. The command implementation (line 688) confirms it takes `<query>` as a positional argument, so the help example now correctly shows `openclaw memory search "deployment notes"` instead of `openclaw memory search --query "deployment notes"`.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk
- Single-line help text correction with zero behavioral changes. The fix aligns the help example with the actual command signature (positional argument on line 688), and verification shows no other instances of the incorrect syntax exist in the codebase.
- No files require special attention
<sub>Last reviewed commit: 9842ec5</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
#23296: fix(cli): correct memory search help example syntax
by SidQin-cyber · 2026-02-22
95.0%
#23247: fix(cli): removes --query from memory cmd options
by stuhorsman · 2026-02-22
78.3%
#9624: fix(memory): resolve QMD search returning empty results [AI-assisted]
by kowshik24 · 2026-02-05
74.5%
#22327: fix(doctor): use gateway health status for memory search key check
by therk · 2026-02-21
73.7%
#18546: fix(doctor): replace deprecated `auth add` command reference
by Phineas1500 · 2026-02-16
72.8%
#21471: fix: check QMD backend before memory search config
by lbo728 · 2026-02-20
72.4%
#20125: fix(doctor): skip memorySearch provider check when using QMD backend
by brandonwise · 2026-02-18
72.3%
#9381: Fix: Allow QMD CLI memory search when scope is restrictive
by vishaltandale00 · 2026-02-05
72.1%
#21240: fix: GH#20607 prevent doctor from dropping custom config sections
by theognis1002 · 2026-02-19
71.8%
#16917: fix(memory): close stale SQLite connection after qmd update
by zerone0x · 2026-02-15
71.8%