Skip to content

Latest commit

 

History

History
694 lines (572 loc) · 27.4 KB

File metadata and controls

694 lines (572 loc) · 27.4 KB

AI Coding CLI Comparison: Bare vs Industry Leaders

A comprehensive comparison of Bare CLI against the leading AI coding agent CLIs: Claude Code, OpenAI Codex, OpenCode, Crush, AmpCode, and Pi-Agent.


Quick Reference Matrix

Feature Bare Claude Code OpenAI Codex OpenCode Crush AmpCode Pi-Agent
Language Go TypeScript TypeScript/Node Go Go Go 1.24+ TypeScript
Creator Self-hosted Anthropic OpenAI anomalyco Charm Sourcegraph/Coder Mario Zechner
Philosophy Deterministic runtime Full-featured Sandbox-first Configurable Glamorous TUI Team-focused Minimal/Opinionated
Database Filesystem SQLite - SQLite Filesystem SQLite JSONL
Provider Support Multi (3) Anthropic-only OpenAI-only Multi (75+) Multi (20+) Multi Multi (20+)
System Prompt Medium ~3000+ tokens Medium Medium Medium Large ~1000 tokens
Built-in Tools Execution, File ops 10+ tools Shell, Edit, etc. 15+ tools 10+ tools 15+ tools 4 tools
MCP Support No Yes Yes Yes Yes Yes No (intentional)
Subagents Via bash Yes Yes Yes No Yes (Task tool) No (intentional)
Plan Mode Via files Yes Yes Yes No No (Handoff) No (intentional)
AGENTS.md No CLAUDE.md Yes Yes Yes Yes (Creator) Yes
Hooks/Extensions Yes (shell) Yes Skills Plugins Skills Skills, Toolboxes Extensions (20+ hooks)
Session Structure Linear Linear Linear Linear Linear No compaction DAG (branching)

Detailed Analysis

1. Bare CLI (Your Project)

Tagline: "A deterministic coding-agent runtime and CLI for filesystem-backed automation"

Architecture

  • Language: Go 1.22+
  • Structure: cmd/bare/ + internal/ packages
    • internal/domain/ - Core domain types and configuration
    • internal/model/ - Provider adapters (OpenAI, Anthropic, ZAI)
    • internal/execution/ - Command execution engine
    • internal/storage/ - State persistence
    • internal/redaction/ - Sensitive value handling

Core Features

  • Commands: init, run, tick, resume, status, version
  • Provider Abstraction: Unified interface for OpenAI, Anthropic, ZAI
  • Wire API Selection: chat_completions vs responses per provider
  • Model Capabilities Matrix: JSON-driven (models.json) feature detection
  • Execution Engine: Shell command execution with timeout, output capture
  • Verification System: .bare/verify.d/ shell scripts for validation
  • Hook System: on_task_start, on_verify_pass/fail, on_task_done, etc.

Configuration

{
  "model": {
    "provider": "openai",
    "name": "gpt-5.2-codex",
    "fallback": "gpt-5-mini",
    "providers": {
      "openai": { "wire_api": "responses" },
      "anthropic": { "wire_api": "chat_completions" },
      "zai": { "base_url": "https://api.z.ai/api/paas/v4" }
    }
  }
}

Unique Features

  • Deterministic by Design: Explicit wire API selection, no runtime fallbacks
  • Verification-First: Built-in verify script system
  • Filesystem-Backed State: All state in .bare/ directory
  • Prompt Caching: Configurable per-provider
  • Redaction Layer: Sensitive value filtering before persistence

2. Claude Code CLI (Anthropic)

Tagline: "Anthropic's official agentic CLI for Claude"

Architecture

  • Language: TypeScript
  • Core Components:
    • CLAUDE.md - Project instructions (hierarchical loading)
    • Skills - Reusable workflows (YAML frontmatter + Markdown)
    • MCP - Model Context Protocol servers
    • Hooks - Lifecycle event scripts
    • Subagents - Isolated task execution

Model Support

