Skip to content

Commit 258e94b

Browse files
authored
feat(cli): add Examples help text to 7 feat subcommands (#812)
## Summary Adds `addHelpText('after', ...)` Examples sections to seven `shep feat` subcommands, mirroring the pattern in `ui.command.ts`. ## Motivation New users discover subcommands via `shep feat <cmd> --help`. These seven commands previously ended at the flag list with no runnable examples, even though each file's JSDoc/Usage header already documented the intended invocations. ## Changes | Command | Examples | |---------|----------| | `feat adopt` | 2 | | `feat archive` | 2 | | `feat del` | 4 | | `feat feedback` | 2 (includes concrete feedback string) | | `feat promote` | 2 | | `feat review` | 2 | | `feat unarchive` | 1 | Example invocations are taken from existing file-level Usage / `@example` headers — no new flag combinations were introduced. ## Tests - [x] `pnpm validate` (format, lint, typecheck, tsp:compile) - [x] `pnpm dev:cli feat adopt --help` - [x] `pnpm dev:cli feat archive --help` - [x] `pnpm dev:cli feat del --help` - [x] `pnpm dev:cli feat feedback --help` - [x] `pnpm dev:cli feat promote --help` - [x] `pnpm dev:cli feat review --help` - [x] `pnpm dev:cli feat unarchive --help` ## Notes - Documentation-only change; no runtime behavior changes. - Example descriptions use inline English strings (not i18n), consistent with `ui.command.ts` and other CLI help examples. Fixes #790 Co-authored-by: syf2211 <syf2211@users.noreply.github.com>
1 parent 0fd19be commit 258e94b

7 files changed

Lines changed: 50 additions & 0 deletions

File tree

src/presentation/cli/commands/feat/adopt.command.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ export function createAdoptCommand(): Command {
2020
const t = getCliI18n().t;
2121
return new Command('adopt')
2222
.description(t('cli:commands.feat.adopt.description'))
23+
.addHelpText(
24+
'after',
25+
`
26+
Examples:
27+
$ shep feat adopt <branch> Adopt a branch into feature tracking
28+
$ shep feat adopt <branch> -r /path/to/repo Adopt from a specific repository`
29+
)
2330
.argument('<branch>', t('cli:commands.feat.adopt.branchArgument'))
2431
.option('-r, --repo <path>', t('cli:commands.feat.adopt.repoOption'))
2532
.action(async (branch: string, options: { repo?: string }) => {

src/presentation/cli/commands/feat/archive.command.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ export function createArchiveCommand(): Command {
3030
const t = getCliI18n().t;
3131
return new Command('archive')
3232
.description(t('cli:commands.feat.archive.description'))
33+
.addHelpText(
34+
'after',
35+
`
36+
Examples:
37+
$ shep feat archive feat-123 Archive a feature (prompts for confirmation)
38+
$ shep feat archive feat-123 --force Archive without confirmation`
39+
)
3340
.argument('<id>', t('cli:commands.feat.archive.idArgument'))
3441
.option('-f, --force', t('cli:commands.feat.archive.forceOption'))
3542
.action(async (featureId: string, options: ArchiveOptions) => {

src/presentation/cli/commands/feat/del.command.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ export function createDelCommand(): Command {
3434
const t = getCliI18n().t;
3535
return new Command('del')
3636
.description(t('cli:commands.feat.del.description'))
37+
.addHelpText(
38+
'after',
39+
`
40+
Examples:
41+
$ shep feat del feat-123 Delete a feature (prompts for confirmation)
42+
$ shep feat del feat-123 --force Delete without confirmation
43+
$ shep feat del feat-123 --force --no-cleanup Delete but keep worktree and branches
44+
$ shep feat del feat-123 --force --no-close-pr Delete but leave the open PR open`
45+
)
3746
.argument('<id>', t('cli:commands.feat.del.idArgument'))
3847
.option('-f, --force', t('cli:commands.feat.del.forceOption'))
3948
.option('--no-cleanup', t('cli:commands.feat.del.noCleanupOption'))

src/presentation/cli/commands/feat/feedback.command.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ export function createFeedbackCommand(): Command {
2121
const t = getCliI18n().t;
2222
return new Command('feedback')
2323
.description(t('cli:commands.feat.feedback.description'))
24+
.addHelpText(
25+
'after',
26+
`
27+
Examples:
28+
$ shep feat feedback <id> <feedback-text> Send feedback on an exploration prototype
29+
$ shep feat feedback feat-123 "Make the sidebar collapsible on mobile" Iterate on a design with concrete feedback`
30+
)
2431
.argument('<id>', t('cli:commands.feat.feedback.idArgument'))
2532
.argument('<feedback>', t('cli:commands.feat.feedback.feedbackArgument'))
2633
.action(async (featureId: string, feedback: string) => {

src/presentation/cli/commands/feat/promote.command.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ export function createPromoteCommand(): Command {
2424
const t = getCliI18n().t;
2525
return new Command('promote')
2626
.description(t('cli:commands.feat.promote.description'))
27+
.addHelpText(
28+
'after',
29+
`
30+
Examples:
31+
$ shep feat promote <id> Promote to Regular mode
32+
$ shep feat promote <id> --fast Promote to Fast mode`
33+
)
2734
.argument('<id>', t('cli:commands.feat.promote.idArgument'))
2835
.option('--fast', t('cli:commands.feat.promote.fastOption'))
2936
.action(async (featureId: string, options: PromoteOptions) => {

src/presentation/cli/commands/feat/review.command.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ export function createReviewCommand(): Command {
7979
const t = getCliI18n().t;
8080
return new Command('review')
8181
.description(t('cli:commands.feat.review.description'))
82+
.addHelpText(
83+
'after',
84+
`
85+
Examples:
86+
$ shep feat review Auto-pick the single waiting feature
87+
$ shep feat review feat-123 Review a specific feature by id`
88+
)
8289
.argument('[id]', t('cli:commands.feat.review.idArgument'))
8390
.action(async (featureId?: string) => {
8491
try {

src/presentation/cli/commands/feat/unarchive.command.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ export function createUnarchiveCommand(): Command {
2424
const t = getCliI18n().t;
2525
return new Command('unarchive')
2626
.description(t('cli:commands.feat.unarchive.description'))
27+
.addHelpText(
28+
'after',
29+
`
30+
Examples:
31+
$ shep feat unarchive feat-123 Restore an archived feature to its previous lifecycle`
32+
)
2733
.argument('<id>', t('cli:commands.feat.unarchive.idArgument'))
2834
.action(async (featureId: string) => {
2935
try {

0 commit comments

Comments
 (0)