tw93/Kaku — Kaku: AI-Powered Terminal
Transcript
QuickFacts
Welcome! Today we're exploring Kaku, a macOS terminal emulator that brings AI right into your shell. Think of it as WezTerm reimagined for AI-assisted coding workflows, with opinionated defaults and a heavy dose of macOS polish.
PlainEnglish
Kaku is a terminal emulator, the app you use to type shell commands on macOS. But it's not just a shell: it's a GPU-accelerated rendering engine, a tabs-and-panes multiplexer, and a full AI chat assistant, all rolled into one. Press Command-L and you're chatting with an AI that can see your terminal output and run tools on your behalf.
QuickFacts
The tech stack is Rust all the way down. At the application layer, we've got mlua for Lua config integration. The UI layer uses wgpu for Metal-accelerated rendering, harfbuzz for text shaping, and ratatui for the config screens. Services include reqwest for streaming AI chat and portable-pty for spawning shell processes.
Architecture
Here's the architecture at a glance. User input flows through termwindow, the GUI coordinator. It talks to the mux, which manages tabs and panes, and the mux talks to term, the VT emulation layer. Term reads and writes to the PTY, your actual shell process. Press Command-L and the termwindow spins up the AI chat engine in a background thread. Lua config watches for reload signals and updates the window. Everything renders through WebGPU and Metal.
PlainEnglish
Let's talk about the glyph cache. Think of it like a sticker sheet. The first time the renderer needs the letter A in JetBrains Mono at twelve point, it asks FreeType to rasterize it, cuts out the bitmap, and sticks it onto the texture atlas, which is the GPU's sticker sheet. Every subsequent A just references that same sticker by coordinates. The cache evicts least-frequently-used stickers when the atlas fills up.
Architecture
Here's what happens when you press Command-L. The termwindow spawns an overlay thread that captures a snapshot of your visible terminal lines. You type a question. The overlay hands it to the AI chat engine, which streams the request to an OpenAI-compatible API. Tokens stream back, and the overlay renders them with Markdown formatting and syntax highlighting. It's like laying a transparent sheet of paper over your terminal—press Escape and the overlay lifts off, leaving your shell exactly as it was.
PlainEnglish
Let's walk through splitting a pane. You press Command-D. The mux inserts a new node in its binary tree, assigns a stable pane ID, and spawns a new PTY with a shell process. It recalculates the layout geometries for every positioned pane, then notifies the GUI to invalidate and redraw the borders. The whole journey happens in milliseconds.
Architecture
Config reload is my favorite trick. When you save your Lua config, the shell integration taps the terminal's shoulder by setting a user variable via an escape sequence. The terminal core recognizes the knock and sends an alert up to the mux, which forwards it to the GUI. The GUI hears the knock, re-reads the config file, and updates every window. No restart needed—the whole chain completes in milliseconds.
Architecture
Let's zoom out and see where the code lives. The kaku-gui directory holds the rendering engine, AI overlays, and input handling. The mux directory is the tabs and panes abstraction with the bintree split layout. Term is the VT emulation core, and config is the Lua integration. Window wraps macOS AppKit, and crates holds shared utilities like the font subsystem and PTY abstraction.
Community
This repo is very much alive. We've got a commit from just yesterday, forty-two commits in the last month, and nearly four hundred in the past year. The project is driven by a tight-knit team—three active contributors in the last ninety days, with tw93 leading the charge at three hundred fifty commits. With four branches and eighteen tags, this is a project under active development.
PlainEnglish
So that's Kaku: a terminal reimagined for the AI era. It's GPU-accelerated for smooth rendering, AI-assisted with Command-L chat and tool execution, and Lua-configured for deep customization. Whether you're splitting panes, chatting with an assistant, or just running your shell, everything is designed to stay fast, responsive, and tightly integrated with macOS. Thanks for exploring with me!
How this was made
Lenzon read tw93/Kaku and generated this walkthrough automatically. The narration above is the transcript of what it says.
Explain a pull request from your own repo
Point Lenzon at a repo or a pull request and get a narrated walkthrough like this one.
Try it