A minimal CLI coding assistant powered by Claude and Context7. Ask for a code example in any language and get a concise, working snippet with a short explanation — without leaving the terminal.
Install the CLI directly from GitHub with pipx:
pipx install git+https://github.com/usefulmove/coder.gitThis installs the coder entrypoint in an isolated environment and makes it
available on your PATH.
For local development, clone the repository and install it in editable mode:
git clone https://github.com/usefulmove/coder.git
cd coder
uv venv
source .venv/bin/activate
uv pip install -e .
# Or with pip
python3 -m venv .venv
source .venv/bin/activate
pip install -e .Set your Anthropic API key:
export ANTHROPIC_API_KEY=sk-ant-...Optionally, set a Context7 API key for higher rate limits:
export CONTEXT7_API_KEY=ctx7sk-...Get your API keys:
- Anthropic: console.anthropic.com
- Context7 (optional): context7.com/dashboard
# Get a code example
coder "modern C++ fold_left"
# Rust iterators
coder "Rust iterators filter map collect"
# Python async
coder "Python asyncio gather example"
# React hooks
coder "React useEffect cleanup"Pass the query as an argument, or omit it to be prompted interactively:
coder
# code description (and language): Python dataclass frozencoder returns:
- A minimal, working code snippet
- A short description explaining how the code works
No preamble. No filler. Just code.
Your query
│
▼
Claude Haiku 4.5 + Context7 MCP
│
├── Tries Context7 docs first (accurate, up-to-date)
│
├── Falls back to web search if needed
│
▼
Concise code example
- You describe a concept in any programming language
- Claude uses the Context7 MCP server to find accurate documentation
- If Context7 doesn't have it, Claude searches the web
- Claude synthesizes a minimal, working example for an experienced engineer
- Output is rendered as markdown with syntax highlighting via
rich
Query:
coder "Python dataclass frozen"Output:
from dataclasses import dataclass
@dataclass(frozen=True)
class Point:
x: int
y: int
p = Point(1, 2)
# p.x = 3 # Raises FrozenInstanceErrorA frozen dataclass is immutable after creation.
Query:
coder "Rust Result map_err"Output:
fn parse_number(s: &str) -> Result<i32, String> {
s.parse::<i32>()
.map_err(|e| format!("Parse error: {}", e))
}map_err transforms the error type while preserving the success value.
# Lint and format
uv run ruff check .
uv run ruff format .
# Install dev dependencies
uv pip install -e ".[dev]"- Python 3.13+
ANTHROPIC_API_KEYenvironment variableuv(recommended) orpip
- Claude Haiku 4.5: Fast inference for quick responses
- Context7 MCP: Accurate, up-to-date documentation
- Web Search: Fallback for libraries not in Context7
- Rich: Markdown rendering with syntax highlighting
See docs/core/ARCHITECTURE.md for details.