Configuration
Everything is optional. Settings are merged from three places, later winning key by key:
~/.config/opencode-cockpit/config.json → <project>/.cockpit.json → plugin-entry optionsA project can override one setting without restating the rest, and an unreadable or invalid file is
ignored rather than fatal — a typo should never stop your shells from working. XDG_CONFIG_HOME
is honoured for the global path.
{ "kinds": { "e2e": "playwright|cypress", "infra": "^(terraform|pulumi)\\b" }, "watch": { "auto": false, "presets": { "e2e": { "done": "\\d+ passed", "fail": "\\d+ failed" } } }, "defaults": { "logFile": true, "timeoutSeconds": 900 }, "notify": { "exit": true, "watch": true, "tailLines": 15 }, "guidance": true, "listRunningShells": 15, "ui": { "dockHeight": 16, "dockOpen": true, "defaultView": "screen" }}Extra shell categories, or overrides, as name → regular expression matched against the command.
They drive the badge in the panel and sidebar and the kind filter in shell_list, so you can
group your own stack instead of the built-ins (server, tests, build, watcher, task).
presets are your own rules, keyed by name, and they reach the daemon as explicit rules — so a
preset you invent works immediately. auto attaches a matching preset to every new shell; off by
default.
lifecycle
Section titled “lifecycle”When shells end without being asked to.
{ "lifecycle": { "onExit": "stopMine", "orphanAfterMinutes": 60 } }onExit decides what happens to the shells an OpenCode window started when that window closes:
stopMine (the default) stops them, keep leaves them running for the next window — which is how
a shell survives an OpenCode restart.
orphanAfterMinutes stops a shell that no window of its own has been connected to for that long,
so nothing can quietly run for a week. 0 turns it off.
defaults
Section titled “defaults”Applied to every shell the agent starts unless the call says otherwise: watch, logFile,
idleTimeoutSeconds, timeoutSeconds, notifyOnExit.
notify
Section titled “notify”What may interrupt the agent: exit, watch, and tailLines — how much output rides along with an
exit message.
guidance and listRunningShells
Section titled “guidance and listRunningShells”The context budget. guidance is the paragraph that teaches the model when to reach for a shell
(~120 tokens per request); listRunningShells is how many running shells are named in the system
prompt each turn (~20 tokens each, 0 disables). Turning both off saves tokens at the cost of a
model that uses shells less well.
Interface only: dockHeight, dockOpen, sidebarRows, historyMinutes, colors, defaultView
(screen or log), keybinds, updateCheck.
Environment variables
Section titled “Environment variables”| Variable | Default | Purpose |
|---|---|---|
COCKPIT_HOME | ~/.cache/opencode-cockpit | Socket, logs, process registry |
COCKPIT_IDLE_TIMEOUT_MS | 600000 | Daemon exits after this long unused |
COCKPIT_LOG_LEVEL | info | debug for verbose daemon logs |