Alias Model Use Case
default Opus 4.6 / Sonnet 4.5 Account-dependent
opus Claude Opus 4.6 Complex reasoning
sonnet Claude Sonnet 4.5 Daily coding
haiku Claude Haiku 4.5 Fast/simple tasks
opusplan Opus (plan) → Sonnet (exec) Hybrid mode
sonnet[1m] Sonnet + 1M context Long sessions

Unique Features

  • opusplan Mode: Uses Opus for planning, Sonnet for execution
  • Effort Levels: Low/Medium/High for Opus 4.6 reasoning
  • Context Loading: Progressive disclosure of skills
  • Session Memory: JSONL transcripts with summaries

3. OpenAI Codex CLI

Tagline: "Terminal-based coding agent by OpenAI"

Architecture

  • Language: TypeScript/Node.js
  • GitHub: openai/codex

Core Features

  • Sandbox Mode: Isolated execution environment
  • AGENTS.md Support: Project context files
  • Model Support: o3, o4-mini, GPT series
  • Approval Workflow: Interactive permission prompts

Configuration

# AGENTS.md
## Build
- `npm run build`

## Test
- `npm test`

## Conventions
- Use TypeScript strict mode

Unique Features

  • Sandbox Isolation: Security-first execution
  • Native OpenAI Integration: First-party support
  • Simple Configuration: Markdown-based

4. OpenCode CLI

Tagline: "Open-source AI coding agent"

GitHub: github.com/anomalyco/opencode | Website: opencode.ai

Note: OpenCode was moved to the anomalyco org. Crush is a separate new agent from the Charm team (charm.sh), not a rename of OpenCode.

Architecture

  • Language: Go 1.24+
  • TUI Framework: Bubble Tea (Charm)
  • CLI Framework: Cobra
  • Database: SQLite
  • Website: opencode.ai

Provider Support (75+ LLM Providers)

Category Providers
Anthropic Claude Opus 4.5, Sonnet 4.5, Haiku 4.5, 3.7 Sonnet
OpenAI GPT-4.1, GPT-4.5, GPT-4o, O1, O3, O4 Mini
Google Gemini 2.5 Pro/Flash, Gemini 2.0 Flash
GitHub Copilot GPT-3.5/4/4o, Claude 3.5/3.7, O1, O3 Mini
Cloud AWS Bedrock, Google VertexAI, Azure OpenAI
Fast Groq (Llama 4, QWEN, Deepseek R1)
Others OpenRouter, local via Ollama

Configuration Hierarchy

  1. Remote config (.well-known/opencode) - Organization defaults
  2. Global config (~/.config/opencode/opencode.json)
  3. Custom config (OPENCODE_CONFIG env)
  4. Project config (opencode.json)
  5. .opencode/ directory - agents, commands, plugins
  6. Inline config (OPENCODE_CONFIG_CONTENT)

Core Features

  • MCP Servers: Local (stdio) and Remote (HTTP/SSE) with OAuth auto-handling
  • Custom Agents: Per-task specialized agents with restricted tools
  • Commands: Reusable prompt templates with $ARGUMENTS
  • Keybinds: Customizable keyboard shortcuts
  • Formatters: Integrated code formatting (Prettier, custom)
  • Permissions: Tool-level access control (allow, ask, reject)
  • Compaction: Auto context compression at 95% capacity
  • LSP Integration: Multi-language diagnostics exposed to AI
  • Client/Server: Headless mode, web UI, mDNS discovery

MCP Configuration

{
  "mcp": {
    "sentry": {
      "type": "remote",
      "url": "https://mcp.sentry.dev/mcp",
      "oauth": {}
    },
    "my-local": {
      "type": "local",
      "command": ["npx", "-y", "my-mcp-command"],
      "environment": { "MY_VAR": "value" }
    }
  }
}

Agent Configuration

{
  "agent": {
    "code-reviewer": {
      "description": "Reviews code for issues",
      "model": "anthropic/claude-sonnet-4-5",
      "prompt": "You are a code reviewer...",
      "tools": { "write": false, "edit": false }
    }
  },
  "default_agent": "build"
}

