diff options
| author | monke-yo <[email protected]> | 2025-11-05 23:01:01 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-05 11:31:01 -0600 |
| commit | ee8b81269bdd40dde0987e7796ae0ebcd8ebc3ab (patch) | |
| tree | 7f2adf35e31025ce5ace7626cad8a3d3e1d4a2ae /packages/web/src | |
| parent | 53998a2fedc55262aca8b049eacbed3d710a46e5 (diff) | |
| download | opencode-ee8b81269bdd40dde0987e7796ae0ebcd8ebc3ab.tar.gz opencode-ee8b81269bdd40dde0987e7796ae0ebcd8ebc3ab.zip | |
feat: add --attach flag to opencode run (#3889)
Diffstat (limited to 'packages/web/src')
| -rw-r--r-- | packages/web/src/content/docs/cli.mdx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdx index 1312442d6..083db369b 100644 --- a/packages/web/src/content/docs/cli.mdx +++ b/packages/web/src/content/docs/cli.mdx @@ -184,6 +184,16 @@ This is useful for scripting, automation, or when you want a quick answer withou opencode run Explain the use of context in Go ``` +You can also attach to a running `opencode serve` instance to avoid MCP server cold boot times on every run: + +```bash +# Start a headless server in one terminal +opencode serve + +# In another terminal, run commands that attach to it +opencode run --attach http://localhost:4096 "Explain async/await in JavaScript" +``` + #### Flags | Flag | Short | Description | @@ -197,6 +207,8 @@ opencode run Explain the use of context in Go | `--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) | +| `--attach` | | Attach to a running opencode server (e.g., http://localhost:4096) | +| `--port` | | Port for the local server (defaults to random port) | --- |
