You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add Commander.js built-in help text to all commands (#2984)
Add .description(), .addHelpText(), and .summary() to all CLI commands
so that `catalyst <command> --help` becomes the canonical reference.
Hide internal-only options (--api-host, --login-url) from help output.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
.description('Verify stored credentials and display store/project info.')
43
+
.addHelpText(
44
+
'after',
45
+
`
46
+
Example:
47
+
$ catalyst auth whoami
48
+
49
+
Logged in to My Store (abc123), connected to project my-project (43eba682-0c48-11f1-9bd5-827a48b0ce1e)`,
50
+
)
43
51
.addOption(
44
52
newOption(
45
53
'--store-hash <hash>',
@@ -55,7 +63,8 @@ const whoami = new Command('whoami')
55
63
.addOption(
56
64
newOption('--api-host <host>','BigCommerce API host. The default is api.bigcommerce.com.')
57
65
.env('BIGCOMMERCE_API_HOST')
58
-
.default('api.bigcommerce.com'),
66
+
.default('api.bigcommerce.com')
67
+
.hideHelp(),
59
68
)
60
69
.action(async(options)=>{
61
70
try{
@@ -110,7 +119,19 @@ const whoami = new Command('whoami')
110
119
});
111
120
112
121
constlogin=newCommand('login')
113
-
.description('Authenticate via browser using the OAuth device code flow.')
122
+
.description(
123
+
'Authenticate via browser using the OAuth device code flow. If already logged in, displays current credentials and suggests running `catalyst auth logout` to re-authenticate.',
124
+
)
125
+
.addHelpText(
126
+
'after',
127
+
`
128
+
Examples:
129
+
# Login via browser (recommended)
130
+
$ catalyst auth login
131
+
132
+
# Login with existing credentials (skips browser flow)
Copy file name to clipboardExpand all lines: packages/catalyst/src/cli/commands/project.ts
+28-3Lines changed: 28 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ import { getTelemetry } from '../lib/telemetry';
8
8
9
9
constlist=newCommand('list')
10
10
.description('List BigCommerce infrastructure projects for your store.')
11
+
.addHelpText(
12
+
'after',
13
+
`
14
+
Example:
15
+
$ catalyst project list`,
16
+
)
11
17
.addOption(
12
18
newOption(
13
19
'--store-hash <hash>',
@@ -23,7 +29,8 @@ const list = new Command('list')
23
29
.addOption(
24
30
newOption('--api-host <host>','BigCommerce API host. The default is api.bigcommerce.com.')
25
31
.env('BIGCOMMERCE_API_HOST')
26
-
.default('api.bigcommerce.com'),
32
+
.default('api.bigcommerce.com')
33
+
.hideHelp(),
27
34
)
28
35
.action(async(options)=>{
29
36
constconfig=getProjectConfig();
@@ -55,6 +62,12 @@ const create = new Command('create')
55
62
.description(
56
63
'Create a new BigCommerce infrastructure project and link it to your local Catalyst project.',
57
64
)
65
+
.addHelpText(
66
+
'after',
67
+
`
68
+
Example:
69
+
$ catalyst project create`,
70
+
)
58
71
.addOption(
59
72
newOption(
60
73
'--store-hash <hash>',
@@ -70,7 +83,8 @@ const create = new Command('create')
70
83
.addOption(
71
84
newOption('--api-host <host>','BigCommerce API host. The default is api.bigcommerce.com.')
72
85
.env('BIGCOMMERCE_API_HOST')
73
-
.default('api.bigcommerce.com'),
86
+
.default('api.bigcommerce.com')
87
+
.hideHelp(),
74
88
)
75
89
.action(async(options)=>{
76
90
constconfig=getProjectConfig();
@@ -99,6 +113,16 @@ export const link = new Command('link')
99
113
.description(
100
114
'Link your local Catalyst project to a BigCommerce infrastructure project. You can provide a project UUID directly, or fetch and select from available projects using your store credentials.',
101
115
)
116
+
.addHelpText(
117
+
'after',
118
+
`
119
+
Examples:
120
+
# Link interactively (prompts to select or create)
121
+
$ catalyst project link
122
+
123
+
# Link using a project UUID directly
124
+
$ catalyst project link --project-uuid <UUID>`,
125
+
)
102
126
.addOption(
103
127
newOption(
104
128
'--store-hash <hash>',
@@ -114,7 +138,8 @@ export const link = new Command('link')
114
138
.addOption(
115
139
newOption('--api-host <host>','BigCommerce API host. The default is api.bigcommerce.com.')
'View or change CLI telemetry collection status. Enabling telemetry helps BigCommerce support diagnose and troubleshoot errors you encounter when using the CLI.',
0 commit comments