Commands

Command Description
opencode / opencode tui Launch TUI
opencode run "<prompt>" Non-interactive mode
opencode serve Headless HTTP API server
opencode web Web interface
opencode attach Attach to remote backend
opencode mcp auth <server> OAuth authentication
opencode session Session management
opencode stats Token usage/costs

5. Crush CLI (Charm)

Tagline: "Glamourous agentic coding for all 💘"

GitHub: charmbracelet/crush | Website: charm.land

Origin: Created by Kujtim Hoxha, acquired by Charm (July 2025). Built on the Charm stack (Bubble Tea, Bubbles, Lip Gloss, Glamour).

Architecture

  • Language: Go
  • TUI Framework: Bubble Tea (Charm ecosystem)
  • Platforms: macOS, Linux, Windows (PowerShell, WSL), Android, FreeBSD, OpenBSD, NetBSD
  • Configuration: .crush.json, crush.json, or ~/.config/crush/crush.json
  • State Storage: ~/.local/share/crush/

Provider Support (20+)

Category Providers
Anthropic Claude Opus 4.5, Sonnet 4.5, Haiku 4.5
OpenAI GPT-4.1, GPT-4.5, GPT-4o, O1, O3, O4 Mini
Google Gemini via VertexAI
Cloud AWS Bedrock, Azure OpenAI
Fast Groq, Cerebras
Aggregators OpenRouter, Vercel AI Gateway
Others HuggingFace, MiniMax, Z.ai, io.net, Synthetic, local via Ollama/LM Studio
Custom OpenAI-compatible and Anthropic-compatible APIs

Core Features

  • Multi-Model: Switch LLMs mid-session while preserving context
  • Session-Based: Multiple work sessions per project
  • LSP-Enhanced: Uses LSPs for additional context
  • MCP Support: stdio, http, and sse transports
  • Agent Skills: Supports SKILL.md open standard
  • AGENTS.md: Can initialize projects with AGENTS.md or CRUSH.md
  • Permissions: allowed_tools config + --yolo mode for autonomy
  • Catwalk: Community-supported model database with auto-updates
  • Logging: crush logs command with --follow mode

Unique Features

  • Glamorous TUI: Beautiful terminal UI built on Charm stack
  • Provider Auto-Updates: Automatically fetches new models from Catwalk
  • Tool Disabling: Hide specific tools from agent entirely
  • Custom Providers: Full support for any OpenAI/Anthropic-compatible API
  • Attribution: Configurable git commit trailers (assisted-by, co-authored-by)
  • Metrics: Pseudonymous usage tracking (can be disabled)

CLI Commands

crush                         # Interactive TUI mode
crush logs                    # View recent logs
crush logs --follow           # Follow logs in real time
crush update-providers        # Update from Catwalk
crush --yolo                  # Skip all permission prompts
crush --debug                 # Enable debug logging

Configuration

{
  "$schema": "https://charm.land/crush.json",
  "lsp": {
    "go": { "command": "gopls" },
    "typescript": { "command": "typescript-language-server", "args": ["--stdio"] }
  },
  "mcp": {
    "filesystem": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/mcp-server.js"],
      "timeout": 120
    }
  },
  "permissions": {
    "allowed_tools": ["view", "ls", "grep", "edit"]
  },
  "options": {
    "initialize_as": "AGENTS.md",
    "disabled_tools": ["bash"]
  }
}

License

FSL-1.1-MIT


6. AmpCode CLI (Sourcegraph/Coder Labs)

Tagline: "The frontier coding agent for terminals and editors"

Website: ampcode.com | Manual: ampcode.com/manual

Architecture

  • Language: Go 1.24+ (same as Bare!)
  • Database: SQLite 3 (pure Go via ncruces/go-sqlite3)
  • Platforms: macOS, Linux, WSL
  • Integrations: VS Code, JetBrains (2025.1+), Neovim, Zed

Multi-Model Strategy

AmpCode uses different models for different purposes:

