Skip to content

Commit 33d2fd4

Browse files
improve #3, #4, #5, #7, #9, #12 and #13 and add init command
1 parent 3730819 commit 33d2fd4

File tree

14 files changed

+165
-48
lines changed

14 files changed

+165
-48
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
node_modules
88
test
99
model
10-
function
10+
function
11+
hello-world/

README.md

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ USAGE
5656
* [`twilio autopilot:fieldtypes:update`](#twilio-autopilotfieldtypesupdate)
5757
* [`twilio autopilot:fieldvalues:upload`](#twilio-autopilotfieldvaluesupload)
5858
* [`twilio autopilot:import [TYPE]`](#twilio-autopilotimport-type)
59+
* [`twilio autopilot:init`](#twilio-autopilotinit)
5960
* [`twilio autopilot:list`](#twilio-autopilotlist)
6061
* [`twilio autopilot:modelbuilds:create`](#twilio-autopilotmodelbuildscreate)
6162
* [`twilio autopilot:queries:export`](#twilio-autopilotqueriesexport)
@@ -87,7 +88,7 @@ OPTIONS
8788
-s, --schema=schema (required) [default: templates] schema path
8889
```
8990

90-
_See code: [src/commands/autopilot/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/create.js)_
91+
_See code: [src/commands/autopilot/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/create.js)_
9192

9293
## `twilio autopilot:delete`
9394

@@ -105,7 +106,7 @@ OPTIONS
105106
--uniqueName=uniqueName assistant uniqueName
106107
```
107108

108-
_See code: [src/commands/autopilot/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/delete.js)_
109+
_See code: [src/commands/autopilot/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/delete.js)_
109110

110111
## `twilio autopilot:deploy`
111112

@@ -131,7 +132,7 @@ OPTIONS
131132
--auth-token=auth-token Use a specific auth token for deployment. Uses fields from .env otherwise
132133
```
133134

134-
_See code: [src/commands/autopilot/deploy.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/deploy.js)_
135+
_See code: [src/commands/autopilot/deploy.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/deploy.js)_
135136

136137
## `twilio autopilot:export`
137138

@@ -149,7 +150,7 @@ OPTIONS
149150
--uniqueName=uniqueName assistant uniqueName
150151
```
151152

152-
_See code: [src/commands/autopilot/export.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/export.js)_
153+
_See code: [src/commands/autopilot/export.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/export.js)_
153154

154155
## `twilio autopilot:fields:create`
155156

@@ -174,7 +175,7 @@ OPTIONS
174175
--uniqueName=uniqueName (required) field unique name
175176
```
176177

177-
_See code: [src/commands/autopilot/fields/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/fields/create.js)_
178+
_See code: [src/commands/autopilot/fields/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/fields/create.js)_
178179

179180
## `twilio autopilot:fields:delete`
180181

@@ -197,7 +198,7 @@ OPTIONS
197198
--taskSid=taskSid task sid
198199
```
199200

200-
_See code: [src/commands/autopilot/fields/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/fields/delete.js)_
201+
_See code: [src/commands/autopilot/fields/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/fields/delete.js)_
201202

202203
## `twilio autopilot:fields:list`
203204

@@ -216,7 +217,7 @@ OPTIONS
216217
--taskSid=taskSid task sid
217218
```
218219

219-
_See code: [src/commands/autopilot/fields/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/fields/list.js)_
220+
_See code: [src/commands/autopilot/fields/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/fields/list.js)_
220221

221222
## `twilio autopilot:fieldtypes:create`
222223

@@ -235,7 +236,7 @@ OPTIONS
235236
--uniqueName=uniqueName (required) unique name for the field type
236237
```
237238

238-
_See code: [src/commands/autopilot/fieldtypes/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/fieldtypes/create.js)_
239+
_See code: [src/commands/autopilot/fieldtypes/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/fieldtypes/create.js)_
239240

240241
## `twilio autopilot:fieldtypes:list`
241242

@@ -253,7 +254,7 @@ OPTIONS
253254
--properties=properties [default: sid, uniqueName] The Autopilot Assistant FieldType List.
254255
```
255256

256-
_See code: [src/commands/autopilot/fieldtypes/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/fieldtypes/list.js)_
257+
_See code: [src/commands/autopilot/fieldtypes/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/fieldtypes/list.js)_
257258

258259
## `twilio autopilot:fieldtypes:update`
259260

@@ -273,7 +274,7 @@ OPTIONS
273274
--uniqueName=uniqueName field type unique name to update
274275
```
275276

276-
_See code: [src/commands/autopilot/fieldtypes/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/fieldtypes/update.js)_
277+
_See code: [src/commands/autopilot/fieldtypes/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/fieldtypes/update.js)_
277278

278279
## `twilio autopilot:fieldvalues:upload`
279280

@@ -292,7 +293,7 @@ OPTIONS
292293
--fileName=fileName (required) a CSV file of field values (one on each row with synonyms in columns)
293294
```
294295

295-
_See code: [src/commands/autopilot/fieldvalues/upload.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/fieldvalues/upload.js)_
296+
_See code: [src/commands/autopilot/fieldvalues/upload.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/fieldvalues/upload.js)_
296297

297298
## `twilio autopilot:import [TYPE]`
298299

@@ -321,7 +322,25 @@ DESCRIPTION
321322
-> twilio autopilot:import alexa --model <alexa-interaction-model-file> [--redirectURL <alexa-back-end-hanlder-url>]
322323
```
323324

324-
_See code: [src/commands/autopilot/import.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/import.js)_
325+
_See code: [src/commands/autopilot/import.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/import.js)_
326+
327+
## `twilio autopilot:init`
328+
329+
Init autopilot bot template
330+
331+
```
332+
USAGE
333+
$ twilio autopilot:init
334+
335+
OPTIONS
336+
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
337+
-o=(columns|json|tsv) [default: columns] Format of command output.
338+
-p, --profile=profile Shorthand identifier for your profile.
339+
-u, --accountSid=accountSid A specific account SID to be used for deployment
340+
--authToken=authToken Use a specific auth token for deployment
341+
```
342+
343+
_See code: [src/commands/autopilot/init.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/init.js)_
325344

326345
## `twilio autopilot:list`
327346

@@ -338,7 +357,7 @@ OPTIONS
338357
--properties=properties [default: sid, uniqueName, friendlyName] The Autopilot Assistant List.
339358
```
340359

341-
_See code: [src/commands/autopilot/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/list.js)_
360+
_See code: [src/commands/autopilot/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/list.js)_
342361

343362
## `twilio autopilot:modelbuilds:create`
344363

@@ -356,7 +375,7 @@ OPTIONS
356375
-u, --callbackURL=callbackURL URL to get notified of model build status
357376
```
358377

359-
_See code: [src/commands/autopilot/modelbuilds/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/modelbuilds/create.js)_
378+
_See code: [src/commands/autopilot/modelbuilds/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/modelbuilds/create.js)_
360379

361380
## `twilio autopilot:queries:export`
362381

@@ -374,7 +393,7 @@ OPTIONS
374393
-s, --assistantSid=assistantSid (required) assistant that owns the task
375394
```
376395

377-
_See code: [src/commands/autopilot/queries/export.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/queries/export.js)_
396+
_See code: [src/commands/autopilot/queries/export.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/queries/export.js)_
378397

379398
## `twilio autopilot:samples:upload`
380399

@@ -393,7 +412,7 @@ OPTIONS
393412
--taskSid=taskSid task sid
394413
```
395414

396-
_See code: [src/commands/autopilot/samples/upload.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/samples/upload.js)_
415+
_See code: [src/commands/autopilot/samples/upload.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/samples/upload.js)_
397416

398417
## `twilio autopilot:simulate`
399418

@@ -411,7 +430,7 @@ OPTIONS
411430
-t, --text=text (required) User text input
412431
```
413432

414-
_See code: [src/commands/autopilot/simulate.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/simulate.js)_
433+
_See code: [src/commands/autopilot/simulate.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/simulate.js)_
415434

416435
## `twilio autopilot:tasks:create`
417436

@@ -430,7 +449,7 @@ OPTIONS
430449
--uniqueName=uniqueName (required) unique name for task
431450
```
432451

433-
_See code: [src/commands/autopilot/tasks/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/tasks/create.js)_
452+
_See code: [src/commands/autopilot/tasks/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/tasks/create.js)_
434453

435454
## `twilio autopilot:tasks:delete`
436455

@@ -448,7 +467,7 @@ OPTIONS
448467
--taskSid=taskSid task sid
449468
```
450469

451-
_See code: [src/commands/autopilot/tasks/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/tasks/delete.js)_
470+
_See code: [src/commands/autopilot/tasks/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/tasks/delete.js)_
452471

453472
## `twilio autopilot:tasks:list`
454473

@@ -466,7 +485,7 @@ OPTIONS
466485
--properties=properties [default: sid, uniqueName, friendlyName] The Autopilot Assistant Task List.
467486
```
468487

469-
_See code: [src/commands/autopilot/tasks/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/tasks/list.js)_
488+
_See code: [src/commands/autopilot/tasks/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/tasks/list.js)_
470489

471490
## `twilio autopilot:tasks:update`
472491

@@ -486,7 +505,7 @@ OPTIONS
486505
--uniqueName=uniqueName task unique name to update
487506
```
488507

489-
_See code: [src/commands/autopilot/tasks/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/tasks/update.js)_
508+
_See code: [src/commands/autopilot/tasks/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/tasks/update.js)_
490509

491510
## `twilio autopilot:update`
492511

@@ -504,7 +523,7 @@ OPTIONS
504523
--uniqueName=uniqueName assistant uniqueName
505524
```
506525

507-
_See code: [src/commands/autopilot/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/update.js)_
526+
_See code: [src/commands/autopilot/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/update.js)_
508527

509528
## `twilio autopilot:webhooks:create`
510529

@@ -525,7 +544,7 @@ OPTIONS
525544
-w, --webhookUniqueName=webhookUniqueName (required) unique name for webhook
526545
```
527546

528-
_See code: [src/commands/autopilot/webhooks/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/webhooks/create.js)_
547+
_See code: [src/commands/autopilot/webhooks/create.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/webhooks/create.js)_
529548

530549
## `twilio autopilot:webhooks:delete`
531550

@@ -543,7 +562,7 @@ OPTIONS
543562
--webhookSid=webhookSid SID of the webhook to delete
544563
```
545564

546-
_See code: [src/commands/autopilot/webhooks/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/webhooks/delete.js)_
565+
_See code: [src/commands/autopilot/webhooks/delete.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/webhooks/delete.js)_
547566

548567
## `twilio autopilot:webhooks:list`
549568

@@ -563,7 +582,7 @@ OPTIONS
563582
webhookMethod] The Autopilot Assistant Webhooks List.
564583
```
565584

566-
_See code: [src/commands/autopilot/webhooks/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/webhooks/list.js)_
585+
_See code: [src/commands/autopilot/webhooks/list.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/webhooks/list.js)_
567586

568587
## `twilio autopilot:webhooks:update`
569588

@@ -585,7 +604,7 @@ OPTIONS
585604
--webhookSid=webhookSid SID of the webhook to update
586605
```
587606

588-
_See code: [src/commands/autopilot/webhooks/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.14/src/commands/autopilot/webhooks/update.js)_
607+
_See code: [src/commands/autopilot/webhooks/update.js](https://github.com/tingiris/twilio-cli-autopilot-plugin/blob/v1.0.0-beta.15/src/commands/autopilot/webhooks/update.js)_
589608

590609
## `twilio help [COMMAND]`
591610

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{
22
"name": "@dabblelab/plugin-autopilot",
33
"description": "Create, Update, Delete, List, Simulate, Import and Export Twilio Autopilot Assistant",
4-
"version": "1.0.0-beta.14",
4+
"version": "1.0.0-beta.15",
55
"author": "Steve Tingiris",
66
"bugs": "https://github.com/tingiris/twilio-cli-autopilot-plugin/issues",
77
"dependencies": {
8-
"@dabblelab/autopilot-core": "^1.0.0-beta.10",
8+
"@dabblelab/autopilot-core": "^1.0.0-beta.11",
99
"@oclif/command": "^1.5.19",
1010
"@oclif/config": "^1.13.3",
1111
"@oclif/plugin-help": "^2.2.1",
1212
"@twilio/cli-core": "^3.0.3",
13-
"csv-parse": "^4.6.3",
13+
"csv-parse": "^4.6.5",
1414
"extract-zip": "^1.6.7",
1515
"ora": "^3.4.0",
16+
"pkg-install": "^1.0.0",
1617
"pretty-json-stringify": "0.0.2",
1718
"request-promise": "^4.2.4",
1819
"simple-git": "^1.124.0",
@@ -149,6 +150,9 @@
149150
},
150151
"autopilot:deploy": {
151152
"description": "deploy function, model or all of them. Options can only be 'all', 'function' or 'model'."
153+
},
154+
"autopilot:init": {
155+
"description": "Initialize autopilot bot template."
152156
}
153157
}
154158
},

src/commands/autopilot/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class AssistantsDeploy extends TwilioClientCommand {
3939
hanlder_response = await handler(opts, externalOptions);
4040
}
4141

42-
const fullPath = path.resolve(process.cwd(), 'model', 'model.json');
42+
const fullPath = path.resolve(process.cwd(), 'model', 'schema.json');
4343
if(flags.target === 'all'){
4444
await updateTaskURL(fullPath, hanlder_response.url);
4545
}

src/commands/autopilot/fields/create.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CreateAssistantTaskField extends TwilioClientCommand {
4545
{
4646
type: 'list',
4747
name: 'taskUniqueName',
48-
message: 'Select task in which to create: ',
48+
message: 'Choose a Task for the new Field: ',
4949
choices: taskChoice
5050
}
5151
]
@@ -74,7 +74,7 @@ class CreateAssistantTaskField extends TwilioClientCommand {
7474
{
7575
type: 'list',
7676
name: 'fieldTypeUniqueName',
77-
message: 'Select Field Type in which to create: ',
77+
message: 'Choose a Field Type for the new Field: ',
7878
choices: f_choices
7979
}
8080
]
@@ -89,7 +89,7 @@ class CreateAssistantTaskField extends TwilioClientCommand {
8989
const field = await AutopilotCore.fields.create(this.twilioClient, assistantSid, tSid, params);
9090

9191
spinner.stop();
92-
console.log(`Task field with UniqueName: ${uniqueName} was created.`);
92+
console.log(`Task field '${uniqueName}' was created.`);
9393
}catch(err){
9494

9595
spinner.stop();

src/commands/autopilot/fields/delete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DeleteAssistantTaskField extends TwilioClientCommand {
3636
{
3737
type: 'list',
3838
name: 'taskUniqueName',
39-
message: 'Select task in which to delete: ',
39+
message: 'Choose the Task your Field belongs to: ',
4040
choices: taskChoice
4141
}
4242
]
@@ -61,7 +61,7 @@ class DeleteAssistantTaskField extends TwilioClientCommand {
6161
{
6262
type: 'list',
6363
name: 'fieldUniqueName',
64-
message: 'Select Field to delete: ',
64+
message: 'Choose the Field to delete: ',
6565
choices: fieldChoice
6666
}
6767
]

src/commands/autopilot/fields/list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ListAssistantTaskFields extends TwilioClientCommand {
3636
{
3737
type: 'list',
3838
name: 'taskUniqueName',
39-
message: 'Select task in which to list: ',
39+
message: 'Choose the Task your Fields belong to: ',
4040
choices: taskChoice
4141
}
4242
]

0 commit comments

Comments
 (0)