Skip to content

improve: redesign CLI reference flag rendering#2999

Merged
bartlomieju merged 4 commits intomainfrom
improve-cli-reference-pages
Mar 30, 2026
Merged

improve: redesign CLI reference flag rendering#2999
bartlomieju merged 4 commits intomainfrom
improve-cli-reference-pages

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju commented Mar 27, 2026

Summary

  • Redesign auto-generated CLI flags from bare <h3> headings into bordered cards for better scannability
  • Show short flags inline with long flags (e.g. --config, -c instead of separate "Short flag" text)
  • Parse the usage field from json_reference to extract and display value types (<FILE>, <DIR>, <N>) alongside the flag name
  • Mark optional values with an "optional" tag for flags like --fail-fast[=<N>]
  • Wrap each flag in a consistent card component with grouped spacing

Before:
Screenshot 2026-03-27 at 14 53 42

After:
Screenshot 2026-03-27 at 14 45 44

bartlomieju and others added 2 commits March 27, 2026 14:44
Redesign the auto-generated CLI flags section to be more scannable
and informative:

- Render each flag as a bordered card instead of a bare h3 heading
- Show short flags inline with long flags (e.g. `--config, -c`)
- Parse the `usage` field to extract and display value types
  (e.g. `<FILE>`, `<DIR>`, `<N>`)
- Mark optional values with an "optional" tag
- Group flags with consistent spacing
- Use smaller text for descriptions to keep cards compact

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@josh-collinsworth josh-collinsworth left a comment

Choose a reason for hiding this comment

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

Approved, with a couple of comments:

  1. I actually don't know that you need the cards. I think the typography changes alone do a lot for scannability. Adding the card lines might just clutter up the page. (If it seems like items need to be separated more, maybe just try more space?) But if you try it and it still seems like cards are the best approach, I'm fine with it.

  2. I'm a little concerned this will have a long tail of side effects; we'll want to monitor and closely look through the reference pages at various screen sizes and in both light and dark mode to be safe.

@bartlomieju
Copy link
Copy Markdown
Member Author

Thanks, I did remove the card style

@bartlomieju bartlomieju merged commit 08bef37 into main Mar 30, 2026
1 of 2 checks passed
@bartlomieju bartlomieju deleted the improve-cli-reference-pages branch March 30, 2026 08:45
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