Opencode

2 min read

OpenCode

OpenCode is an open-source AI coding agent available as a terminal interface (TUI), desktop app, or IDE extension. It is designed to act as a senior developer pair programmer, capable of planning, coding, and fixing issues directly in your codebase.

Key Features

  • Interface: Runs primarily in the terminal with a rich TUI, but also supports IDEs and a "Zen" mode.
  • Modes:
    • Plan Mode: The agent analyzes your request and proposes a detailed plan without modifying code. You can iterate on this plan before approval.
    • Build Mode: The agent executes the plan, writing code, running commands, and fixing errors.
  • Configuration: Highly customizable via opencode.json or the /config command. You can configure:
    • Providers: Connect to any LLM provider (Anthropic, OpenAI, etc.).
    • Tools: Enable or disable specific capabilities.
    • Themes: Customize the look and feel.
  • Commands:
    • /init: Initialize a project and create an AGENTS.md file to help the agent understand your codebase.
    • /connect: secure authentication with providers.
    • /undo / /redo: Revert or re-apply agent changes.

Usage

  1. Install: npm install -g opencode-ai or via curl.
  2. Run: Navigate to your project and type opencode.
  3. Interact:
    • Ask questions about your codebase (@ to mention files).
    • Request features or refactors.
    • Use Plan Mode (Tab key) for complex tasks to agree on a strategy first.