# OpenCode -- Open Source AI Coding Agent

## META
- url: https://opencode.ai
- repo: https://github.com/anomalyco/opencode
- stars: 100,000+ (as of Feb 2026)
- users: 2.5M monthly developers
- license: Open source
- relevance: CANDIDATE -- potential runtime/architecture for Self-Evolution Engine agent core
- last_verified: 2026-02-13

## SUMMARY

OpenCode is the leading open-source AI coding agent, available as terminal UI, desktop app, and IDE extension. Supports 75+ LLM providers. Its multi-provider orchestration, multi-session capabilities, and extensible agent architecture make it a candidate for LLMHosts's autonomous evolution runtime.

## CORE ARCHITECTURE

### Components
- **CLI / TUI**: Terminal-based interface with rich UI (themes, keybinds, commands)
- **Desktop App**: Beta on macOS, Windows, Linux
- **IDE Extensions**: VSCode, etc.
- **Core Runtime**: Agent orchestration, context management, agentic execution loops
- **Event System**: Session management, state tracking
- **LSP Integration**: Language Server Protocol for code intelligence

### Multi-Provider Support
- 75+ LLM providers via AI SDK and Models.dev
- Claude, GPT, Gemini, local models
- Provider and model management system
- Global and agent-specific model options
- Custom variants and reasoning configurations

### Key Features
- **Plan Mode**: Read-only mode for designing approaches before coding
- **Build Mode**: Full edit capabilities for implementing changes
- **Multi-Session**: Parallel agents on same project
- **Undo/Redo**: Revert agent changes with /undo, /redo commands
- **Share**: Share conversations via links
- **Custom Commands**: User-defined commands
- **AGENTS.md**: Project-level agent configuration (committed to git)
- **File References**: @-mentions for file context
- **Image Support**: Drag-drop images for visual context

### Privacy
- No code or context storage
- Privacy-first design
- Local execution

## OPENCODE ZEN

- Curated set of AI models tested and benchmarked for coding agents
- Ensures consistent performance across providers
- Managed API key service (/connect command)
- Simplified onboarding for new users

## RELEVANCE TO LLMHOST

### Potential as Self-Evolution Engine Runtime
OpenCode's architecture provides several features useful for LLMHosts's autonomous evolution:

1. **Multi-Provider Orchestration**: Can use different models for different tasks
2. **Plan/Build Mode**: Natural fit for "analyze → propose → implement → test" evolution loop
3. **Multi-Session**: Run parallel evolution agents (one for monitoring, one for implementing)
4. **AGENTS.md Pattern**: Project-level configuration for directing agent behavior
5. **Undo/Redo**: Safe rollback mechanism for failed evolution attempts

### Integration Concept
```
Self-Evolution Engine (OpenCode-based agent)
├── Monitor Agent (Plan Mode)
│   ├── Watch for new model releases
│   ├── Monitor benchmark results
│   ├── Track framework updates
│   └── Analyze user feedback patterns
├── Proposal Agent (Plan Mode)
│   ├── Generate upgrade proposals
│   ├── Compare alternatives
│   └── Risk assessment
├── Implementation Agent (Build Mode)
│   ├── Apply code changes
│   ├── Update configurations
│   └── Run test suites
└── Deployment Agent
    ├── Stage changes
    ├── Run integration tests
    ├── Queue for admin approval
    └── Execute rollout/rollback
```

### Limitations
- Designed for interactive coding, not autonomous background operation
- Would need significant adaptation for headless/daemon operation
- No built-in scheduling or cron-like capabilities
- Focus on single-project scope (LLMHosts needs platform-wide evolution)

### Alternative: Custom Agent Framework
Given the limitations, a custom agent framework using OpenCode's patterns but purpose-built for LLMHosts may be more practical:
- Use OpenCode's multi-provider model management
- Implement custom plan/build/test/deploy pipeline
- Add scheduling, monitoring, and autonomous decision-making
- Integrate directly with LLMHosts's Conductor and admin panel

## INSTALLATION

### Via curl
```bash
curl -fsSL https://opencode.ai/install | bash
```

### Via npm
```bash
npm install -g opencode-ai
```

### Via Docker
```bash
docker run -it --rm ghcr.io/anomalyco/opencode
```

### Configuration
- API keys for LLM providers
- Project-level AGENTS.md for agent behavior
- Custom commands, themes, keybinds
- Formatter integration
