feat: add CLI JSON documentation generation#372
Merged
josecelano merged 5 commits intomainfrom Feb 20, 2026
Merged
Conversation
19def6d to
f73310e
Compare
- Add infrastructure layer for CLI documentation generation - schema_builder: Extract command metadata from clap structures - generator: Generate JSON documentation with format metadata - Add presentation controller for docs command - Handler for docs command with stdout/file output support - Error types for docs command failures - Wire docs command into CLI and dispatch router - Update error handling to support docs command - Add comprehensive help text for all CLI commands - Workflow position and state transitions - Next steps and usage scenarios - Service access endpoints and verification steps
- Add user guide for docs command (docs/user-guide/commands/docs.md) - Explain two output modes (stdout vs file) - Document usage scenarios (IDE integration, CI/CD validation) - Provide JSON structure examples - Add generated CLI documentation JSON (docs/cli/commands.json) - Complete command metadata with descriptions and help text - Argument specifications with types and requirements - Workflow position and next steps for each command - Update commands README with docs command entry - Update docs README with CLI documentation section
- Add new agent skill for regenerating CLI documentation - Automated workflow to run docs command - Save output to docs/cli/commands.json - Validate JSON and stage changes - Update AGENTS.md with skill reference - Add to auto-invoke skills table - Include regenerating CLI docs row
- Add pipeable to project dictionary (cspell) - Update .gitignore for CLI docs directory - Update schemas README with CLI schema reference - Update roadmap with CLI JSON documentation completion
f73310e to
6ccb7da
Compare
- Escape square brackets in workflow position indicators - Escape angle brackets in command placeholders - Fixes 10 rustdoc warnings about unresolved links and unclosed HTML tags - Regenerate CLI documentation JSON with fixes
Member
Author
|
ACK d1e1a14 |
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.
Overview
This PR adds automatic CLI documentation generation in machine-readable JSON format. This enables AI agents, documentation generators, and IDE integrations to easily understand and interact with the CLI without needing to run commands with
--helpor parse source code.What's Added
New
docsCommandGenerate comprehensive CLI documentation in JSON format:
Pre-Generated Documentation
A complete, up-to-date CLI documentation file is maintained at:
docs/cli/commands.jsonWhy This Matters
For AI Agents:
--helpflagsFor Documentation Generators:
For IDE Integrations:
For Version Control:
JSON Format
The generated documentation includes:
{ "format": "cli-documentation", "format_version": "1.0", "cli": { "name": "torrust-tracker-deployer", "version": "0.1.0", "commands": [ { "name": "provision", "description": "...", "arguments": [...], "subcommands": [...] } ] } }Enhanced Help Text
As part of this work, all CLI command help text has been significantly improved with:
All 16 commands now provide comprehensive guidance to help users understand the deployment workflow.
Usage Example
Testing
Documentation
docs/user-guide/commands/docs.mddocs/cli/commands.json.github/skills/regenerate-cli-docs/skill.md