Component Model Purpose
Smart Mode Claude Opus 4.6 Maximum capability (default)
Rush Mode Claude Haiku 4.5 Fast/cheap tasks
Deep Mode GPT-5.2 Codex Extended thinking
Oracle GPT-5.2 (medium reasoning) Second opinions
Painter Gemini 3 Pro Image Image generation

Unique Tools

Tool Description
Oracle Second opinion from GPT-5.2 with medium reasoning - main agent can autonomously invoke
Librarian Cross-repo research - searches GitHub public/private, Bitbucket Enterprise
Painter Image generation via Gemini 3 Pro Image - mockups, icons, image editing
Task Subagent spawning with isolated context
Mermaid Generate architecture diagrams
Code Review amp review with user-defined Checks

Core Features

  • 30+ Hour Autonomy: Extended task execution without breaking
  • AGENTS.md Creator: Sourcegraph created the standard
  • No Compaction: Uses "Handoff" to continue in new threads instead
  • Thread Versioning: Shareable URLs (ampcode.com/threads/T-...)
  • Toolboxes: Custom tools in ANY programming language (prefix: tb__)
  • Skills: Installable packages (amp skill add ampcode/amp-contrib/tmux)
  • Permissions: Fine-grained rules (allow, reject, ask, delegate)

CLI Commands

amp                           # Interactive mode
amp -x "message"              # Execute mode (single turn)
amp --stream-json             # Streaming JSON for programmatic use
amp tools list                # List all tools
amp tools make --bash <name>  # Create toolbox tool
amp mcp add <name> -- <cmd>   # Add MCP server
amp skill add <repo>          # Install skill
amp review                    # Code review with Checks
amp usage                     # Check usage/credits

Configuration

{
  "amp.anthropic.thinking.enabled": true,
  "amp.permissions": [],
  "amp.mcpServers": {},
  "amp.showCosts": true,
  "amp.git.commit.coauthor.enabled": true,
  "amp.tools.disable": []
}

Location: ~/.config/amp/settings.json

AGENTS.md Support

  • Project root and parent directories (up to $HOME)
  • Subtree files included when reading files in that subtree
  • Global: $HOME/.config/amp/AGENTS.md
  • Supports @ mentions, YAML frontmatter with globs

Pricing

Tier Cost
Free $10 daily grant (ad-supported)
Paid Pay-as-you-go, no markup
Enterprise +50% cost, SSO, zero data retention

7. Pi-Agent CLI (Mario Zechner)

Tagline: "Minimal, opinionated coding agent"

GitHub: badlogic/pi-mono | NPM: @mariozechner/pi-coding-agent | Website: shittycodingagent.ai

Notable: Powers OpenClaw (145,000+ GitHub stars in one week)

Architecture: Monorepo with Strict Layering

┌─────────────────────────────────────────────────────────┐
│  APPLICATIONS                                           │
│  pi-coding-agent, pi-slack, pi-browser, mom, others    │
├─────────────────────────────────────────────────────────┤
│  CORE                                                   │
│  pi-agent-core (agent loop, state management)          │
├─────────────────────────────────────────────────────────┤
│  FOUNDATION                                             │
│  pi-ai (unified LLM API)    pi-tui (terminal UI)       │
└─────────────────────────────────────────────────────────┘

Philosophy of Omission

Feature Pi's Stance Rationale
No MCP Use CLI tools MCP dumps 13-18k tokens into context
No Subagents Spawn via bash/tmux Full observability
No Permissions YOLO by default "Security theater" (Simon Willison)
No Plan Mode Write plans to files Full observability, collaborative editing
No To-Dos Use TODO.md "Confuses models more than helps"
No Background Bash Use tmux Interactive co-debugging
No Compaction Manual /compact User controls context

