Skip to content

Generate CLI docs from Go code#2736

Open
bfirsh wants to merge 3 commits intomainfrom
generate-cli-docs
Open

Generate CLI docs from Go code#2736
bfirsh wants to merge 3 commits intomainfrom
generate-cli-docs

Conversation

@bfirsh
Copy link
Member

@bfirsh bfirsh commented Feb 17, 2026

This implements CLI documentation generation using cobra/doc, building on the work started in #1696.

Changes

  • Add tools/gendocs/ Go tool to generate CLI reference docs from cobra commands
  • Generate docs/cli.md programmatically from Go source code
  • Add mise tasks:
    • mise run docs:cli - generate CLI docs
    • mise run docs:cli:check - verify docs are up to date
  • Run CLI docs check in CI alongside llms.txt check
  • Update AGENTS.md with CLI docs maintenance instructions
  • Update docs workflow to generate CLI docs before deploying

Usage

# Generate CLI docs
mise run docs:cli

# Check CLI docs are up to date (runs in CI)
mise run docs:cli:check

Notes

  • CLI docs are auto-generated and should not be edited manually
  • The check runs in CI when cmd/ or pkg/cli/ files change
  • Docs include all commands, options, and examples from cobra definitions

Closes #1696

This implements CLI documentation generation using cobra/doc, building on
the work started in #1696.

Changes:
- Add tools/gendocs/ Go tool to generate CLI reference docs
- Generate docs/cli.md from cobra command definitions
- Add mise tasks: docs:cli and docs:cli:check
- Run CLI docs check in CI alongside llms.txt check
- Update AGENTS.md with CLI docs maintenance instructions

Fixes #1696
@bfirsh bfirsh requested a review from a team as a code owner February 17, 2026 23:59
Copy link
Member

@tempusfrangit tempusfrangit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine but we should wire up mise to do some lifting for us!

@tempusfrangit
Copy link
Member

@michaeldwan we'll want to track this for kong rewire.

Copy link

Copilot AI commented Feb 18, 2026

@bfirsh I've opened a new pull request, #2745, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 18, 2026 16:10
This ensures CLI docs are always generated before being included in llms.txt

Co-authored-by: bfirsh <40906+bfirsh@users.noreply.github.com>
Co-authored-by: bfirsh <40906+bfirsh@users.noreply.github.com>
Copy link
Member

@tempusfrangit tempusfrangit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable. I'm certain once we move to Kong this will need to be reworked but that is just part of that migration.

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.

3 participants

Comments