refactor(cli): colocate --help examples in command files - #202
Merged
Conversation
vanceingalls
approved these changes
Apr 2, 2026
Move per-command examples from the centralized `help.ts` record into each command file as `export const examples: Example[]`. help.ts now dynamically imports them at --help time. This means adding a new command and its examples happens in one file instead of two, reducing the chance of forgetting examples. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jrusso1020
force-pushed
the
refactor/colocate-cli-examples
branch
from
April 2, 2026 21:10
133894e to
a96784d
Compare
miguel-heygen
pushed a commit
that referenced
this pull request
Apr 3, 2026
Move per-command examples from the centralized `help.ts` record into each command file as `export const examples: Example[]`. help.ts now dynamically imports them at --help time. This means adding a new command and its examples happens in one file instead of two, reducing the chance of forgetting examples. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dahans-msft2
pushed a commit
to dahans-msft2/hyperframes
that referenced
this pull request
Aug 6, 2026
) Move per-command examples from the centralized `help.ts` record into each command file as `export const examples: Example[]`. help.ts now dynamically imports them at --help time. This means adding a new command and its examples happens in one file instead of two, reducing the chance of forgetting examples. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
What
Move per-command
--helpexamples from the centralizedhelp.tsrecord into each command file asexport const examples: Example[].Why
Previously, adding a CLI command required editing two files: the command definition (
commands/<name>.ts) and the examples record (help.ts). This made it easy to forget examples for new commands. Now examples live next to the command they document — one file to add, one file to review.How
commands/_examples.tswith the sharedExampletypeexamples: Example[]alongside itsexport default defineCommand(...)help.tsdynamically imports examples viaimport(\./commands/${name}.js`)at--help` timeSTATIC_EXAMPLESin help.ts handles commands without their own file (e.g.skills)Test plan
--helpoutput for tts, transcribe, render, and root — all show examples correctly