Skip to content

docs(cli): document mcp serve, eval code, install --silent, and gaia slack - #4327

Merged
kovtcharov-amd merged 4 commits into
amd:mainfrom
kovtcharov:claude/cli-mdx-missing-commands
Sep 26, 2026
Merged

kovtcharov-amd merged 4 commits into
amd:mainfrom
kovtcharov:claude/cli-mdx-missing-commands

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

gaia mcp serve, gaia eval code, the --claude-model / --no-lemonade-check global flags, and gaia install --silent all exist in the parser with no mention in the CLI reference, and CLAUDE.md's CLI command list omits gaia slack entirely — every flag the reference does document is real, so this was a coverage gap, not stale text.

Documented all of them in docs/reference/cli.mdx (with a caveat on gaia report, which is registered but not dispatched per #3488), added gaia slack to CLAUDE.md, and added a CLI-to-docs drift test that walks every leaf gaia <subcommand> from build_parser() and checks it's written into cli.mdx in full-path form (gaia mcp start, not bare start) — the same form the page already uses, so it stays low-noise. Twelve pre-existing gaps the same walk found (mostly gaia connectors subcommands) are allowlisted as tracked debt rather than fixed here, to keep this PR reviewable; the allowlist test fails if one gets documented without being removed from it, or if the allowlist grows.

Overlaps open PR #3812, which only renames gaia tui → gaia-tui and fixes lemonade-server serve examples on this page — it doesn't touch any section added here. Also overlaps open issue #1085, which filed the same "CLI drift needs a test" finding in May.

Test plan

  • pytest tests/unit/cli/test_cli_docs_drift.py -q — 2 passed (confirmed each assertion fails independently: an undocumented command trips one, a stale allowlist entry trips the other)
  • black --check / isort --check-only on the new test file
  • python util/check_doc_links.py --internal-only — 1013/1013 OK
  • Verified every added flag against src/gaia/cli.py's build_parser()

Fixes #4250

…slack

The CLI reference was missing sections for gaia mcp serve, gaia eval code,
and the --claude-model / --no-lemonade-check global flags and install
--silent, and CLAUDE.md's CLI list omitted gaia slack entirely — none of
these were stale text, they just never got a doc pass when the parser grew.

Documented all four in docs/reference/cli.mdx (with a caveat on gaia report,
which is registered but not dispatched per amd#3488), added gaia slack to
CLAUDE.md, and added a CLI-to-docs drift test that walks every leaf
`gaia <subcommand>` from build_parser() and checks its full path is written
into cli.mdx (matching how the page already documents nested commands),
so new commands can't ship without a doc section again. Twelve pre-existing
gaps found by the same walk (mostly gaia connectors subcommands) are
allowlisted as tracked debt rather than fixed here, to keep this PR reviewable.

Overlaps open PR amd#3812, which only renames `gaia tui` -> `gaia-tui` and fixes
`lemonade-server serve` examples in cli.mdx — it doesn't touch any of the
sections added here. Also overlaps open issue amd#1085, which filed the same
"CLI drift needs a test" finding in May.

Fixes amd#4250
@github-actions github-actions Bot added documentation Documentation changes devops DevOps/infrastructure changes tests Test changes labels Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

This documents four CLI surfaces that existed in the parser but nowhere in the reference, and adds a test that fails CI when a new subcommand ships undocumented. I checked every added flag, default and option name against the real parser — they all match, including the honest warning that gaia report is registered but never dispatched.

One thing worth fixing before merge: the two new rows in the Global Options table sit under a claim that every command accepts them, and that isn't true — they come from the shared parent parser, which only about two-thirds of the top-level commands pull in. A user who types one of them after gaia hub, gaia config, gaia init or gaia daemon gets an "unrecognized arguments" error instead of the documented behaviour. The claim was already wrong for the logging flag, but this PR is an accuracy PR, so it's the right moment to scope the sentence. There's also a placement nit: the new gaia report options table has no heading of its own and lands in the overview section immediately before an unrelated example, so it reads like it belongs to the next command.

The drift test's design is the strongest part of this change — allowlisting the pre-existing gaps as tracked debt, plus a second test that fails if an allowlisted entry quietly gets documented, is what keeps the allowlist from turning into a graveyard.

Real-world evidence

N/A — docs- and tests-only change; no evidence-bundle.md was produced and no runnable surface changed. Dependencies aren't installed in this review lane, so I could not execute the new test here; the verdict rests on static verification of every documented flag against build_parser() plus the author's reported pytest run (2 passed, each assertion confirmed to fail independently).

🔍 Technical details

Issues

🟡 --claude-model / --no-lemonade-check are not global (docs/reference/cli.mdx:3325-3332)

Both live on parent_parser (src/gaia/cli.py:1116, :1160), which is attached to 16 of ~26 top-level subparsers. knowledge, lemonade, daemon, hub, cache, memory, diagnostics, agent, config and init do not include it, so gaia hub list --no-lemonade-check errors out. They also have to precede a nested subcommand (gaia mcp --no-lemonade-check start, not gaia mcp start --no-lemonade-check), because the child parsers don't inherit parent_parser either. Same caveat already applies to the existing --logging-level row.

Most commands support these options. They come from a shared parent parser, so
they are **not** accepted by `gaia config`, `gaia init`, `gaia hub`, `gaia daemon`,
`gaia cache`, `gaia memory`, `gaia agent`, `gaia diagnostics`, `gaia knowledge` or
`gaia lemonade`, and on nested commands they must come before the subcommand
(`gaia mcp --no-lemonade-check start`).

🟢 gaia report options table has no heading (docs/reference/cli.mdx:1756)

It sits in the ## Evaluation Commands overview between the gaia report example and the gaia perf-vis example, with no heading — a scanner can attribute it to perf-vis. The #### gaia mcp serve options pattern this PR introduces elsewhere is the fix:

#### `gaia report` options

| Option | Default | Description |

🟢 Drop the value placeholder (docs/reference/cli.mdx:3331)

The Type column already says string, and no other row in this table carries a <name> placeholder.

| `--claude-model` | string | `claude-sonnet-4-20250514` | Claude model to use when `--use-claude` is set |

🟢 The drift check is a plain substring match (tests/unit/cli/test_cli_docs_drift.py:201)

f"gaia {' '.join(path)}" not in cli_text counts any mention anywhere on the page — including inside a prose aside or a <Warning> — as documented, and a leaf whose path is a prefix of a longer documented command passes for free. That's an acceptable trade for low noise (and the docstring says as much), but the test guarantees "mentioned", not "has a section". Worth a comment on the assertion so a future reader doesn't over-trust it.

Notes, no action needed

  • The #3488 warning is verified: there is no args.action == "report" branch, and the fallthrough at src/gaia/cli.py:4752-4754 logs the unknown action, prints top-level help and returns None → exit 0. Exactly as documented.
  • --claude-model's default in code is claude-sonnet-4-20250514, so the doc is accurate — but the reference now advertises a 2025 model id. Refreshing that default is a code change and correctly out of scope here; worth a follow-up issue.
  • _iter_leaf_commands' seen set would silently drop a parser object registered under two parents. No aliases and no conditional registration exist in build_parser() today, so the walk is deterministic — just don't rely on it staying that way.

Strengths

  • The allowlist + test_allowlist_has_no_stale_entries pairing is the right shape for adopting a new lint against existing debt: the gap can only shrink, and documenting an entry without removing it fails loudly.
  • Leaf-path matching (gaia mcp start, not bare start) with the reasoning recorded in the module docstring — avoids the dozens of false positives a naive add_parser() name scan would produce.
  • Every documented default I checked (8766 via AGENT_UI_MCP_PORT, http://localhost:4200, ./output/evaluations, LLM_Evaluation_Report.md, eval/results/code-<timestamp>) matches the parser, and gaia slack's subcommand list in CLAUDE.md matches all six registered actions.
  • Scope-clean: docs plus one test, no drive-by edits.

--logging-level, --claude-model and --no-lemonade-check come from the shared
parent_parser, which 12 of the 32 top-level subcommands don't pull in, so
'All commands support these' sent users into 'unrecognized arguments'. Name the
exceptions, document the nested-subcommand ordering, and pin the list with a
test that reads the parser.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Confirmed the "All commands support these global options" claim was wrong, and fixed it — though the review's suggested replacement was itself slightly off, so I re-derived the facts from the parser.

The section now names the 12 commands that reject the flags, documents the nested-subcommand ordering, and is pinned by a new test that reads build_parser() — so a subcommand gaining or losing the shared parent parser fails CI instead of rotting the doc.

tests/unit/cli/test_cli_docs_drift.py: 3 passed. Verified the new test fails against the old wording (it names all 12 missing commands) and passes on the fix. Merged origin/main (clean). check_doc_links.py --internal-only: all valid. black/isort clean.

🔍 Technical details

Enumerated by walking the real parser rather than reading cli.py by eye. 32 top-level subcommands, 20 accept the shared flags, 12 reject:

agent, cache, config, connectors, daemon, diagnostics, hub, init, knowledge, lemonade, memory, skill

The review's list had 10 — it missed connectors and skill. The set is identical for all three flags (--logging-level, --claude-model, --no-lemonade-check), so one sentence covers the table.

Two corrections to the suggested replacement:

  1. It gave gaia mcp --no-lemonade-check start as the example of correct ordering. That's the one command where it doesn't work — mcp start declares parents=[parent_parser] itself (cli.py:2490), so the child's default=False overwrites the pre-subcommand value. Parsed both ways across all 22 nested leaves that parse without required args: every one honors before except mcp start, which honors after. The doc now uses gaia eval --no-lemonade-check agent and calls out mcp start as the exception.
  2. Dropped the <name> placeholder from the --claude-model row as suggested.

Not addressed (🟢, structural rather than factual): the missing #### gaia report options heading, and the drift check being a plain substring match.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 26, 2026
Merged via the queue into amd:main with commit 1e6c789 Sep 26, 2026
28 of 29 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the claude/cli-mdx-missing-commands branch September 26, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(cli): undocumented subcommands and flags; CLAUDE.md misses gaia slack

2 participants