Coding & Development✨geminiπŸ€–claudeπŸ’¬gpt🌐universal

ChatChain

A lightweight, cross-platform AI chat CLI built with Go. Supports multiple providers, streaming responses, and an interactive terminal UI.

Quick Start

Install this Skill

npx skills add joyqi/chatchain
# ChatChain

A lightweight, cross-platform AI chat CLI built with Go. Supports multiple providers, streaming responses, file attachments, and an interactive terminal UI.

## Features

- **Multi-provider** β€” OpenAI, OpenAI Responses API, Anthropic, Gemini, and Vertex AI, with custom base URL support
- **MCP tool support** β€” connect external MCP tool servers (filesystem, GitHub, databases, etc.) and let AI providers use them during chat, with tool names namespaced per server (`mcp__<server>__<tool>`) so same-named tools never collide
- **Interactive model selection** β€” arrow-key list at startup
- **Slash-command completion** β€” a suggestion row appears when the line starts with `/` and narrows as you type; press Tab to cycle through the completions
- **Streaming responses** β€” real-time token output with a busy spinner in the status line; keep typing while a reply streams (type-ahead β€” queued submits are sent in order); press **Esc** (cancels the innermost running scope) or **Ctrl+C** (cancels the turn) to interrupt a streaming reply β€” the partial reply is kept in history and marked interrupted
- **Markdown highlighting** β€” inline ANSI styling for headings, bold, italic, code, tables, and code blocks in streaming output; inline LaTeX math (`$...$`, `\(...\)`) is approximated in Unicode, and display math (`$$...$$`, `\[...\]`) renders as a 2D block β€” stacked fractions, roots with a drawn vinculum, matrices, aligned environments, sums/integrals with limits, drawn accents (`\hat`/`\vec`/`\bar`), and math fonts (`\mathbb`/`\mathcal`); anything unsupported falls back to a readable single-line approximation, never raw LaTeX
- **File attachments** β€” send images, PDFs, and text files alongside messages; `/file` opens a tabbed surface with the attached list and a directory browser
- **Non-interactive mode** β€” single message in, response out, pipe-friendly
- **Conversation history** β€” full context maintained within a session
- **Session persistence** β€” every interactive session is auto-saved (losslessly: messages, tool calls, attachments, reasoning) to `~/.chatchain/sessions/`. Resume with `/session` in chat or `--resume[=<id>]` at launch (any unique id prefix works), and resuming echoes the last few exchanges back to the terminal; auto-titled by the model after the first reply; `--no-save` (or `no_save: true` per provider) starts ephemeral β€” nothing touches disk unless you run `/save [title]` mid-chat, which persists the whole backlog and auto-saves from then on (great for exploratory chats you might or might not keep)
- **Context management** β€” live token accounting against the context window (configurable via `--context-window` or the `/model` Context tab), with `/compact` LLM-summarization of older history; when the window nears full a confirmation is offered before compacting (declining snoozes the prompt until usage grows further)
- **Model settings mid-chat** β€” `/model` opens a tabbed panel over the model, context window, reasoning effort, and temperature, all persisted with the session and replayed on resume
- **Conversation export** β€” `/export` renders the session to a single self-contained HTML file (inline CSS, dark mode with a toggle, syntax-highlighted code) or a plain Markdown document; saved sessions export the full on-disk log, so compaction never hides older rounds (ephemeral `--no-save` sessions export the current in-memory view)
- **Agent mode** β€” opt-in via `--agent` (or `agent: true` per provider): layered `AGENTS.md` instructions and [Agent Skills](https://agentskills.io/specification) are injected as a volatile system-prompt overlay, the `agent` toolset (`load_skill`) is auto-enabled, and sessions are grouped per project
- **Request inspector** β€” `/debug` opens a two-tab console: a **Verbose** toggle turns recording on/off (off by default), and **Messages** browses the captured API calls (newest first), each summarized by action and content (e.g. `Chat δ½ ε₯½β€¦`) rather than raw method/URL β€” drill into any one to read its `↑ Request` and `↓ Response` bodies, pretty-printed, with `c` to copy to the clipboard. Nothing is printed to the terminal; it replaces the old `-v` flag
- **System prompt** β€” set via flag or interactive input
- **Config file** β€” persistent API keys, default models, custom provider aliases, and MCP server definitions via `~/.chatchain.yaml`
- **Styled terminal output** β€” color-coded prompts

## Install

### Homebrew (macOS)

```bash
brew tap joyqi/tap
brew install chatchain
```

### Go

```bash
go install github.com/joyqi/chatchain@latest
```

### Build from source

```bash
git clone https://github.com/joyqi/chatchain.git
cd chatchain
go build -o chatchain .
```

## Claude Code Plugin

ChatChain provides a [Claude Code](https://docs.anthropic.com/en/docs/claude-code) plugin, allowing you to call other LLMs directly within Claude Code.

### Plugin Install

```bash
# Add the marketplace
/plugin marketplace add joyqi/chatchain

# Install the plugin
/plugin install chatchain@chatchain-mark

... (truncated)
Repository
3stars
0forks
View on GitHub
Details
DiscoveredAug 1, 2026
Last UpdatedAug 1, 2026
Author@joyqi
Quality Score
35/100