Skip to content

Commit c235ba1

Browse files
authored
docs: fix CLI attach section order (#25749)
1 parent 754a1fb commit c235ba1

1 file changed

Lines changed: 31 additions & 31 deletions

File tree

  • packages/web/src/content/docs

packages/web/src/content/docs/cli.mdx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,37 +61,6 @@ opencode agent [command]
6161

6262
---
6363

64-
### attach
65-
66-
Attach a terminal to an already running OpenCode backend server started via `serve` or `web` commands.
67-
68-
```bash
69-
opencode attach [url]
70-
```
71-
72-
This allows using the TUI with a remote OpenCode backend. For example:
73-
74-
```bash
75-
# Start the backend server for web/mobile access
76-
opencode web --port 4096 --hostname 0.0.0.0
77-
78-
# In another terminal, attach the TUI to the running backend
79-
opencode attach http://10.20.30.40:4096
80-
```
81-
82-
#### Flags
83-
84-
| Flag | Short | Description |
85-
| ---------------------------------------- | ----- | -------------------------------------------------------------------------- |
86-
| <nobr><code>{"--dir"}</code></nobr> | | Working directory to start TUI in |
87-
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
88-
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
89-
| <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
90-
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic auth password (defaults to `OPENCODE_SERVER_PASSWORD`) |
91-
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic auth username (defaults to `OPENCODE_SERVER_USERNAME` or `opencode`) |
92-
93-
---
94-
9564
#### create
9665

9766
Create a new agent with custom configuration.
@@ -126,6 +95,37 @@ opencode agent list
12695

12796
---
12897

98+
### attach
99+
100+
Attach a terminal to an already running OpenCode backend server started via `serve` or `web` commands.
101+
102+
```bash
103+
opencode attach [url]
104+
```
105+
106+
This allows using the TUI with a remote OpenCode backend. For example:
107+
108+
```bash
109+
# Start the backend server for web/mobile access
110+
opencode web --port 4096 --hostname 0.0.0.0
111+
112+
# In another terminal, attach the TUI to the running backend
113+
opencode attach http://10.20.30.40:4096
114+
```
115+
116+
#### Flags
117+
118+
| Flag | Short | Description |
119+
| ---------------------------------------- | ----- | -------------------------------------------------------------------------- |
120+
| <nobr><code>{"--dir"}</code></nobr> | | Working directory to start TUI in |
121+
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
122+
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
123+
| <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
124+
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic auth password (defaults to `OPENCODE_SERVER_PASSWORD`) |
125+
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic auth username (defaults to `OPENCODE_SERVER_USERNAME` or `opencode`) |
126+
127+
---
128+
129129
### auth
130130

131131
Command to manage credentials and login for providers.

0 commit comments

Comments
 (0)