2026-01-06 14:25:19 -08:00
# Devcontainer / Docker Setup
Plannotator works in devcontainers and Docker environments with minimal configuration.
## Required Environment Variables
Add these to your `devcontainer.json` :
``` json
{
"containerEnv" : {
"PLANNOTATOR_REMOTE" : "1" ,
"PLANNOTATOR_PORT" : "9999"
} ,
"forwardPorts" : [ 9999 ]
}
```
| Variable | Purpose |
|----------|---------|
2026-04-05 05:17:16 +09:00
| `PLANNOTATOR_REMOTE=1` | Forces remote mode for container-friendly port/browser handling (required in containers) |
2026-01-06 14:25:19 -08:00
| `PLANNOTATOR_PORT=9999` | Fixed port for the UI (required for port forwarding) |
Both are required. Just setting the port isn't enough.
## Port Forwarding
Ensure port 9999 (or your chosen port) is forwarded to your host. In VS Code devcontainers, add it to `forwardPorts` as shown above.
## Usage
1. Run OpenCode in your container (`opencode` or `opencode web` )
2. Ask the agent to create a plan
3. When `submit_plan` is called, Plannotator starts on port 9999
4. Open `http://localhost:9999` in your host browser
5. Approve or deny the plan
2026-04-05 05:17:16 +09:00
**Note: ** Browser opening depends on your container/browser setup. If nothing opens automatically, navigate to the forwarded URL manually when you see the agent call `submit_plan` .
2026-01-06 14:25:19 -08:00
## OpenCode Web
`opencode web` works in devcontainers. Forward port 4096 (default) for the OpenCode UI, and port 9999 for Plannotator:
``` json
{
"forwardPorts" : [ 4096 , 9999 ]
}
```
## Legacy Support
2026-04-05 05:17:16 +09:00
If your environment already has `SSH_TTY` or `SSH_CONNECTION` set (common in SSH sessions), Plannotator will detect remote mode automatically when `PLANNOTATOR_REMOTE` is unset. You can also force local mode with `PLANNOTATOR_REMOTE=false` or `0` .
2026-01-06 14:25:19 -08:00
## Troubleshooting
**Plugin not updating? **
``` bash
2026-01-15 10:04:26 -08:00
rm -rf ~/.bun/install/cache/@plannotator
2026-01-06 14:25:19 -08:00
```
**OpenCode crashes on startup? **
``` bash
2026-01-15 10:04:26 -08:00
rm -rf ~/.cache/opencode ~/.bun/install/cache/@opencode-ai
2026-01-06 14:25:19 -08:00
```
**Port not accessible? **
Check your devcontainer's port forwarding. In VS Code, check the "Ports" tab.