-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
76 lines (66 loc) · 1.98 KB
/
index.ts
File metadata and controls
76 lines (66 loc) · 1.98 KB
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
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bun
import { Command } from 'commander'
import * as core from './core/index'
const program = new Command()
program
.name('gild')
.version('0.1.0')
.description('https://gild.gg')
program
.command('new')
.description('create a new gild project')
.action(async () => {
await core.init()
})
program
.command('add')
.description('fetch remote package')
.argument('<repo>', 'github <user>/<repo> containing a package')
.argument('[version]', 'requested version for package, default is latest')
.action(async (repo, version) => {
await core.add(repo, version)
})
program
.command('status')
.description('sanity check current project')
.action(async () => {
await core.status()
})
program
.command('check')
.description('sanity check your system')
.action(async () => {
await core.check()
})
program
.command('get')
.description('fetch a remote config')
.action(async () => {
console.log('get')
})
program
.command('login')
.description('authenticate with fromafri.ca')
.action(async () => {
await core.login()
})
program
.command('execute [code]')
.description('execute code in isolated Firecracker VM')
.option('-f, --file <path>', 'execute code from file')
.option('-t, --timeout <ms>', 'execution timeout in milliseconds', '5000')
.option('-m, --memory <size>', 'memory allocation (e.g., 128M, 256M)', '128M')
.option('--vcpus <count>', 'number of vCPUs', '1')
.option('--mock', 'use mock Firecracker client (for testing)')
.option('-v, --verbose', 'show verbose output')
.action(async (code, options) => {
await core.execute(code, {
file: options.file,
timeout: parseInt(options.timeout),
memory: options.memory,
vcpus: parseInt(options.vcpus),
mock: options.mock,
verbose: options.verbose,
})
})
program.parse()