summaryrefslogtreecommitdiffhomepage
path: root/packages/opencode/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/opencode/src/index.ts')
-rw-r--r--packages/opencode/src/index.ts39
1 files changed, 21 insertions, 18 deletions
diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts
index e5509562b..6546958b2 100644
--- a/packages/opencode/src/index.ts
+++ b/packages/opencode/src/index.ts
@@ -25,9 +25,12 @@ const cancel = new AbortController()
const cli = yargs(hideBin(process.argv))
.scriptName("opencode")
- .version(Installation.VERSION)
+ .help("help", "show help")
+ .alias("help", "h")
+ .version("version", "show version number", Installation.VERSION)
+ .alias("version", "v")
.option("print-logs", {
- describe: "Print logs to stderr",
+ describe: "print logs to stderr",
type: "boolean",
})
.middleware(async () => {
@@ -40,7 +43,7 @@ const cli = yargs(hideBin(process.argv))
.usage("\n" + UI.logo())
.command({
command: "$0 [project]",
- describe: "start opencode TUI",
+ describe: "start opencode tui",
builder: (yargs) =>
yargs.positional("project", {
type: "string",
@@ -89,21 +92,21 @@ const cli = yargs(hideBin(process.argv))
},
})
- ;(async () => {
- if (Installation.VERSION === "dev") return
- if (Installation.isSnapshot()) return
- const config = await Config.global()
- if (config.autoupdate === false) return
- const latest = await Installation.latest()
- if (Installation.VERSION === latest) return
- const method = await Installation.method()
- if (method === "unknown") return
- await Installation.upgrade(method, latest)
- .then(() => {
- Bus.publish(Installation.Event.Updated, { version: latest })
- })
- .catch(() => {})
- })()
+ ; (async () => {
+ if (Installation.VERSION === "dev") return
+ if (Installation.isSnapshot()) return
+ const config = await Config.global()
+ if (config.autoupdate === false) return
+ const latest = await Installation.latest()
+ if (Installation.VERSION === latest) return
+ const method = await Installation.method()
+ if (method === "unknown") return
+ await Installation.upgrade(method, latest)
+ .then(() => {
+ Bus.publish(Installation.Event.Updated, { version: latest })
+ })
+ .catch(() => { })
+ })()
await proc.exited
server.stop()