Back to services

opencode

The open source coding agent.

View alternatives to opencode
Suggest edit
Open source
Self-hostable
MIT
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Note: We were unable to retrieve content from the official website this time. This entry was compiled from publicly available information. For the latest details on features and installation, please refer to opencode.ai.

Introduction

opencode is an open-source AI coding agent built primarily for the terminal. It provides a terminal user interface (TUI) where developers can work directly in their project directory and use natural language to have the AI read code, answer questions, edit files, and run commands, covering everyday development tasks. It is positioned similarly to terminal-based AI coding tools such as Claude Code, but it is fully open source and not tied to any particular model provider.

Key Features

  • Native terminal interface: A full interactive interface inside the terminal, well suited to developers who are comfortable with the command line and editors like Vim/Neovim.
  • Support for multiple model providers: Connects to cloud model services from Anthropic, OpenAI, Google, and others, and can also use local models. Users can switch models as needed without being locked in to a single vendor.
  • LSP integration: Automatically loads language servers for your project, giving the AI more accurate code context and diagnostics.
  • Multiple sessions: Run several agent sessions in the same project at once to work on different tasks in parallel.
  • Session sharing: Generate a share link for a session to make collaboration or troubleshooting easier.
  • Configurable agents and modes: Includes built-in agent modes for different purposes (for example, a mode geared toward planning and analysis and one geared toward making changes directly), and also supports custom configuration.

Target Users and Use Cases

  • Software developers who prefer working in the terminal and on the command line
  • Individuals and teams who want the freedom to choose or switch between large language models and keep costs under control
  • Users who value open source and auditability and don't want to depend on closed-source AI coding tools

Core Strengths

  • Open source: The code is public (MIT license), the community is active, and you can review and build on it.
  • No vendor lock-in: The same workflow works with different model services.
  • Terminal first: Starts quickly and fits into existing command-line and editor workflows.

Installation

Common ways to install:

# 官方安装脚本
curl -fsSL https://opencode.ai/install | bash

# 通过 npm 安装
npm i -g opencode-ai

After installation, run opencode in your project directory to start it. On first use, you will need to configure authentication for your model provider (for example, an API key). On macOS and other platforms it can also be installed through a package manager; see the official documentation for the specific commands.

Technical Requirements

  • A terminal environment on a mainstream system such as macOS or Linux
  • At least one usable account or API key from a large language model provider, or a working local model
  • A terminal emulator that supports modern features is recommended for better display of the interface

Notable Points

  • The tool itself is free and open source, but calls to cloud models are billed at each provider's standard rates.
  • It works well as a replacement for, or complement to, terminal AI coding tools such as Claude Code, Aider, and Gemini CLI.