Skip to main content

OpenCode vs Codex CLI

A detailed comparison of OpenCode and Codex CLI across 11 dimensions.

OpenCode

Open-source AI coding agent for the terminal, 188K⭐ community favorite

Price
Free (BYOK)
GitHub Stars
188K+
Open Source
true
Models
GPT-4o, Claude, Gemini, DeepSeek, and more
Max Context
依模型而定
Multi-file Edit
true
Git Integration
true
MCP Support
true
Sub-agents
true
Platforms
macOS, Linux
Released
2025
npm install -g opencode

Codex CLI

OpenAI's open-source AI coding agent CLI

Price
BYOK (Bring Your Own Key)
GitHub Stars
100K+
Open Source
true
Models
GPT-4o, GPT-4.1, o-series (via API)
Max Context
128K tokens
Multi-file Edit
true
Git Integration
true
MCP Support
true
Sub-agents
false
Platforms
macOS, Linux
Released
2025
npm install -g @openai/codex

Full Comparison

ToolPriceGitHub StarsOpen SourceModelsMax ContextMulti-file EditGit IntegrationMCP SupportSub-agents
OpenCode🔓
Open-source AI coding agent for the terminal, 188K⭐ community favorite
Free (BYOK)188K+GPT-4o, Claude, Gemini, DeepSeek, and more依模型而定
Codex CLI🔓
OpenAI's open-source AI coding agent CLI
BYOK (Bring Your Own Key)100K+GPT-4o, GPT-4.1, o-series (via API)128K tokens

Quick Install

OpenCodenpm install -g opencode
Codex CLInpm install -g @openai/codex