#oh-my-opencode

coterm omo launches OpenCode with the oh-my-openagent plugin in a coterm-aware environment. oh-my-openagent orchestrates multiple AI models (Claude, GPT, Gemini, Grok) as specialized agents working in parallel. When it spawns agent panes, they become native coterm splits.

#Usage

coterm omo
coterm omo --continue
coterm omo --model claude-sonnet-4-6

All arguments after omo are forwarded to OpenCode.

#What you get

oh-my-openagent's TmuxSessionManager spawns each background agent in its own pane. With coterm omo, those panes become native coterm splits instead of tmux panes:

  • Each subagent (Hephaestus, Atlas, Oracle, etc.) gets its own coterm split, visible in the workspace
  • Auto-layout management: agents are arranged in a grid (main-vertical by default) and resized as agents come and go
  • Idle agents are automatically cleaned up after 3 consecutive idle polls with no new messages
  • If the window is too small for a new agent pane, it queues and retries every 2 seconds until space is available
  • Your main session stays in the primary pane while agents work beside it

#First run

On first run, coterm omo automatically sets up everything:

  1. Creates a shadow config at ~/.coterm/omo-config/ with oh-my-opencode registered in the plugin array
  2. Installs the oh-my-opencode npm package using bun or npm if not already present
  3. Symlinks node_modules, package.json, and plugin config from your original ~/.config/opencode/ directory
  4. Enables tmux mode in the oh-my-opencode config (tmux.enabled defaults to false, coterm omo turns it on)

Your original ~/.config/opencode/ config is never modified. Running plain opencode works the same as before.

#How it works

Same pattern as coterm claude-teams. A tmux shim intercepts tmux commands from oh-my-openagent's TmuxSessionManager and translates them into coterm API calls.

  • Creates a tmux shim at ~/.coterm/omo-bin/tmux that redirects to coterm __tmux-compat
  • Sets TMUX and TMUX_PANE to simulate a tmux session
  • Enables tmux.enabled in the oh-my-opencode config (required for visual pane spawning)
  • Points OPENCODE_CONFIG_DIR at the shadow config
  • Prepends the shim directory to PATH and execs into opencode

#Directories

PathPurpose
~/.coterm/omo-bin/Contains the tmux shim script
~/.coterm/omo-config/Shadow OpenCode config with oh-my-opencode plugin registered and tmux enabled (symlinks to your original config)
~/.coterm/tmux-compat-store.jsonPersistent storage for tmux-compat buffers and hooks

#Shadow config

coterm omo uses a shadow config directory so your original OpenCode setup is unaffected:

  • Copies your ~/.config/opencode/opencode.json with oh-my-opencode added to the plugin array
  • Symlinks node_modules, package.json, and bun.lock from the original directory
  • Writes oh-my-opencode.json with tmux.enabled set to true
  • Sets OPENCODE_CONFIG_DIR to the shadow directory before launching opencode

#Environment variables

VariablePurpose
TMUXFake tmux socket path encoding the current coterm workspace and pane
TMUX_PANEFake tmux pane identifier mapped to the current coterm pane
OPENCODE_CONFIG_DIRPoints to the shadow config directory with oh-my-opencode enabled
COTERM_SOCKET_PATHPath to the coterm control socket for the shim to connect to