Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
OpenCode is an open-source, terminal-native AI coding agent that provides intelligent code generation, refactoring, debugging, and documentation assistance. With over 129,000 GitHub stars and 800+ contributors, it has become one of the most popular open-source alternatives to proprietary coding assistants.
| Repository | github.com/anomalyco/opencode |
| License | MIT |
| Language | Go, TypeScript |
| Stars | 129K+ |
| Category | AI Coding Agent |
OpenCode operates as a modular, provider-agnostic system with several key components:
OpenCode is model-agnostic, connecting to providers via Models.dev:
Performance scales with model quality: GPT-4/Claude achieves 80-90% quality vs commercial tools; open models reach 60-70%.
# AGENTS.md configuration example for OpenCode # Place in your project root to provide context to the agent # # Project: MyApp # Tech Stack: Python 3.12, FastAPI, PostgreSQL # Testing: pytest with coverage # Conventions: type hints, PEP 8, docstrings required # # Usage: # pip install opencode # opencode # launches TUI # opencode "refactor to async/await" # direct command import subprocess import json def run_opencode_headless(prompt, model="claude-sonnet"): result = subprocess.run( ["opencode", "--headless", "--model", model, prompt], capture_output=True, text=True ) return json.loads(result.stdout) output = run_opencode_headless("Add error handling to api/routes.py") print(output["changes"])