You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 37e1ef7
Browse filesBrowse the repository at this point in the historyBrowse files
describe: "title for the session (uses truncated prompt if no value provided)",
86
87
})
88
+
.option("attach",{
89
+
type: "string",
90
+
describe: "attach to a running opencode server (e.g., http://localhost:4096)",
Copy file name to clipboardExpand all lines: packages/web/src/content/docs/cli.mdx
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,6 +184,16 @@ This is useful for scripting, automation, or when you want a quick answer withou
184
184
opencode run Explain the use of context in Go
185
185
```
186
186
187
+
You can also attach to a running `opencode serve` instance to avoid MCP server cold boot times on every run:
188
+
189
+
```bash
190
+
# Start a headless server in one terminal
191
+
opencode serve
192
+
193
+
# In another terminal, run commands that attach to it
194
+
opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
195
+
```
196
+
187
197
#### Flags
188
198
189
199
| Flag | Short | Description |
@@ -197,6 +207,7 @@ opencode run Explain the use of context in Go
197
207
|`--file`|`-f`| File(s) to attach to message |
198
208
|`--format`|| Format: default (formatted) or json (raw JSON events) |
199
209
|`--title`|| Title for the session (uses truncated prompt if no value provided) |
210
+
|`--attach`|| Attach to a running opencode server (e.g., http://localhost:4096)|
0 commit comments