The open source coding agent.
TypeScript
Revert "fix: ensure flags & docs match (#3638)"
Aiden Cline019054dd1e90
diff --git a/packages/opencode/src/cli/cmd/serve.ts b/packages/opencode/src/cli/cmd/serve.tsindex 3af3316a9d3..100b6a01963 100644--- a/packages/opencode/src/cli/cmd/serve.ts+++ b/packages/opencode/src/cli/cmd/serve.ts@@ -12,6 +12,7 @@ export const ServeCommand = cmd({default: 0,}).option("hostname", {+ alias: ["h"],type: "string",describe: "hostname to listen on",default: "127.0.0.1",diff --git a/packages/opencode/src/cli/cmd/tui.ts b/packages/opencode/src/cli/cmd/tui.tsindex 82792b249ee..b936f54e4ef 100644--- a/packages/opencode/src/cli/cmd/tui.ts+++ b/packages/opencode/src/cli/cmd/tui.ts@@ -65,6 +65,7 @@ export const TuiCommand = cmd({default: 0,}).option("hostname", {+ alias: ["h"],type: "string",describe: "hostname to listen on",default: "127.0.0.1",diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.tsindex bfdadff2a74..26c9f543d5e 100644--- a/packages/opencode/src/index.ts+++ b/packages/opencode/src/index.ts@@ -38,7 +38,6 @@ process.on("uncaughtException", (e) => {const cli = yargs(hideBin(process.argv)).scriptName("opencode").help("help", "show help")- .alias("help", "h").version("version", "show version number", Installation.VERSION).alias("version", "v").option("print-logs", {@@ -141,5 +140,5 @@ try {// Most notably, some docker-container-based MCP servers don't handle such signals unless// run using `docker run --init`.// Explicitly exit to avoid any hanging subprocesses.- process.exit()+ process.exit();}diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdxindex 1312442d630..2fd3a0f5c0b 100644--- a/packages/web/src/content/docs/cli.mdx+++ b/packages/web/src/content/docs/cli.mdx@@ -19,28 +19,6 @@ opencode run "Explain how closures work in JavaScript"----### tui--Start the OpenCode terminal user interface.--```bash-opencode [project]-```--#### Flags--| Flag | Short | Description |-| ------------ | ----- | ------------------------------------------ |-| `--continue` | `-c` | Continue the last session |-| `--session` | `-s` | Session ID to continue |-| `--prompt` | `-p` | Prompt to use |-| `--model` | `-m` | Model to use in the form of provider/model |-| `--agent` | | Agent to use |-| `--port` | | Port to listen on |-| `--hostname` | | Hostname to listen on |------## CommandsThe OpenCode CLI also has the following commands.@@ -186,17 +164,13 @@ opencode run Explain the use of context in Go#### Flags-| Flag | Short | Description |-| ------------ | ----- | ------------------------------------------------------------------ |-| `--command` | | The command to run, use message for args |-| `--continue` | `-c` | Continue the last session |-| `--session` | `-s` | Session ID to continue |-| `--share` | | Share the session |-| `--model` | `-m` | Model to use in the form of provider/model |-| `--agent` | | Agent to use |-| `--file` | `-f` | File(s) to attach to message |-| `--format` | | Format: default (formatted) or json (raw JSON events) |-| `--title` | | Title for the session (uses truncated prompt if no value provided) |+| Flag | Short | Description |+| ------------ | ----- | ------------------------------------------ |+| `--continue` | `-c` | Continue the last session |+| `--session` | `-s` | Session ID to continue |+| `--share` | | Share the session |+| `--model` | `-m` | Model to use in the form of provider/model |+| `--agent` | | Agent to use |---@@ -215,7 +189,7 @@ This starts an HTTP server that provides API access to opencode functionality wi| Flag | Short | Description || ------------ | ----- | --------------------- || `--port` | `-p` | Port to listen on |-| `--hostname` | | Hostname to listen on |+| `--hostname` | `-h` | Hostname to listen on |---@@ -247,13 +221,18 @@ opencode upgrade v0.1.48----## Global Flags+## FlagsThe opencode CLI takes the following global flags.-| Flag | Short | Description |-| -------------- | ----- | ------------------------------------ |-| `--help` | `-h` | Display help |-| `--version` | `-v` | Print version number |-| `--print-logs` | | Print logs to stderr |-| `--log-level` | | Log level (DEBUG, INFO, WARN, ERROR) |+| Flag | Short | Description |+| -------------- | ----- | ------------------------------------------ |+| `--help` | `-h` | Display help |+| `--version` | | Print version number |+| `--print-logs` | | Print logs to stderr |+| `--log-level` | | Log level (DEBUG, INFO, WARN, ERROR) |+| `--prompt` | `-p` | Prompt to use |+| `--model` | `-m` | Model to use in the form of provider/model |+| `--agent` | | Agent to use |+| `--port` | | Port to listen on |+| `--hostname` | | Hostname to listen on |