feat(docs): add docs_gen module for auto-generating option tables#159
Merged
basnijholt merged 26 commits intomainfrom Jan 3, 2026
Merged
feat(docs): add docs_gen module for auto-generating option tables#159basnijholt merged 26 commits intomainfrom
basnijholt merged 26 commits intomainfrom
Conversation
Add a new `agent_cli.docs_gen` module that introspects Typer commands and generates Markdown documentation tables. This integrates with markdown-code-runner to keep documentation in sync with code. Key functions: - `all_options_for_docs(cmd)`: Generate complete options tables grouped by panel - `options_table(cmd, panel)`: Generate table for specific command/panel - `env_vars_table()`: Generate environment variables documentation - `provider_matrix()`: Generate provider comparison table - `config_example(cmd)`: Generate example TOML configuration Benefits: - Single source of truth: opts.py definitions auto-generate docs - No drift between CLI help and documentation - CI-friendly: can validate docs match code Also updates docs/commands/transcribe.md as an example of the new auto-generation approach using markdown-code-runner hidden code blocks.
Simplify verbose panel names: - "ASR (Audio) Configuration" → "Audio Input" - "TTS (Text-to-Speech) Configuration" → "Audio Output" - "LLM Configuration: Ollama (local)" → "LLM: Ollama" - "Process Management Options" → "Process Management" - "Wake Word Options" → "Wake Word" Also group --extra-instructions with --llm under "LLM Configuration" panel for better logical organization. Regenerate docs/commands/transcribe.md with cleaner section headers.
- Rename internal functions to private: get_command_options, options_table, options_by_panel, list_commands → _prefixed versions - Add comprehensive test suite with 36 tests covering all public and private functions
Replace hand-written options tables with markdown-code-runner auto-generation using docs_gen.all_options_for_docs().
Replace hand-written options tables with markdown-code-runner auto-generation using docs_gen.all_options_for_docs().
Replace hand-written options tables with markdown-code-runner auto-generation using docs_gen.all_options_for_docs().
Replace hand-written options tables with markdown-code-runner auto-generation using docs_gen.all_options_for_docs().
Replace hand-written options tables with markdown-code-runner auto-generation using all_options_for_docs() function.
Replace hand-written options tables with markdown-code-runner auto-generation using all_options_for_docs() function.
Replace hand-written options tables with markdown-code-runner auto-generation using all_options_for_docs() function for both memory.proxy and memory.add subcommands.
Replace hand-written options tables with markdown-code-runner auto-generation using all_options_for_docs() function.
Replace hand-written options tables with markdown-code-runner auto-generation using all_options_for_docs() function.
Replace hand-written options tables with markdown-code-runner auto-generation using all_options_for_docs() function.
Finds all markdown files with CODE:START markers and runs markdown-code-runner on them.
Renamed update-readme.yml to update-docs.yml and now runs the update_docs.py script which updates all files with CODE:START markers.
- Regenerate README.md CLI output with OpenAI-compatible panel names - Update update_docs.py to also detect CODE:BASH:START markers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent_cli.docs_genmodule that introspects Typer commands and generates Markdown documentation tablesmarkdown-code-runnerto keep documentation in sync with code automaticallydocs/commands/transcribe.mdas an example of the new auto-generation approachKey Functions
all_options_for_docs(cmd)options_table(cmd, panel)options_by_panel(cmd)rich_help_panellist_commands()["transcribe", "memory.proxy"])env_vars_table()provider_matrix()config_example(cmd)Usage in docs
Benefits
opts.py→ docs auto-generatedmarkdown-code-runner, docs updatemarkdown-code-runner --checkto fail if docs are stale--helptextTest plan
docs_gen.pypasses linting (ruff check,ruff format,mypy)markdown-code-runnersuccessfully processes the updated transcribe.md