Skip to content

Conversation

@onbjerg
Copy link
Member

@onbjerg onbjerg commented Feb 2, 2026

Motivation

The CLI reference docs in the Foundry book are not that great to read, and you can't link to individual sections that well.

Solution

Have a mode to generate markdown CLI documentation from --help. The flag is hidden. I've modified clap-markdown because it looks unmaintained and there were some patches I wanted. Attribution in the source code.

Example output: https://gist.github.com/onbjerg/1bc68de7e464ad6d20060005ee427d42

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@onbjerg onbjerg requested a review from 0xrusowsky as a code owner February 2, 2026 10:29
@onbjerg onbjerg changed the title perf(bench): set gas limit to 100M for test benchmarks feat(cli): cli markdown docs Feb 2, 2026
Add a new crate for generating Markdown documentation from clap CLIs.
This is a fork of clap-markdown with the following enhancements:

- Support for grouped options by help heading (PR #48)
- Show environment variable names for arguments (PR #50)
- Add version information to generated Markdown (PR #52)
Add a hidden --markdown-help flag to forge, cast, anvil, and chisel
that prints CLI reference documentation as Markdown and exits.

This uses the new foundry-cli-markdown crate to generate the output.
DaniPopes
DaniPopes approved these changes Feb 3, 2026
@onbjerg onbjerg added this pull request to the merge queue Feb 3, 2026
Merged via the queue into master with commit 2e3c469 Feb 3, 2026
16 checks passed
@onbjerg onbjerg deleted the onbjerg/md-help branch February 3, 2026 01:38
@github-project-automation github-project-automation bot moved this to Done in Foundry Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants