summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJay V <[email protected]>2025-06-23 13:00:21 -0400
committerJay V <[email protected]>2025-06-23 13:00:24 -0400
commitfa991920bc721ce15ce6921dd91e83abab2fa23e (patch)
treec245a7790e06d870351fd937262fb130c0c17254
parent5e79e3d7a5b97fc52a735dbe5fecb4cd1bcf098f (diff)
downloadopencode-fa991920bc721ce15ce6921dd91e83abab2fa23e.tar.gz
opencode-fa991920bc721ce15ce6921dd91e83abab2fa23e.zip
fix help copy
-rw-r--r--bun.lock4
-rw-r--r--packages/opencode/src/cli/cmd/auth.ts8
-rw-r--r--packages/opencode/src/cli/cmd/run.ts8
-rw-r--r--packages/opencode/src/cli/cmd/upgrade.ts6
-rw-r--r--packages/opencode/src/index.ts39
5 files changed, 34 insertions, 31 deletions
diff --git a/bun.lock b/bun.lock
index 18684d78a..506031b14 100644
--- a/bun.lock
+++ b/bun.lock
@@ -458,7 +458,7 @@
"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.20.7" } }, "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng=="],
- "@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.16" } }, "sha512-1aCZJ/6nSiViw339RsaNhkNoEloLaPzZhxMOYEa7OzRzO41IGg5n/7I43/ZIAW/c+Q6cT12Vf7fOZOoVIzb5BQ=="],
+ "@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.17" } }, "sha512-l/BYs/JYt+cXA/0+wUhulYJB6a6p//GTPiJ7nV+QHa8iiId4HZmnu/3J/SowP5g0rTiERY2kfGKXEK5Ehltx4Q=="],
"@types/debug": ["@types/[email protected]", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="],
@@ -596,7 +596,7 @@
"buffer": ["[email protected]", "", { "dependencies": { "base64-js": "^1.0.2", "ieee754": "^1.1.4", "isarray": "^1.0.0" } }, "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg=="],
- "bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-ciXLrHV4PXax9vHvUrkvun9VPVGOVwbbbBF/Ev1cXz12lyEZMoJpIJABOfPcN9gDJRaiKF9MVbSygLg4NXu3/A=="],
+ "bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-ElC7ItwT3SCQwYZDYoAH+q6KT4Fxjl8DtZ6qDulUFBmXA8YB4xo+l54J9ZJN+k2pphfn9vk7kfubeSd5QfTVJQ=="],
"bundle-name": ["[email protected]", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],
diff --git a/packages/opencode/src/cli/cmd/auth.ts b/packages/opencode/src/cli/cmd/auth.ts
index a9f01f230..71b2445d9 100644
--- a/packages/opencode/src/cli/cmd/auth.ts
+++ b/packages/opencode/src/cli/cmd/auth.ts
@@ -10,14 +10,14 @@ import { map, pipe, sortBy, values } from "remeda"
export const AuthCommand = cmd({
command: "auth",
- describe: "Manage credentials",
+ describe: "manage credentials",
builder: (yargs) =>
yargs
.command(AuthLoginCommand)
.command(AuthLogoutCommand)
.command(AuthListCommand)
.demandCommand(),
- async handler() {},
+ async handler() { },
})
export const AuthListCommand = cmd({
@@ -41,7 +41,7 @@ export const AuthListCommand = cmd({
export const AuthLoginCommand = cmd({
command: "login",
- describe: "login to a provider",
+ describe: "log in to a provider",
async handler() {
UI.empty()
prompts.intro("Add credential")
@@ -195,7 +195,7 @@ export const AuthLoginCommand = cmd({
export const AuthLogoutCommand = cmd({
command: "logout",
- describe: "logout from a configured provider",
+ describe: "log out from a configured provider",
async handler() {
UI.empty()
const credentials = await Auth.all().then((x) => Object.entries(x))
diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts
index 68b71f596..526785103 100644
--- a/packages/opencode/src/cli/cmd/run.ts
+++ b/packages/opencode/src/cli/cmd/run.ts
@@ -25,7 +25,7 @@ const TOOL: Record<string, [string, string]> = {
export const RunCommand = cmd({
command: "run [message..]",
- describe: "Run opencode with a message",
+ describe: "run opencode with a message",
builder: (yargs: Argv) => {
return yargs
.positional("message", {
@@ -36,12 +36,12 @@ export const RunCommand = cmd({
})
.option("continue", {
alias: ["c"],
- describe: "Continue the last session",
+ describe: "continue the last session",
type: "boolean",
})
.option("session", {
alias: ["s"],
- describe: "Session ID to continue",
+ describe: "session id to continue",
type: "string",
})
.option("share", {
@@ -51,7 +51,7 @@ export const RunCommand = cmd({
.option("model", {
type: "string",
alias: ["m"],
- describe: "Model to use in the format of provider/model",
+ describe: "model to use in the format of provider/model",
})
},
handler: async (args) => {
diff --git a/packages/opencode/src/cli/cmd/upgrade.ts b/packages/opencode/src/cli/cmd/upgrade.ts
index 083b99238..759ab5aeb 100644
--- a/packages/opencode/src/cli/cmd/upgrade.ts
+++ b/packages/opencode/src/cli/cmd/upgrade.ts
@@ -5,16 +5,16 @@ import { Installation } from "../../installation"
export const UpgradeCommand = {
command: "upgrade [target]",
- describe: "upgrade opencode to the latest version or a specific version",
+ describe: "upgrade opencode to the latest or a specific version",
builder: (yargs: Argv) => {
return yargs
.positional("target", {
- describe: "specific version to upgrade to (e.g., '0.1.48' or 'v0.1.48')",
+ describe: "version to upgrade to, for ex '0.1.48' or 'v0.1.48'",
type: "string",
})
.option("method", {
alias: "m",
- describe: "installation method to use (curl, npm, pnpm, bun, brew)",
+ describe: "installation method to use",
type: "string",
choices: ["curl", "npm", "pnpm", "bun", "brew"],
})
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()