@@ -15,7 +15,7 @@ interface Command {
1515
1616Each command consists of:
1717
18- - ** name** : The command name used in the CLI (e.g., ` generate ` , ` interactive ` )
18+ - ** name** : The command name used in the CLI (e.g., ` generate ` )
1919- ** description** : A short description shown in help text
2020- ** options** : An object mapping option names to their definitions
2121- ** action** : The async function that executes when the command is run
@@ -57,12 +57,10 @@ Add your command to the exports in `bin/commands/index.mjs`:
5757
5858``` javascript
5959import generate from ' ./generate.mjs' ;
60- import interactive from ' ./interactive.mjs' ;
6160import myCommand from ' ./my-command.mjs' ; // Add this
6261
6362export default [
6463 generate,
65- interactive,
6664 myCommand, // Add this
6765];
6866```
@@ -79,7 +77,6 @@ Options define the flags and parameters your command accepts. Each option has:
7977interface Option {
8078 flags: string []; // CLI flags (e.g., ['-i', '--input <value>'])
8179 desc: string ; // Description for help text
82- prompt? : PromptConfig ; // Interactive mode configuration
8380}
8481```
8582
@@ -186,38 +183,3 @@ prompt: {
186183 ],
187184}
188185```
189-
190- ## Interactive Prompts
191-
192- The ` interactive ` command automatically uses the ` prompt ` configuration from your options. When users run:
193-
194- ``` bash
195- doc-kit interactive
196- ```
197-
198- They'll be prompted to select a command, then guided through all required options.
199-
200- ### Prompt Configuration
201-
202- - ** message** : Question to ask the user
203- - ** type** : Input type (` text ` , ` confirm ` , ` select ` , ` multiselect ` )
204- - ** required** : Whether the field must have a value
205- - ** initialValue** : Default value
206- - ** variadic** : Whether multiple values can be entered (for ` text ` type)
207- - ** options** : Choices for ` select ` /` multiselect ` types
208-
209- ### Making Options Interactive-Friendly
210-
211- Always provide helpful messages and sensible defaults:
212-
213- ``` javascript
214- threads: {
215- flags: [' -p' , ' --threads <number>' ],
216- desc: ' Number of threads to use (minimum: 1)' ,
217- prompt: {
218- type: ' text' ,
219- message: ' How many threads to allow' ,
220- initialValue: String (cpus ().length ), // Smart default
221- },
222- },
223- ```
0 commit comments