OpenCode is an open-source AI coding agent designed for terminal use, providing assistance in code generation, debugging, and project management through a native TUI. It supports automatic LSP loading for context-aware interactions with over 75 LLM providers via Models.dev, including local models and integrations like Claude Pro. Installation options include curl script, npm, Homebrew, or Paru, with Windows relying on binary downloads. Usage begins by running opencode in a project directory, followed by /init to analyze files and generate an AGENTS.md summary.
The tool features Plan and Build modes, switched via Tab key, where Plan outlines implementation steps and Build applies file edits with diffs. Multi-session capability allows parallel agents on the same project, and /share creates clipboard links for session export. Configuration via opencode auth login sets API keys, while opencode config handles themes, keybinds, and formatters. Image drag-and-drop supports visual prompts, and /undo or /redo manages revisions. Non-interactive mode runs via opencode -p for scripted prompts.
Competitors include Aider for git-centric edits and Cursor for IDE-based workflows. Aider emphasizes commit integration but lacks TUI depth, while Cursor offers visual multi-file handling in editors like VS Code. GitHub Copilot CLI provides snippet generation tied to OpenAI but without persistent sessions or broad model support. Pricing depends on LLM tokens, generally lower than subscription-based competitors due to provider choice.
Users report productivity gains from seamless model switching and LSP accuracy, with surprises like effective local model performance for offline work. Drawbacks include Windows install issues and occasional prompt misinterpretation requiring undos. The TUI uses Bubble Tea in Go for responsiveness, supporting themes and mouse-free navigation.
For best results, use detailed prompts in Plan mode for complex tasks, review all diffs, and configure preferred models via Zen for optimized setups.