Terminal AI coding assistant built with Python, Textual and litellm
  • Python 99.8%
  • Shell 0.2%
Find a file
aleksandr nikolich 9e67b6bd6a Initial commit: coder-cli — terminal AI coding assistant
Textual TUI with Tokyo Night theme, litellm for multi-provider LLM,
agent loop with native tool_calls, 8 built-in tools (read, write, edit,
bash, grep, glob, list_dir, patch), 3 modes (Build/Plan/Ask),
SQLite session persistence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:40:24 +01:00
src/opencode Initial commit: coder-cli — terminal AI coding assistant 2026-03-06 19:40:24 +01:00
.gitignore Initial commit: coder-cli — terminal AI coding assistant 2026-03-06 19:40:24 +01:00
opencode.json Initial commit: coder-cli — terminal AI coding assistant 2026-03-06 19:40:24 +01:00
pyproject.toml Initial commit: coder-cli — terminal AI coding assistant 2026-03-06 19:40:24 +01:00
README.md Initial commit: coder-cli — terminal AI coding assistant 2026-03-06 19:40:24 +01:00
run.sh Initial commit: coder-cli — terminal AI coding assistant 2026-03-06 19:40:24 +01:00

coder-cli

Terminal AI coding assistant built with Python. Inspired by OpenCode.

Features

  • Full TUI built with Textual
  • Multi-provider LLM support via litellm
  • Native OpenAI-compatible tool calling (read, write, edit, bash, grep, glob, list, patch)
  • Three modes: Build (full tools), Plan (read-only), Ask (chat only)
  • Session management with SQLite persistence
  • Tokyo Night color theme

Install

uv venv && source .venv/bin/activate
uv pip install -e .

Configure

Create opencode.json in your project directory:

{
  "model": "openai/gpt-4o",
  "max_tokens": 8192,
  "provider": {
    "api_key": "sk-...",
    "base_url": "https://api.openai.com/v1"
  }
}

Or use environment variables:

export OPENAI_API_KEY="sk-..."
export OPENAI_API_BASE="https://api.openai.com/v1"

Run

# TUI mode
python -m opencode

# Non-interactive
python -m opencode -p "explain this code"

# Custom model
python -m opencode -m anthropic/claude-sonnet-4-20250514

Keyboard Shortcuts

Key Action
Enter Send message
Shift+Enter New line
Tab Switch mode (Build/Plan/Ask)
Ctrl+S Switch session
Ctrl+N New session
Ctrl+H Help
Ctrl+C Quit