Termium — Chromium-Based Terminal Browser
A Rust-powered terminal browser that renders real web pages with pixel-perfect fidelity in kitty, WezTerm, and Ghostty using Chromium headless + CDP.
🎯 What It Does
Termium is a Chromium-based terminal browser written in Rust. It renders real web pages — HTML, CSS, JS, the whole deal — directly in your terminal with pixel-perfect fidelity.
termium start https://news.ycombinator.com
It drives a headless Chromium instance (patched Carbonyl fork) via the Chrome DevTools Protocol, captures JPEG frames, decodes them, and renders each frame to the terminal using kitty/sixel/ANSI protocols at ~10 FPS — all without leaving your terminal.
🧱 Tech Stack
| Component | Technology |
|---|---|
| Language | Rust 2021 edition |
| Browser Engine | Chromium (Carbonyl fork, patched for terminal output) |
| Protocol | CDP (Chrome DevTools Protocol) over WebSocket |
| Render backends | Kitty, Sixel, ANSI (block chars) |
| Image pipeline | JPEG capture → decode → terminal encode |
The key design decision: no GUI toolkit, no X11/Wayland dependency. Termium talks directly to Chromium’s debugging protocol and renders frames using terminal escape sequences — it works in any terminal that supports kitty or sixel graphics.
🏗️ Architecture
┌──────────────┐ CDP (WebSocket) ┌──────────────────┐
│ Carbonyl │◄────────────────────────►│ libtermium CLI │
│ (Chromium │ │ (Rust) │
│ headless) │── JPEG frames ──────────►│ ├─ CDP client │
└──────────────┘ │ ├─ WS client │
│ ├─ JPEG decode │
│ └─ kitty/sixel │
│ /ANSI encode │
└────────┬─────────┘
│ stdin/stdout
┌────────▼─────────┐
│ Terminal │
│ (kitty/WezTerm/ │
│ Ghostty) │
└──────────────────┘
The workspace has two crates:
libtermium— Core library: CDP client, WebSocket transport, JPEG decoding, and terminal protocol encoding (kitty/sixel/ANSI)termium-cli— CLI frontend: keyboard input handling, frame rendering loop, terminal capability detection
🖥️ Render Protocols
| Protocol | Quality | Terminals |
|---|---|---|
| Kitty | Pixel-perfect, 24-bit color, zstd compression | kitty, WezTerm (≥2023), Ghostty |
| Sixel | Pixel-perfect, 256-color | xterm, mlterm |
| ANSI | Block characters (U+2584) | All terminals (fallback) |
🚀 Quick Start
# Build from source
git clone https://github.com/praneshnikhar/Termium
cd Termium
cargo build --release
# Download the Chromium binary
./target/release/termium download
# Browse the web in your terminal
./target/release/termium start https://news.ycombinator.com
🧠 How It Works
termium downloadfetches a pre-patched Carbonyl Chromium binarytermium start <url>launches Chromium headless with--headless=newand connects via CDP WebSocket- Chromium captures viewport screenshots as JPEG frames and streams them over CDP
libtermiumdecodes each JPEG, diffs against the previous frame, and encodes the delta as terminal graphics protocol commands- The CLI pumps frames at ~10 FPS, forwarding keyboard input back to Chromium via CDP input events
The magic is in the protocol encoding: kitty graphics protocol supports 24-bit color, zstd-compressed frames, and pixel-perfect placement — making the terminal feel like a real browser window.
💡 Why It’s Interesting
Termium is a genuinely novel approach to terminal browsing. Instead of text-mode browsers (lynx, w3m) that strip the web to text, or framebuffer approaches that require root, Termium uses Chromium’s headless mode + terminal graphics protocols to deliver the real web in any modern terminal. It’s the only Rust-native terminal browser that supports kitty pixel graphics, and the architecture (CDP + JPEG frames + terminal encode) is clean enough to extend to any protocol.