Skip to content

Add docs command to generate Markdown documentation#1

Merged
breitburg merged 1 commit into
mainfrom
claude/fervent-gauss-3nad9i
Jun 18, 2026
Merged

Add docs command to generate Markdown documentation#1
breitburg merged 1 commit into
mainfrom
claude/fervent-gauss-3nad9i

Conversation

@breitburg

Copy link
Copy Markdown
Owner

Adds a new top-level docs command that generates complete Markdown documentation for the entire command tree in a single call, enabling agents to read the full CLI surface without walking --help group by group.

Changes

  • New docs command (src/kuleuven/cli/docs.py): Uses Typer's built-in get_docs_for_click to recursively render all commands, subcommands, arguments, options, and environment variable bindings as Markdown. Requires no session and makes no network calls.
  • CLI integration (src/kuleuven/cli/__init__.py): Registers the docs command at the top level of the app.
  • Documentation (README.md): Added a new "Docs" section describing the command, its output format, and usage examples.
  • Tests (tests/test_cli.py): Added two test cases verifying that the command emits valid Markdown with the correct structure and that help text, environment variable bindings, and positional arguments are preserved.

Implementation details

The docs command leverages Typer's own recursive Markdown generator (the same one behind typer utils docs), ensuring the output never drifts from the real CLI. It renders through the same code path as --help, so all help text, arguments, and options are guaranteed to be accurate. A throwaway Click context is created to satisfy the generator's requirements; the session callback never runs because no actual command is executed.

The output is a single JSON object with status: "ok", format: "markdown", and a docs key containing the stripped Markdown string, consistent with the CLI's output contract.

https://claude.ai/code/session_016EMDepiyjwBrKj1SP6Nux1

Agents can call `kuleuven docs` once to get Markdown documentation for
every command and subcommand instead of walking `--help` group by group.
The Markdown is produced by Typer's own get_docs_for_click generator, so
it shares the --help rendering path and never drifts from the real CLI.
Output stays a single JSON object: the Markdown is returned under `docs`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016EMDepiyjwBrKj1SP6Nux1
@breitburg breitburg merged commit 14335f9 into main Jun 18, 2026
1 check passed
@breitburg breitburg deleted the claude/fervent-gauss-3nad9i branch June 18, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants