summaryrefslogtreecommitdiffhomepage
path: root/packages/web/src/content/docs/cli.mdx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web/src/content/docs/cli.mdx')
-rw-r--r--packages/web/src/content/docs/cli.mdx29
1 files changed, 28 insertions, 1 deletions
diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdx
index 4a826e5b3..35ef993b8 100644
--- a/packages/web/src/content/docs/cli.mdx
+++ b/packages/web/src/content/docs/cli.mdx
@@ -57,6 +57,33 @@ opencode agent [command]
---
+### attach
+
+Attach a terminal to an already running OpenCode backend server started via `serve` or `web` commands.
+
+```bash
+opencode attach [url]
+```
+
+This allows using the TUI with a remote OpenCode backend. For example:
+
+```bash
+# Start the backend server for web/mobile access
+opencode web --port 4096 --hostname 0.0.0.0
+
+# In another terminal, attach the TUI to the running backend
+opencode attach http://10.20.30.40:4096
+```
+
+#### Flags
+
+| Flag | Short | Description |
+| ------------ | ----- | --------------------------------- |
+| `--dir` | | Working directory to start TUI in |
+| `--session` | `-s` | Session ID to continue |
+
+---
+
#### create
Create a new agent with custom configuration.
@@ -325,7 +352,7 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
### serve
-Start a headless opencode server for API access. Check out the [server docs](/docs/server) for the full HTTP interface.
+Start a headless OpenCode server for API access. Check out the [server docs](/docs/server) for the full HTTP interface.
```bash
opencode serve