forked from ericc-ch/copilot-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
34 lines (30 loc) · 805 Bytes
/
main.ts
File metadata and controls
34 lines (30 loc) · 805 Bytes
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
#!/usr/bin/env node
import { defineCommand, runMain } from "citty"
import packageJson from "../package.json"
import { auth } from "./auth"
import { checkUsage } from "./check-usage"
import { debug } from "./debug"
import { start } from "./start"
const main = defineCommand({
meta: {
name: "xc-copilot-api",
version: packageJson.version,
description:
"A wrapper around GitHub Copilot API to make it OpenAI compatible, making it usable for other tools.",
},
args: {
version: {
type: "boolean",
alias: "V",
description: "Show version number",
},
},
run({ args }) {
if (args.version) {
console.log(packageJson.version)
process.exit(0)
}
},
subCommands: { auth, start, "check-usage": checkUsage, debug },
})
await runMain(main)