Aider: AI Pair Programming in Your Terminal
A comprehensive guide to Aider, the open-source AI coding assistant that brings pair programming to your command line with support for multiple LLMs and seamless git integration
In a landscape increasingly dominated by proprietary AI coding tools, OpenCode stands out as a fully open-source alternative. Created by the team behind SST (Serverless Stack), OpenCode brings AI-assisted coding to your terminal, IDE, or desktop with the transparency and flexibility that open-source developers demand.
OpenCode is an open-source AI agent designed to help you write code across different environments. Whether you prefer working in the terminal, your favorite IDE, or a desktop application, OpenCode adapts to your workflow while providing powerful AI assistance.
The project is built with a focus on developer experience—making AI assistance feel natural and unobtrusive while maintaining the openness that allows customization and self-hosting.
OpenCode works wherever you do:
Everything is open:
Built with current best practices:
Choose your AI provider:
Install via your package manager:
# npm
npm install -g opencode
# Homebrew (macOS)
brew install sst/tap/opencode
# Direct download
curl -fsSL https://opencode.ai/install.sh | bash
Set up your preferred model:
# Using OpenAI
export OPENAI_API_KEY=your-key
opencode config set model gpt-4
# Using Anthropic
export ANTHROPIC_API_KEY=your-key
opencode config set model claude-3-opus
Start coding:
cd your-project
opencode
Describe what you need:
opencode "Create a TypeScript function that validates credit card
numbers using the Luhn algorithm. Include comprehensive tests."
Edit existing code:
opencode "Refactor the database module to use connection pooling.
Update the configuration to support pool size settings."
Identify and fix issues:
opencode "The search function isn't returning results for partial
matches. Fix it to support substring matching."
Understand complex code:
opencode explain --file src/algorithms/compression.ts
The CLI is designed for productivity:
Continuous conversation:
opencode
> Add user authentication
> Use JWT tokens
> Add refresh token support
> Write tests for the auth flow
Quick operations:
opencode "Fix the TypeScript errors in src/api/"
Work with specific files:
opencode --file api.ts "Add error handling"
opencode --dir src/services "Review for security issues"
Manage what OpenCode sees:
opencode --include "src/**/*.ts" --exclude "**/*.test.ts" "Add logging"
Seamless integration:
Full-featured plugin:
Terminal-native integration:
" In your config
Plug 'opencode/opencode.nvim'
For focused development:
Works on:
OpenCode is built in layers:
┌─────────────────────────────────────┐
│ User Interfaces │
│ (CLI, IDE Extensions, Desktop) │
├─────────────────────────────────────┤
│ Core Engine │
│ (Conversation, Context, Actions) │
├─────────────────────────────────────┤
│ Model Providers │
│ (OpenAI, Anthropic, Local) │
├─────────────────────────────────────┤
│ Tool Integrations │
│ (File System, Git, Shell) │
└─────────────────────────────────────┘
Extend functionality:
// Custom plugin example
export const myPlugin: OpenCodePlugin = {
name: 'custom-linter',
hooks: {
beforeEdit: async (context) => {
// Run custom checks
},
afterEdit: async (result) => {
// Post-processing
}
}
};
Run your own instance:
docker run -d \
-e OPENAI_API_KEY=your-key \
-v $(pwd):/workspace \
ghcr.io/sst/opencode:latest
git clone https://github.com/sst/opencode
cd opencode
go build -o opencode
./opencode serve
| Feature | OpenCode | Aider | Claude Code | Copilot |
|---|---|---|---|---|
| Open Source | Yes | Yes | No | No |
| Terminal | Yes | Yes | Yes | No |
| IDE | Yes | Limited | No | Yes |
| Desktop App | Yes | No | No | No |
| Self-Host | Yes | Yes | No | No |
| Git Native | Yes | Yes | Yes | No |
Give OpenCode the right context:
# Good: Specific files and clear intent
opencode --file auth.ts --file user.ts "Add password reset flow"
# Less effective: Vague request
opencode "Fix auth"
Build up complex features:
opencode interactive
> First, add the database migration for password reset tokens
> Now add the email sending service
> Create the reset request endpoint
> Add the reset confirmation endpoint
> Write integration tests
AI code needs human review:
# Preview changes
opencode --preview "Make changes"
# Review diff
git diff
# Run tests
npm test
Work safely with git:
# Create a branch
git checkout -b feature/ai-assisted
# Make changes with OpenCode
opencode "Implement feature"
# Review and commit
git diff
git add -p
git commit -m "Add feature (AI-assisted)"
Manage credentials safely:
# Use environment variables
export OPENAI_API_KEY=$(cat ~/.secrets/openai)
# Or secure config
opencode config set-secret api-key
Understand data flow:
For complete control:
OpenCode is built in the open:
Ways to participate:
# Fork and clone
git clone https://github.com/yourusername/opencode
# Set up development
npm install
npm run dev
# Submit PRs
git checkout -b feature/your-feature
OpenCode is actively developing:
As with all AI tools:
The team is working on:
OpenCode represents a thoughtful approach to open-source AI coding assistance. By providing multiple interfaces—terminal, IDE, and desktop—it meets developers where they work rather than forcing new workflows.
The commitment to open source means you can inspect the code, self-host for privacy, and contribute improvements. For developers who value transparency and flexibility in their tools, OpenCode offers a compelling option.
Whether you’re looking for a Copilot alternative, want to self-host your AI coding tool, or simply appreciate open-source projects, OpenCode deserves consideration. The combination of accessibility, openness, and active development makes it a promising tool in the AI coding agent landscape.
Explore more AI coding tools and agents in our Coding Agents Directory.
A comprehensive guide to Aider, the open-source AI coding assistant that brings pair programming to your command line with support for multiple LLMs and seamless git integration
Explore Qwen Code, Alibaba's command-line AI workflow tool optimized for the Qwen3-Coder models, bringing advanced code understanding and intelligent assistance to your terminal
An in-depth look at OpenAI's Codex CLI, the open-source local coding agent that brings GPT-powered code assistance directly to your command line