forked from m0ngr31/lexigram-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
40 lines (34 loc) · 1.93 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env node
import * as caporal from 'caporal';
import {loginOrSwitch, downloadConfig, initSkill, updateOrDeploySkill, generateZip} from './actions';
declare const process : {
argv: any,
}
const program = caporal as any;
(program as Caporal)
.version('1.1.1')
.name('Lexigram-CLI')
.bin('lexigram')
.command('login', 'Authenticate with Amazon.')
.option('--no-browser', 'Login without browser', program.BOOL, false)
.help('Login to or switch to a different Amazon account.')
.action(loginOrSwitch)
.command('init-config', 'Generates a config file in the current directory for you to put in your server information.')
.help(`Downloads a file called kodi.config into the current directory.\n\n This file contains all the information the skill needs to work.`)
.action(downloadConfig)
.command('init-skill', 'Configure skill information for either Kanzi or Koko.')
.argument('[skill]', 'Skill to configure', /kanzi|koko/, 'kanzi')
.help('Select either kanzi (for Kodi remote), or koko (for streaming music from Kodi).')
.action(initSkill)
.command('deploy', 'Reads your current config file to generate the slot data and upload the skill data to Amazon.')
.argument('[skill]', 'Skill to deploy', /kanzi|koko/, 'kanzi')
.option('--invocation-name', 'Name you would like to use to invoke the skill', /kanzi|koko|kodi|/, '')
.option('--source-dir', 'Full path of directory containting Kodi or Koko source code')
.option('--url', 'URL endpoint of your server')
.help('Verifies kodi.config is valid, then generates the skill data needed, and uploads it to Amazon.')
.action(updateOrDeploySkill)
.command('generate-function', 'Generates a zip file you can upload directly to AWS Lambda.')
.argument('[skill]', 'Skill to generate zip for.', /kanzi|koko/, 'kanzi')
.help('Verifies kodi.config is valid, then generates a zip file you can upload directly to AWS Lambda.')
.action(generateZip);
program.parse(process.argv);