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
Copy file name to clipboardExpand all lines: docs/agents/index.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,73 @@ agents:
130
130
131
131
The `init` commands run on every `vp run` for that agent and must be idempotent.
132
132
133
+
## Detached mode
134
+
135
+
Use `-d` / `--detach` to start an agent container in the background without attaching your terminal. This is useful when you want to customise the container environment before launching the agent interactively.
136
+
137
+
### Basic usage
138
+
139
+
```bash
140
+
vp run claude -d
141
+
# ✓ Started vibepod-claude-a1b2c3d4
142
+
```
143
+
144
+
The command prints the container name and returns immediately. You can also find it later with:
145
+
146
+
```bash
147
+
vp list --running
148
+
```
149
+
150
+
### Customising the container before starting the agent
151
+
152
+
A common workflow is to start detached, exec into the container to make adjustments, and then start the agent manually:
153
+
154
+
1. **Start the container in detached mode.**
155
+
156
+
```bash
157
+
vp run claude -d
158
+
# ✓ Started vibepod-claude-a1b2c3d4
159
+
```
160
+
161
+
2. **Exec into the running container.**
162
+
163
+
Use the container name printed above (or grab it from `vp list`):
164
+
165
+
```bash
166
+
docker exec -it vibepod-claude-a1b2c3d4 bash
167
+
```
168
+
169
+
3. **Apply your customisations** — install packages, edit config files, set environment variables, etc.
170
+
171
+
4. **Start the agent process** from inside the container when you are ready.
172
+
173
+
!!! tip
174
+
If you find yourself running the same setup steps every time, consider using [`agents.<agent>.init`](#init-scripts-before-startup) commands or [extending the base image](#image-customization-workflows) instead.
175
+
176
+
### Managing detached containers
177
+
178
+
Check running agents:
179
+
180
+
```bash
181
+
vp list # shows running + configured agents
182
+
vp list --running # shows only running agents
183
+
vp list --json # machine-readable output
184
+
```
185
+
186
+
Stop a specific agent or all agents:
187
+
188
+
```bash
189
+
vp stop claude # graceful stop (10 s timeout)
190
+
vp stop claude -f # force stop immediately
191
+
vp stop --all # stop every VibePod container
192
+
```
193
+
194
+
### Caveats
195
+
196
+
- **`auto_remove` (default: `true`)** — By default, containers are automatically removed when they stop. This means you cannot restart a stopped detached container; you need to `vp run` again. Set `auto_remove: false` in your [configuration](../configuration.md) if you want stopped containers to persist.
197
+
- **No built-in re-attach** — VibePod does not currently have a command to re-attach your terminal to a detached container. Use `docker attach <container>` or `docker exec -it <container> bash` directly.
198
+
- **Session logging** — Sessions started with `--detach` are not recorded in the VibePod session log since VibePod does not capture the interactive I/O. If you need session logging, run without `--detach`.
199
+
133
200
## Connecting to a Docker Compose network
134
201
135
202
When your workspace contains a `docker-compose.yml` or `compose.yml`, VibePod detects it and offers to connect the agent container to an existing network so it can reach your running services.
0 commit comments