Skip to main content

Module opencode

Module opencode 

Source
Expand description

opencode — lattice drives the opencode agent’s native TUI in a terminal buffer (the v1 opencode integration).

:opencode spawns the opencode TUI (via Effect::SpawnTerminal) and activates OpencodeMode — a minor mode over terminal-mode that is the seam for future lattice-native integration. The full opencode UX (readline, / commands, model switching, history, and its own diff review) comes from opencode’s real TUI running in the PTY, so lattice reimplements none of it.

This is the terminal topology (like the MCP / Claude Code peer): the agent runs in a terminal buffer and lattice layers integration via a minor mode. Contrast super::acp, which drives opencode acp headlessly and owns the conversation as a buffer — kept for the future IDE-native-review direction, reachable via :opencode-acp. See docs/dev/architecture/agent-integration.md.

Re-exports§

pub use modes::OpencodeMode;
pub use modes::register_opencode_modes;

Modules§

commands
The :opencode ex-command — launch the opencode agent’s native TUI in a terminal buffer with opencode-mode activated on it.
modes
opencode-mode — the minor mode layered on the opencode terminal buffer.

Functions§

install
Wire the opencode terminal integration into editor boot: the :opencode ex-command + the opencode-mode minor. One line in the crate-root install.