opencode  by opencode-ai

CLI tool for terminal-based AI coding assistance

Created 6 months ago
9,364 stars

Top 5.5% on SourcePulse

GitHubView on GitHub
Project Summary

OpenCode is a Go-based terminal AI assistant designed to enhance developer productivity by integrating AI-powered coding assistance directly into the command line. It offers a rich TUI experience for interacting with various LLM providers, managing conversations, and executing code-related tasks.

How It Works

OpenCode leverages a modular architecture with a TUI built using Bubble Tea. It supports multiple AI providers (OpenAI, Anthropic, Gemini, etc.) and features session management, tool integration (command execution, file manipulation), a Vim-like editor, LSP integration for code intelligence, and file change tracking. Its Model Context Protocol (MCP) allows for external tool integration via stdio or SSE.

Quick Start & Requirements

  • Install: curl -fsSL https://opencode.ai/install | bash or brew install opencode-ai/tap/opencode
  • Prerequisites: Go 1.24.0+ for building from source. API keys for desired AI providers are required.
  • Setup: Installation via script or Homebrew is quick. Configuration involves setting API keys via environment variables or a JSON file.
  • Docs: https://opencode.ai/

Highlighted Details

  • Supports a wide array of AI models from OpenAI, Anthropic, Google Gemini, AWS Bedrock, Groq, and Azure OpenAI.
  • Integrates Language Server Protocol (LSP) for code intelligence, currently exposing diagnostics to the AI.
  • Features a robust set of built-in tools for file operations, shell commands, and code searching (e.g., glob, grep, write, bash, sourcegraph).
  • Implements the Model Context Protocol (MCP) for extensible tool integration.

Maintenance & Community

  • Key contributors include @isaacphi and @adamdottv.
  • Contributions are welcome via pull requests.

Licensing & Compatibility

  • Licensed under the MIT License, permitting commercial use and closed-source linking.

Limitations & Caveats

This project is in early development and not production-ready. Features may change or be incomplete. While LSP integration supports the full protocol, only diagnostics are currently exposed to the AI assistant.

Health Check
Last Commit

19 hours ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
197 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.