docs: automate OpenShell CLI reference markdown generation into two places#270
Open
docs: automate OpenShell CLI reference markdown generation into two places#270
Conversation
|
Made-with: Cursor
Collaborator
c5e6db4 to
f1600e4
Compare
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
Preview: https://cuddly-tribble-p3evl8k.pages.github.io/pr-preview/pr-270/reference/cli-generated.html
Automates CLI reference markdown generation from source
///doc comments, eliminating manual documentation maintenance and ensuring CLI docs stay in sync with code.What this adds
cli_reference.rs— A new module that introspects the clapCommandtree at runtime and generates a complete markdown reference (command tree, flag tables with defaults, env vars, grouped sections).openshell docs cli-reference— A hidden subcommand that runs the generator and prints markdown to stdout.docs:cli-reference(regenerate) anddocs:cli-reference:check(staleness check wired intopre-commit)..agents/skills/openshell-cli/cli-reference-generated.md(agent skills)docs/reference/cli-generated.md(user-facing docs site).agents/skills/generate-cli-reference/SKILL.md) documenting the regeneration workflow.Why
The CLI reference was previously maintained by hand across multiple locations, leading to staleness and inconsistency. Now the
///doc comments on commands and flags inmain.rsare the single source of truth. The pre-commit hook catches drift automatically.Notable details
ensure_period()so the output has consistent punctuation.Changed files
crates/navigator-cli/src/cli_reference.rscrates/navigator-cli/src/lib.rscli_referencemodulecrates/navigator-cli/src/main.rsdocs cli-referencesubcommand; fix one missing trailing periodtasks/docs.tomldocs:cli-referenceanddocs:cli-reference:checktaskstasks/ci.tomlpre-commitCONTRIBUTING.mddocs:cli-referencetask and generated docs workflowdocs/index.mdreference/cli-generatedto docs toctree.agents/skills/generate-cli-reference/SKILL.md.agents/skills/openshell-cli/cli-reference-generated.mddocs/reference/cli-generated.mdTest plan
cargo test -p navigator-cli cli_reference— unit tests passmise run docs:cli-reference— regenerates successfullymise run docs:cli-reference:check— passes when docs are currentmise run docs:cli-reference:check— fails with clear error when docs are stalemise run pre-commit— full CI suite including staleness check