Skip to content

feat: CLI help parser for docs extraction (#44)#48

Merged
ssilvius merged 4 commits intomainfrom
feat/44-cli-help-parser
Apr 6, 2026
Merged

feat: CLI help parser for docs extraction (#44)#48
ssilvius merged 4 commits intomainfrom
feat/44-cli-help-parser

Conversation

@ssilvius
Copy link
Copy Markdown
Contributor

@ssilvius ssilvius commented Apr 6, 2026

Summary

  • New veneer-docs crate for documentation extraction and generation
  • CLI help parser that extracts structured command/flag data from clap v4 --help output
  • Recursive subcommand parsing (handles nested commands like kanban create)
  • Detects required/optional flags, defaults, value placeholders, short/long names

Test plan

  • 7 unit tests covering: simple help, subcommands, defaults, required detection, root commands, edge cases
  • cargo clippy -- -D warnings clean
  • cargo fmt -- --check clean
  • Workspace-wide cargo test passes
  • Integration test against real legion binary (manual verification)

Resolves #44

🤖 Generated with Claude Code

ssilvius and others added 4 commits April 6, 2026 11:38
New crate for documentation extraction from source code. First module
is the CLI help parser that extracts structured command data (flags,
subcommands, descriptions, defaults, required/optional) from clap v4
--help output. Parses recursively through subcommand trees.

Closes #44

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sidebar generator produces navigation tree JSONL from parsed CLI commands
with editorial pages first, command groups second. Reference MDX generator
produces one page per command with frontmatter, flag tables, usage blocks,
and editorial slot markers for customer-authored content.

12 new tests (5 sidebar, 7 reference MDX), 19 total in veneer-docs.

Closes #45, closes #46

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generates getting-started, architecture, and concept MDX pages with
editorial slot markers. Never overwrites existing files to preserve
customer-authored content. Concept pages auto-generated from detected
command groups.

6 new tests, 25 total in veneer-docs.

Closes #47

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…43)

New `veneer extract` command that takes a project path and binary, then
generates complete MDX documentation: reference pages with flag tables,
editorial skeleton pages, and a sidebar JSONL navigation file.

Tested against legion: produces 63 pages (56 reference + 7 editorial)
from 30+ commands and subcommands in under 1 second.

Fix: use binary filename not full path as root command name.

Closes #43

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ssilvius ssilvius merged commit 9a0f185 into main Apr 6, 2026
7 checks passed
@ssilvius ssilvius deleted the feat/44-cli-help-parser branch April 6, 2026 18:54
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.

Implement CLI help parser - extract structured command data from --help output

1 participant