Talk to any LLM from your terminal.
OpenAI, Anthropic, Gemini, Vertex AI, and the OpenAI Responses API. All with tool calling support.
Tokens appear in real-time as the model generates them, with a loading spinner while waiting. Press Esc to interrupt a streaming reply — the partial answer is kept in history.
Send images, PDFs, and code files alongside messages. Tab-completion for file paths.
Full conversation history, interactive model selection, and color-coded terminal output.
Non-interactive mode with -m flag. Use -m - to read from stdin — pipe-friendly.
Persistent API keys, default models, and custom provider aliases via ~/.chatchain.yaml.
Connect external MCP servers (filesystem, GitHub, databases) and let AI use them as tools during chat, with per-server namespaced tool names that never collide.
Headings, bold, italic, code, and tables are highlighted with ANSI colors in streaming output.
Use as a Claude Code plugin to call other LLMs directly within your coding workflow.
Every chat is auto-saved losslessly to ~/.chatchain/sessions/. Resume past sessions — replaying the last few exchanges — switch models mid-chat, or run ephemerally.
Live token accounting against the context window, with one-command LLM summarization to compact older history when it fills up.
Type / for an auto-completing, highlighted command menu — attach files, manage sessions, compact context, and more.
Opt-in --agent: layered AGENTS.md instructions and Agent Skills flow into the system prompt, a read-only read_file tool activates them, and sessions are grouped per project.
Each provider uses its official SDK. Pass your API key via flag or environment variable (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY).
Attach files in interactive mode with the /file command — pass a path (with Tab completion) to attach directly, or run it bare to open a tabbed selector that both removes pending attachments and browses to add new ones. Files are sent with your next message, then cleared automatically.
Supported file types:
ChatChain works as a Claude Code plugin. Install it to call other LLMs directly within Claude Code.
| Flag | Short | Description |
|---|---|---|
--key | -k | API key (or set via env var) |
--url | -u | Custom base URL |
--model | -M | Model name (skip interactive selection) |
--temperature | -t | Sampling temperature (0.0-2.0) |
--message | -m | Non-interactive: send a single message (use - to read from stdin) |
--system | -s | System prompt |
--system-input | -S | Enter system prompt interactively |
--list | -l | List configured providers, or models for a given provider |
--mcp | MCP server (command or URL, repeatable) | |
--config | -c | Path to config file (default: ~/.chatchain.yaml) |
Save API keys, default models, and custom provider aliases in ~/.chatchain.yaml. Priority: CLI flag > env var > config file.
With this config, chatchain deepseek -m "hello" uses the OpenAI provider with DeepSeek's key, URL, and model. MCP servers are connected automatically on startup. MCP values support VS Code-style variables: ${workspaceFolder}, ${userHome}, ${pathSeparator}, and ${env:VAR}. Config files are loaded from ~/ (global) and ./ (project-local), or via -c <path>.
| Command | Description |
|---|---|
/file [path] | Attach a file; with no path, opens a tabbed selector to remove attachments or browse and add one |
/session | Tabbed selector: resume a saved session, or multi-select and delete others |
/model | Tabbed session settings: model, context window, reasoning effort, and temperature — Enter applies all four tabs (effort levels are passed verbatim; unsupported values surface as API errors) |
/compact [hint] | Summarize older history to free up context |
/export [file] | Export the full conversation to a single self-contained HTML file (default) or Markdown (.md) |
/status | Show provider, model, context usage, and last-turn tokens |
/tools | Tabbed read-only view: a "Tools" tab (built-in + MCP tools) and an "MCP" tab (server status) |