fix(cli): honor help before required args and accept store tag aliases - #668
Conversation
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
PR Summary by QodoFix CLI help preflight and allow
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR fixes CLI help handling so --help is honored before Commander’s required-argument validation (notably for lcm store --help), and aligns the lcm store tag option contract with documentation by accepting both --tag and --tags as repeatable aliases while keeping export --tags as a comma-separated filter.
Changes:
- Preflight known
--helprequests inrunClibefore identity validation, legacy-home migration, package metadata reads, orparseAsync. - Register a single occurrence-ordered
lcm storetag option with both--tagand--tagslong aliases, preserving mixed-order input. - Update CLI help/docs/templates and add tests covering help preflight and tag alias behavior.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/lcm.ts |
Adds early custom help resolution in runCli and registers store tag aliases as one repeatable option. |
src/cli-help.ts |
Updates store help text to reflect --tag/--tags aliases and exports hasCommandHelp for preflight gating. |
docs/cli.md |
Documents early help resolution (before required args) and clarifies store vs export tag semantics. |
src/connectors/templates/sections/command-reference.md |
Updates command reference to show tagged store usage and alias guidance. |
test/bin/lcm-run-cli.test.ts |
Adds tests ensuring help exits before side effects and validates tag alias ordering + export --tags behavior. |
test/bin/memory-command-routing.test.ts |
Verifies store registers exactly one option carrying both --tag and --tags. |
test/cli-help.test.ts |
Tests hasCommandHelp and ensures store help prints the ordered alias flags/examples. |
test/connectors/template-service.test.ts |
Asserts generated connector rules content reflects updated store examples and avoids comma-syntax in invocations. |
.github/copilot-instructions.md |
Adds review guidance about direct tests for exported helpers and avoiding comma-syntax in shell invocations. |
.changeset/clear-store-help-aliases.md |
Adds a patch changeset describing the behavior fixes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR |
Summary
Fixes #602 and #603.
lcm store --helpis rejected instead of displaying help #602:lcm store --help(andlcm <known-command> --help) was rejected instead of displaying help. Commander validates required operands before subcommand actions, so the per-actionopts.helpchecks were unreachable.runClinow preflights known help requests before identity validation, legacy-home migration, package metadata reads, andparseAsync, while preserving unknown-command, empty-argv, pseudo-help, and--terminator behavior.lcm storedocuments--tags, but only accepts--tag#603:lcm storedocumented--tagsbut only accepted--tag. Store tag aliases are now registered as one occurrence-ordered option accepting both--tagand--tags(repeatable), whileexport --tagsstays comma-separated.MoM workflow
Changeset
.changeset/clear-store-help-aliases.md— patch