diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/auth.ts | 8 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/run.ts | 8 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/upgrade.ts | 6 | ||||
| -rw-r--r-- | packages/opencode/src/index.ts | 39 |
4 files changed, 32 insertions, 29 deletions
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() |
