DEV Community

Hironobu Sano
Hironobu Sano

Posted on • Originally published at zenn.dev

Living on the Linux Console — Part 2: casty, a Full Browser for TTY

"GUI isn't an option." — Anonymous

In Part 1, I built bcon — a GPU-accelerated terminal emulator for the Linux console. But there's one thing you can't escape as a developer:

A web browser.

AI coding agents can handle research just fine. But what about checking your own web app renders correctly? Or GitHub Actions, PR reviews, and other things gh can't cover? For those, you need a real browser.

I looked for existing options. Here's what I found:

eww browsh Carbonyl awrit casty ⭐
Engine Emacs shr headless Firefox Chromium fork Electron Chrome headless-shell
Rendering Text + limited images ANSI block chars Unicode blocks (▄ + 24bit) Kitty Graphics Kitty Graphics
JavaScript ✅ (WebGL/WebGPU)
Site fidelity 🔴 Low 🟡 Low 🟡 Medium 🟢 High 🟢 High
No GUI env Linux ✅ / Mac ❌ ❌ (display server required) ✅ (no X11, SSH-friendly)
Text copy ✅ (Alt+C)
Mouse 🔺
Install M-x package-install go install npm i -g carbonyl curl | bash npm i -g @sanohiro/casty

Nothing checked all the boxes: JavaScript + CSS + high fidelity + text copy + no GUI required.

So I built it.

github.com/sanohiro/casty

npm i -g @sanohiro/casty
Enter fullscreen mode Exit fullscreen mode

casty running on bcon casty running on the Linux console inside bcon

YouTube playing in casty YouTube video playback inside casty on bcon

casty works with any Kitty Graphics-compatible terminal — not just bcon. Ghostty and Kitty both work too.

How it works

The concept is simple: connect to Chrome headless-shell via CDP (Chrome DevTools Protocol), stream frames to the terminal using Kitty Graphics Protocol, and forward keyboard/mouse events back to Chrome.

Chrome downloads itself automatically on first run to ~/.casty/ — no manual setup needed. Cookies and storage are preserved, so you can log in to Google and other services normally.

  1. casty launches Chrome headless-shell (auto-downloaded to ~/.casty/ on first run)
  2. Connects via CDP WebSocket
  3. Captures screenshots and streams them to the terminal using Kitty Graphics Protocol
  4. Forwards your keyboard and mouse events back to Chrome via CDP

Real-world use: Claude Code + casty

The moment I actually wanted this: editing a React app with Claude Code while watching changes live in casty.

Claude Code editing React+Vite Claude Code rewriting a React+Vite app — UI is in Japanese, but you get the idea 😄

Live reload in casty Changes reflected instantly in casty

It just works. 😎

Starting to think you might be able to live on the Linux console after all?

More to come.

Top comments (0)