Generate CLI docs from argparse and add CI verification#61
Merged
MicheleBonus merged 1 commit intomainfrom Mar 7, 2026
Merged
Conversation
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.
Motivation
ambermeta/cli.py::build_parser()the single source of truth for global and per-command options.Description
scripts/export_cli_help.py, which importsbuild_parser(), rendersformat_help()for the root parser and subcommands, and injects those help blocks intodocs/cli.mdbetween markers like<!-- BEGIN_CLI_HELP:plan -->/<!-- END_CLI_HELP:plan -->.docs/cli.mdto embed generated help blocks forroot,plan,init,validate,info,tui, andgui, replacing several hand-maintained tables and correcting the documented TUI options to match the parser..github/workflows/cli-docs-sync.ymlthat runspython scripts/export_cli_help.py --checkand fails the job when the generated help differs from the committed docs.--checkmode that exits non-zero whendocs/cli.mdis out of date and a normal mode that updates the file in-place.Testing
python scripts/export_cli_help.pyto generate/updatedocs/cli.md, which completed successfully and updated the docs as expected.python scripts/export_cli_help.py --checkwhich reported the docs are up to date and exited0.pytest -q tests/test_cli_init.py tests/test_cli_protocol_output.pyand observed all tests passed (7 passed).Codex Task