Skip to content

Add SPM plugin for generating Markdown CLI docs#1

Merged
ilia3546 merged 3 commits into
mainfrom
claude/swift-cli-doc-plugin-aVO40
May 5, 2026
Merged

Add SPM plugin for generating Markdown CLI docs#1
ilia3546 merged 3 commits into
mainfrom
claude/swift-cli-doc-plugin-aVO40

Conversation

@ilia3546
Copy link
Copy Markdown
Owner

@ilia3546 ilia3546 commented May 5, 2026

Implements the swift-cli-docs-plugin: a Swift Package Manager command plugin
that turns any Swift Argument Parser CLI into beautiful Markdown documentation.

Architecture:

  • Plugin invokes a helper executable that parses --experimental-dump-help
  • ContextBuilder pre-computes everything (synopsis, defaults, links, escapes)
    into a stable RenderContext view-model
  • Stencil templates are logic-less: they only iterate and substitute
  • Three built-in themes (default, minimal, github) with user theme overrides
  • Multi-file and single-file layouts, configured via .swift-cli-docs.yml

Includes unit tests with fixtures, an Examples/DemoCLI consumer, and CI
matrix for macOS + Linux on Swift 5.9 and 6.0.

https://claude.ai/code/session_01L8VEwZS2SbtRfPpGMK924y

claude added 3 commits May 5, 2026 04:24
Implements the swift-cli-docs-plugin: a Swift Package Manager command plugin
that turns any Swift Argument Parser CLI into beautiful Markdown documentation.

Architecture:
- Plugin invokes a helper executable that parses --experimental-dump-help
- ContextBuilder pre-computes everything (synopsis, defaults, links, escapes)
  into a stable RenderContext view-model
- Stencil templates are logic-less: they only iterate and substitute
- Three built-in themes (default, minimal, github) with user theme overrides
- Multi-file and single-file layouts, configured via .swift-cli-docs.yml

Includes unit tests with fixtures, an Examples/DemoCLI consumer, and CI
matrix for macOS + Linux on Swift 5.9 and 6.0.

https://claude.ai/code/session_01L8VEwZS2SbtRfPpGMK924y
ArgumentParserToolInfo is an internal target of swift-argument-parser, not a
public product, so it can't be imported from another package. Re-declare the
Codable schema (ToolInfoV0, CommandInfoV0, ArgumentInfoV0, NameInfoV0) locally
so DumpHelpRunner can decode --experimental-dump-help JSON without the
upstream module.

https://claude.ai/code/session_01L8VEwZS2SbtRfPpGMK924y
displayName for an option includes all of its names joined by commas, so the
rendered output is "- \`-v, --verbose <level>\`" — not "- \`--verbose <level>\`".
Update the assertion to match.

https://claude.ai/code/session_01L8VEwZS2SbtRfPpGMK924y
@ilia3546 ilia3546 merged commit c74cc4a into main May 5, 2026
4 checks passed
@ilia3546 ilia3546 deleted the claude/swift-cli-doc-plugin-aVO40 branch May 5, 2026 07:39
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.

2 participants