Background
Documentation for these surfaces is being handled in the CLI/MCP reference PR (#715),
but two issues need code changes, which is what this issue tracks:
-
--help is identical for every command. Every --help invocation
(qmd query --help, qmd get --help, qmd collection --help, qmd embed --help,
…) emits the same ~97-line block. There is no per-command help; the EBNF grammar
appears even for embed and mcp where it's irrelevant.
-
qmd bench fails silently. If the fixture's collection isn't indexed, bench
runs all queries to completion and prints a wall of 0.00 with no warning — ~2
minutes of wasted work that reads as "search is broken." The usage message also
points to a source path (src/bench/fixtures/example.json) that npm/npx users
can't reach, and the fixture isn't shipped in the package.
Proposed changes
Progressive --help
Adopt the tiered/contextual help pattern used by uv, cargo, gh, rg:
- Top-level
qmd --help = command directory (commands + one-line descriptions +
global options).
- Per-command
--help = only that command's flags, usage, and 1–2 examples.
- EBNF grammar lives in
query --help only.
- Add
--intent and --from to the relevant per-command help (currently missing
from --help even though they work).
- Keep help text adjacent to each command handler so community PRs don't drift; add a
test that asserts each help block's mentioned flags exist in the arg parser.
Note: bare qmd collection (no args) already shows a subcommand directory — extend
that pattern rather than replacing it.
bench guardrails
- Validate the fixture's collection exists before running; error early with the
setup hint, mirroring qmd search -c <missing>.
- Warn on all-zero results (collection likely unindexed; suggest
qmd ls <collection>).
- Make the example reachable for installed users —
qmd bench --example to print
the fixture JSON to stdout, and/or ship the example fixture as package data so the
source-path reference resolves outside a git checkout.
Scope / non-goals
References
Background
Documentation for these surfaces is being handled in the CLI/MCP reference PR (#715),
but two issues need code changes, which is what this issue tracks:
--helpis identical for every command. Every--helpinvocation(
qmd query --help,qmd get --help,qmd collection --help,qmd embed --help,…) emits the same ~97-line block. There is no per-command help; the EBNF grammar
appears even for
embedandmcpwhere it's irrelevant.qmd benchfails silently. If the fixture's collection isn't indexed, benchruns all queries to completion and prints a wall of
0.00with no warning — ~2minutes of wasted work that reads as "search is broken." The usage message also
points to a source path (
src/bench/fixtures/example.json) that npm/npx userscan't reach, and the fixture isn't shipped in the package.
Proposed changes
Progressive
--helpAdopt the tiered/contextual help pattern used by
uv,cargo,gh,rg:qmd --help= command directory (commands + one-line descriptions +global options).
--help= only that command's flags, usage, and 1–2 examples.query --helponly.--intentand--fromto the relevant per-command help (currently missingfrom
--helpeven though they work).test that asserts each help block's mentioned flags exist in the arg parser.
Note: bare
qmd collection(no args) already shows a subcommand directory — extendthat pattern rather than replacing it.
benchguardrailssetup hint, mirroring
qmd search -c <missing>.qmd ls <collection>).qmd bench --exampleto printthe fixture JSON to stdout, and/or ship the example fixture as package data so the
source-path reference resolves outside a git checkout.
Scope / non-goals
References
uv/cargo/gh/rgprecedent