-
Notifications
You must be signed in to change notification settings - Fork 4
/
cli.js
executable file
·65 lines (64 loc) · 1.77 KB
/
cli.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env node
const argv = require('yargs')
.env('KULFON_ENV')
.version()
.usage('Usage: kulfon <command> [options]')
.command(
['new [dir]', 'init', 'n'],
'Initialize the directory',
require('./cli/init')
)
.example(
'kulfon init my-project',
'Create `my-project` directory and initialize using `default` theme'
)
.example(
'kulfon init my-project --theme bare',
'Create `my-project` directory and initialize using `bare` theme'
)
.command(
['server [dir]', 'serve', 's'],
'Serve the directory',
require('./cli/server')
)
.example('kulfon server --port 4000', 'Serve the directory at the port 4000')
.command(
['compile', 'build', 'c', 'b'],
'Build source files to static assets',
require('./cli/compiler')
)
.example(
'kulfon compile --environment production',
'Build source files for production (minified)'
)
.command(
['search [name]', 'find'],
'Find NPM package',
require('./cli/search')
)
.command(
['add [asset]', 'a'],
'Add asset dependency (CSS or JS) from NPM either via unpkg or directly',
require('./cli/add')
)
.command(
['list [name]', 'l'],
'List `themes` or installed `assets`',
require('./cli/list')
)
.commandDir('cli')
.command(['docs'], 'Go to the documentation at https://kulfon.net', {}, _ =>
console.log('https://kulfon.net')
)
.command(
['deploy'],
'Deploy the `public/` directory to a specified server via rsync',
require('./cli/deploy')
)
.command(['clean'], 'Remove `public/` directory', require('./cli/clean'))
.demandCommand(1, 'You need at least one command before moving on')
.help('h')
.alias('h', 'help')
.epilogue(
'for more information, find the documentation at https://kulfon.net'
).argv;