The Four Tools (That's It)

const tools = ['read', 'write', 'edit', 'bash'];
// The model knows how to use CLI tools via bash.
// Need ripgrep? Run `rg` via bash. Need gh? Run `gh` via bash.

Unique Features

  • ~1000 Token System Prompt: Smallest in industry (vs 3000+ for Claude Code)
  • Session Branching: Append-only DAG structure - fork, navigate, continue from any point
  • Cross-Provider Sessions: Switch models mid-conversation, context carries over
  • Validation as Tool Results: When tool calls fail validation, error returned to model for self-correction
  • 20+ Lifecycle Hooks: onSessionStart, onBeforeTurn, onToolCall, onToolResult, etc.
  • Skills with Progressive Disclosure: Only descriptions in context, full content loads on trigger
  • Differential TUI Rendering: Flicker-free using synchronized output escape sequences

Agent Loop (Radically Simple)

async function* agentLoop(model, context, tools, options) {
  while (true) {
    const response = await streamCompletion(model, { ...context, tools });
    yield { type: 'assistant_message', content: response.content };
    if (!response.toolCalls?.length) break;  // Done when no tools
    for (const call of response.toolCalls) {
      yield { type: 'tool_start', name: call.name };
      const result = await executeToolCall(call, context);
      yield { type: 'tool_end', name: call.name, result };
    }
  }
}
// No max-steps knob - "loops until agent says it's done"

Extension System

const extension = {
  name: 'my-extension',
  onSessionStart: async (ctx) => { },
  onBeforeTurn: async (ctx, messages) => messages,  // Can modify
  onToolCall: async (ctx, call) => { /* can block */ },
  onToolResult: async (ctx, result) => result,  // Can modify
  tools: [{ name: 'custom', execute: async (input) => {...} }],
  commands: [{ name: 'cmd', execute: async (args, ctx) => {...} }]
};

Provider Support (20+)

  • Subscriptions: Anthropic Pro/Max, OpenAI Plus/Pro, GitHub Copilot, Gemini CLI
  • API Keys: Anthropic, OpenAI, Azure, Google, Bedrock, Mistral, Groq, xAI, OpenRouter, ZAI, more

CLI Commands

pi                           # Interactive mode
pi -p "Summarize codebase"   # Non-interactive
pi @code.ts "Review this"    # With files
pi --model openai/gpt-4o     # Model selection
pi --tools read,grep,find    # Read-only mode
pi -c                        # Continue most recent
pi -r                        # Browse sessions
pi install npm:@foo/pi-tools # Install package

Feature Comparison Deep Dive

Tool Systems

CLI Tool Approach Notable Tools
Bare Model proposes → Engine executes Shell execution, verification scripts
Claude Code Rich built-in toolkit Read, Write, Edit, Bash, Glob, Grep, Task, WebSearch, WebFetch
Codex Sandbox-isolated Shell, Edit, Read, Write
OpenCode Configurable + MCP 15+ built-in + unlimited via MCP, LSP diagnostics
Crush Charm TUI + MCP View, Ls, Grep, Edit, Bash + MCP tools, LSP integration
AmpCode Multi-tool ecosystem Oracle, Librarian, Painter, Task, Mermaid, 15+ built-in, Toolboxes, MCP
Pi-Agent Minimal (4 tools) Only: Read, Write, Edit, Bash - everything else via bash

Unique/Specialized Tools

CLI Tool Description
AmpCode Oracle Second opinion from GPT-5.2 with medium reasoning
AmpCode Librarian Cross-repo research (GitHub public/private, Bitbucket)
AmpCode Painter Image generation via Gemini 3 Pro Image
AmpCode Mermaid Generate architecture diagrams
Claude Code Task Subagent spawning with isolated context
OpenCode LSP Diagnostics Multi-language code intelligence
OpenCode Sourcegraph Search public repositories
Crush Catwalk Community model database with auto-updates
Pi-Agent None Philosophy: "The model knows how to use CLI tools"

Configuration Philosophy

CLI Config Style Location
Bare JSON .bare/config.json
Claude Code CLAUDE.md + Settings ~/.claude/settings.json
Codex AGENTS.md AGENTS.md
OpenCode JSON + Markdown opencode.json + .opencode/
Crush JSON .crush.json or ~/.config/crush/crush.json
AmpCode AGENTS.md AGENTS.md
Pi-Agent AGENTS.md + SYSTEM.md .pi/ directory

Provider Support

CLI Anthropic OpenAI Google Others
Bare ZAI
Claude Code ✅ Only Bedrock, Vertex
Codex ✅ Only
OpenCode Bedrock, many more
Crush Bedrock, Azure, Groq, 20+
AmpCode Multi-provider
Pi-Agent 20+ providers

Strategic Positioning

Go-Based CLIs: Bare, OpenCode, Crush, and AmpCode

Four of the seven CLIs in this comparison are Go-based, proving Go is a first-class language for AI coding tools:

Aspect Bare OpenCode Crush AmpCode
Go Version 1.22+ 1.24+ Go 1.24+
Database Filesystem SQLite Filesystem SQLite
TUI No Yes (Bubble Tea) Yes (Bubble Tea) No
Philosophy Deterministic Configurable Glamorous Team-focused
MCP No Yes Yes Yes
AGENTS.md No Yes Yes Yes (Creator)

Key Insight: The Go ecosystem for AI CLIs is thriving. Bare differentiates by being the "deterministic Go alternative" with verification-first approach, while Crush offers the most polished TUI experience.

Where Bare Excels

  1. Determinism: Explicit wire API selection, no magic
  2. Verification-First: Built-in test/verify workflow
  3. Provider Abstraction: Clean separation of concerns
  4. Go Performance: Compiled, fast, single binary
  5. Filesystem-Backed: All state visible and versionable
  6. Redaction Layer: Security-conscious output handling

Gaps to Address

  1. No MCP Support: Industry standard for tool integration
  2. No Subagents: Parallel task execution limited
  3. No AGENTS.md: Standard context file support
  4. Limited Tool Set: Could benefit from more built-in tools
  5. No Session Branching: Pi's DAG approach is powerful
  6. No Skills System: Reusable workflows missing

Opportunities

  1. Be the Deterministic Go Alternative: Stand out among Go CLIs (OpenCode, Crush, AmpCode)
  2. Determinism as Feature: Market the explicit wire API configuration
  3. Verification-First: Unique value prop for CI/CD pipelines
  4. Hybrid Approach: Combine Pi's minimalism with Crush's TUI polish
  5. Provider Agnostic: True multi-provider support (like Crush, OpenCode)

Key Architectural Lessons from Research

Lesson Source Application to Bare
Minimal prompts work Pi-Agent (~1k tokens) Audit system prompt, remove bloat
Session branching is powerful Pi-Agent (DAG) Add forking to session structure
Tool validation as feedback Pi-Agent Return validation errors to model
Oracle pattern AmpCode Add second-opinion model tool
Handoff > Compaction AmpCode Continue work in new context vs summarize
Toolboxes in any language AmpCode Support custom tools beyond shell
Glamorous TUI matters Crush Consider Bubble Tea for interactive mode
LSP integration OpenCode, Crush Add LSP context for better code understanding
Provider auto-updates Crush Community-driven model database
AGENTS.md is standard All others Must add for ecosystem compatibility
MCP is ecosystem Most others Essential for tool marketplace
SQLite for state OpenCode, AmpCode Consider for complex state management

Recommendations for Bare

High Priority

  1. Add AGENTS.md Support - Industry standard for context
  2. Add MCP Support - Tool ecosystem access
  3. Add Subagent Capability - Parallel task execution

Medium Priority

  1. Add Skills System - Reusable workflow templates
  2. Add Session Branching - Pi-style DAG sessions
  3. Add Built-in Tools - Glob, Grep, WebSearch

Low Priority

  1. Add TUI Mode - Interactive interface
  2. Add Plugin System - Extension marketplace
  3. Add Web Dashboard - Usage monitoring

Sources

Bare CLI

  • Local codebase exploration at /home/niko/bare

Claude Code

OpenAI Codex

OpenCode

Crush

AmpCode

Pi-Agent

AGENTS.md Standard


Generated: 2026-02-15 | Updated with Crush research