Repository navigation
[codex] Add relation metadata and hidden help fields - #36
Merged
Merged
Conversation
Rename the color mode to avoid the underscore suffix and enable color detection for help output during error finalization. BREAKING CHANGE: ColorMode::auto_ is renamed to ColorMode::detect.
Use the ansi_up library to parse and render ANSI escape sequences in the ExamplePlayground component output.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the CLI20 schema/help system with first-class “relation” metadata (groups, conflicts, depends_on), adds hidden/deprecated/default/env/required metadata rendering in generated help, and refactors argument base tags + compile-time validation into dedicated headers.
Changes:
- Add
cli::relations(...)API withgroup,conflicts, anddepends_on, including compile-time schema checks and parse-time validation. - Enhance help generation with hidden/deprecated fields and inline metadata (required/env/default + relation hints), plus a customizable ANSI palette.
- Add docs + examples for relations and update the docs playground to render ANSI output.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_parse.cc | Adds relation schema fixtures + parse-time validation tests. |
| tests/test_help.cc | Updates color/help expectations; adds tests for hidden/deprecated/metadata + relations rendering. |
| include/cli/relation.hh | Introduces relation model types and builder functions (group/conflicts/depends_on/relations). |
| include/cli/parser.hh | Validates relations after required/env handling; extends format_help to accept a palette. |
| include/cli/help.hh | Renders hidden/deprecated/default/env/required and relation metadata; adds “Option groups” section; palette-aware styling. |
| include/cli/color.hh | Renames color mode to detect and adds HelpPalette + palette-aware resolve_color. |
| include/cli/argument.hh | Adds hidden/deprecated fields to parameters; wires relation validation into ArgumentSpec; refactors includes. |
| include/cli/argument_validation.hh | New header for compile-time validation helpers, including relation well-formedness checks. |
| include/cli/argument_base.hh | New header containing tag base classes + Nargs/Presence primitives. |
| flake.nix | Updates docs npm dependency hash. |
| examples/relations.cc | Adds a runnable example demonstrating relations. |
| docs/src/components/ExamplePlayground.tsx | Renders ANSI output as HTML via ansi_up for docs playground output. |
| docs/sidebars.ts | Adds the new Relations doc page to the sidebar. |
| docs/package.json | Adds ansi_up dependency. |
| docs/package-lock.json | Locks ansi_up dependency. |
| docs/docs/relations.mdx | New documentation page describing relations API and behavior. |
| docs/docs/examples/relations.mdx | New example doc page for the relations example. |
| docs/docs/examples/index.mdx | Inserts Relations into the examples index and renumbers subsequent entries. |
| docs/docs/examples/git.mdx | Adjusts sidebar position/title numbering. |
| docs/docs/examples/env-fallback.mdx | Adjusts sidebar position/title numbering. |
| docs/docs/examples/distribution-and-platform.mdx | Adjusts sidebar position/title numbering. |
| docs/docs/examples/custom-action.mdx | Adjusts sidebar position/title numbering. |
| docs/docs/examples/compiler.mdx | Adjusts sidebar position/title numbering. |
| docs/docs/examples/callback-entry-point.mdx | Adjusts sidebar position/title numbering. |
| docs/docs/examples/bind.mdx | Adjusts sidebar position/title numbering. |
| docs/docs/examples/advanced.mdx | Adjusts sidebar position/title numbering. |
Files not reviewed (1)
- docs/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gen740
enabled auto-merge (rebase)
May 12, 2026 10:08
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.
Summary
Validation