Skip to content

Commit eeedc0a

Browse files
committed
Extend documentation for using detach option with agent containers
1 parent 944b5dd commit eeedc0a

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

docs/agents/index.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,73 @@ agents:
130130

131131
The `init` commands run on every `vp run` for that agent and must be idempotent.
132132

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+
133200
## Connecting to a Docker Compose network
134201

135202
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.

docs/quickstart.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,20 @@ Use `-d` / `--detach` to start the container without attaching your terminal:
8383
vp run claude -d
8484
```
8585

86+
Check which agents are running:
87+
88+
```bash
89+
vp list --running
90+
```
91+
8692
Stop it later with:
8793

8894
```bash
8995
vp stop claude
9096
```
9197

98+
For more details on detached mode workflows, see [Agents > Detached mode](agents/index.md#detached-mode).
99+
92100
## View the session log UI
93101

94102
VibePod records every session and proxied HTTP request. Open the Datasette UI with:

0 commit comments

Comments
 (0)