|
6 | 6 | 2. Inside the project folder run 'npm run build' |
7 | 7 | 3. Inside the packages folder(https://github.com/microsoft/botframework-cli/tree/master/packages) run 'npx oclif plugin <plugin-name>' |
8 | 8 | 4. Follow the wizard and set the prompts: |
9 | | - ``` |
10 | | - ? npm package: @microsoft/bf-<plugin-name> |
11 | | - ? description: <Plugin brief description> |
12 | | - ? author: Microsoft |
13 | | - ? version: 1.0.0 |
14 | | - ? license: MIT |
15 | | - ? Who is the GitHub owner of repository (https://github.com/OWNER/repo): microsoft |
16 | | - ? What is the GitHub name of repository (https://github.com/owner/REPO): botframework-cli |
17 | | - ? Select a package manager: npm |
18 | | - ? TypeScript: Y |
19 | | - ? Use tslint (linter for TypeScript): Y |
20 | | - ? Use mocha (testing framework): Y |
21 | | - ? Add CI service config (Press <space> to select, <a> to toggle all, <i> to invert selection): select any |
22 | | - ``` |
| 9 | + |
| 10 | + ? npm package: @microsoft/bf-<plugin-name> |
| 11 | + ? description: <Plugin brief description> |
| 12 | + ? author: Microsoft |
| 13 | + ? version: 1.0.0 |
| 14 | + ? license: MIT |
| 15 | + ? Who is the GitHub owner of repository (https://github.com/OWNER/repo): microsoft |
| 16 | + ? What is the GitHub name of repository (https://github.com/owner/REPO): botframework-cli |
| 17 | + ? Select a package manager: npm |
| 18 | + ? TypeScript: Y |
| 19 | + ? Use tslint (linter for TypeScript): Y |
| 20 | + ? Use mocha (testing framework): Y |
| 21 | + ? Add CI service config (Press <space> to select, <a> to toggle all, <i> to invert selection): select any |
| 22 | + |
23 | 23 | 4. Go to the folder created by the previous command and add @microsoft/bf-cli-command as a dependency in your package.json file |
24 | | - ``` |
25 | | - "dependencies": { |
| 24 | + |
| 25 | + "dependencies": { |
26 | 26 | ..., |
27 | 27 | "@microsoft/bf-cli-command": "1.0.0", |
28 | 28 | ... |
29 | | - } |
30 | | - ``` |
| 29 | + } |
| 30 | + |
31 | 31 | 5. At the root level(https://github.com/microsoft/botframework-cli) run 'npm run build' to bootstrap the packages |
32 | 32 |
|
33 | 33 | ## Steps to create a new command |
34 | 34 | 1. Inside the plugin folder run 'npx oclif command <command-name>'. |
35 | 35 | a. To add a subcommand use a colon separated format as follows: |
36 | 36 | <command-name:subcommand-name> |
37 | 37 | 2. Replace the import 'import {Command, flags} from '@oclif/command' line inside the newly created command with '@microsoft/bf-cli-command' |
38 | | - ``` |
39 | | - - import {Command, flags} from '@oclif/command' |
40 | | - + import {Command, flags} from '@microsoft/bf-cli-command' |
41 | | - ``` |
| 38 | + |
| 39 | + - import {Command, flags} from '@oclif/command' |
| 40 | + + import {Command, flags} from '@microsoft/bf-cli-command' |
| 41 | + |
42 | 42 | 3. Add the typing to the flags property like this if needed: |
43 | | - ``` |
| 43 | + |
44 | 44 | static flags: flags.Input<any> = { |
45 | 45 | help: flags.help({description: 'Display help'}), |
46 | 46 | } |
47 | | - ``` |
| 47 | + |
48 | 48 | 4. Implement the run method |
49 | 49 |
|
50 | 50 | ## General Guidelines |
|
0 commit comments