# hotty

**HTML over the TTY.**

A terminal program prints small HTML documents—**surfaces**—and the terminal lays them out and draws them inside rectangles of character cells. No JavaScript, no local server, no browser: everything travels in-band over `stdout`/`stdin`, so it works over a PTY and SSH, and falls back to plain text in standard terminals.

![hotty full screen in one terminal: the shell asks a form through askhot, plothot streams a chart, a metrics chart is hovered and pinned, a document scrolls, cards move in a feed, and an agent runs a diff, an approval and a load test.](https://hotty.neuroplast.io/docs/_files/hotty/demo.gif)


[Website](https://hotty.neuroplast.io/) ·
[Docs](https://hotty.neuroplast.io/docs) ·
[Specification](https://hotty.neuroplast.io/docs/protocol) ·
[Changes](https://hotty.neuroplast.io/docs/changes) ·
[Examples](https://github.com/neuroplastio/hotty/tree/main/examples)


## Why hotty

Standard terminals only render monospace character cells. hotty adds a second primitive: a **surface**, an HTML/CSS document anchored to a rectangle of cells. The terminal lays it out and renders it at native resolution—proportional text, tables, form inputs, SVG, and images—while everything outside the surface stays ordinary terminal text. Clicks, input changes, and form submissions return to the program on `stdin`.

hotty is built around four constraints:

- **In-band.** Everything a surface needs travels on `stdout`. Nothing is fetched from disk or the network, so programs work identically locally, over SSH, and inside containers.
- **No JavaScript.** Surfaces contain no scripts. The program holds application state and handles every event; the terminal is purely the view.
- **Deltas, not redraws.** Updates target elements by `id`, so changing a live counter or chart point costs tens of bytes.
- **Graceful fallback.** Programs probe for a hotty host at startup and fall back to character cells when running in plain terminals or pipes.

See [How hotty works](https://hotty.neuroplast.io/docs/concepts/how-it-works) for a step-by-step walkthrough from startup query to click event.

## Status

**Version 0.10 (draft).** Pre-1.0 versions may introduce breaking changes (§15 of [SPEC.md](https://hotty.neuroplast.io/docs/protocol)). Version 0.10 is wire-incompatible with 0.9 for single-version peers; official hosts and SDKs support both 0.9 and 0.10. Highlights in 0.10 include the pointer's kind (mouse, pen or touch) on events and in CSS media features, a drag per finger, pinch and rotation gestures from a touchscreen or a trackpad, and a canvas's own wheel, with whether it scrolls by pixels or by notches. See [`CHANGES.md`](https://hotty.neuroplast.io/docs/changes) for details and upgrade notes.

Two independent host implementations pass the conformance suite:
[hotty-blitz](https://hotty.neuroplast.io/docs/hotty-blitz) (the native renderer inside `hottyterm`) and
[xterm-addon-hotty](https://hotty.neuroplast.io/docs/xterm-addon-hotty) (for xterm.js in browsers).

## Quick start

Install [**hottyterm**](https://hotty.neuroplast.io/docs/hottyterm), a Ghostty fork with native hotty support:

```sh
brew install --cask neuroplastio/tap/hottyterm   # macOS (Apple silicon)
yay -S hottyterm-bin                             # Arch Linux (x86_64)
```

Run an example inside it:

```sh
python3 examples/dash.py
```

To try hotty without installing anything, open [hotty.neuroplast.io](https://hotty.neuroplast.io/)—the site itself is a single hotty program running in xterm.js via `xterm-addon-hotty`.

## Next steps

- **Run hotty apps:** [Choose a host](https://hotty.neuroplast.io/docs/hosts) (`hottyterm`, xterm.js, `hotty run`, or `plx`).
- **Build an app:** [Choose an SDK](https://hotty.neuroplast.io/docs/sdks) (Go + `hotty-surf`, TypeScript, Rust, Lua, or Python).
- **Learn the model:** Read the Concepts guides, starting with [How hotty works](https://hotty.neuroplast.io/docs/concepts/how-it-works).
- **Implement a host or SDK:** Read the [protocol specification](https://hotty.neuroplast.io/docs/protocol), [SDK design](https://hotty.neuroplast.io/docs/sdk-design), [host design](https://hotty.neuroplast.io/docs/host-design), and [conformance vectors](https://hotty.neuroplast.io/docs/conformance).

## Repositories

| Repository | Description |
| --- | --- |
| `hotty` | Protocol specification, conformance vectors, docs, and reference Python client |
| [`hotty-surf`](https://hotty.neuroplast.io/docs/hotty-surf) | Go UI framework for hotty: `templ` components, 42 `surfui/*` widgets, `surfmd` Markdown, and automatic `surftui` cell fallback |
| [`hotty-go`](https://hotty.neuroplast.io/docs/hotty-go) | Go protocol SDK: wire codec, `hottyterm` for CLIs, `hottyedit`, `hottyvt`, and `hottytest` |
| [`hotty-ts`](https://hotty.neuroplast.io/docs/hotty-ts) | TypeScript SDK (`@neuroplastio/hotty`) for Node and Bun |
| [`hotty-rs`](https://hotty.neuroplast.io/docs/hotty-rs) | Rust SDK (`hotty` and `hotty-ratatui`) and host-side parser |
| [`hotty-lua`](https://hotty.neuroplast.io/docs/hotty-lua) | Lua 5.1 protocol library, `hotty.nvim` for Neovim, and `hotty.plx` for plx scripts |
| [`hottyterm`](https://hotty.neuroplast.io/docs/hottyterm) | Native desktop terminal (Ghostty + `hotty-blitz`) for macOS and Linux |
| [`hotty-blitz`](https://hotty.neuroplast.io/docs/hotty-blitz) | Rust HTML/CSS renderer (Dioxus Blitz) with a C ABI, plus the `hotty run` Kitty-graphics polyfill |
| [`xterm-addon-hotty`](https://hotty.neuroplast.io/docs/xterm-addon-hotty) | xterm.js addon rendering surfaces in sandboxed iframes |
| [hotty.neuroplast.io](https://hotty.neuroplast.io/) | Website, interactive tour, and demo apps (one Go binary compiled to native and WebAssembly) |

## Repository layout

| Path | Contents |
| --- | --- |
| [`SPEC.md`](https://hotty.neuroplast.io/docs/protocol) | Wire protocol specification |
| [`SDK.md`](https://hotty.neuroplast.io/docs/sdk-design) | Cross-language SDK design (components, options, defaults, naming) |
| [`HOST.md`](https://hotty.neuroplast.io/docs/host-design) | Host conventions beyond the wire protocol (such as bundled fonts) |
| [`CHANGES.md`](https://hotty.neuroplast.io/docs/changes) | Version changelog and migration notes |
| [`docs/`](https://github.com/neuroplastio/hotty/tree/main/docs) | Guides: hosts, SDKs, concepts, and glossary |
| [`conformance/`](https://hotty.neuroplast.io/docs/conformance) | Data-driven conformance test vectors for hosts and SDKs |
| [`corpus/`](https://github.com/neuroplastio/hotty/tree/main/corpus) | HTML/CSS test pages for host rendering coverage |
| [`examples/`](https://github.com/neuroplastio/hotty/tree/main/examples) | Standalone example programs (card, dashboard, form, grid, game, menu) |
| [`clients/python/hotty.py`](https://github.com/neuroplastio/hotty/blob/main/clients/python/hotty.py) | Zero-dependency Python reference client implementing `SDK.md`; tested by `test_vectors.py` |

`examples/bubbros.py` requires fetching assets first via `scripts/bubbros-fetch.sh`.

## Changing the protocol

- **Wire changes** must update [`SPEC.md`](https://hotty.neuroplast.io/docs/protocol) and [`conformance/vectors.json`](https://github.com/neuroplastio/hotty/blob/main/conformance/vectors.json) together, with both host implementations passing the new vectors. Breaking changes require a version bump (§15).
- **Extensions** belong under a vendor prefix (§15) until adopted by a second implementation.

## Licence

- `SPEC.md` and documentation: [CC BY 4.0](https://github.com/neuroplastio/hotty/blob/main/LICENSE-CC-BY-4.0).
- Conformance vectors, corpus, examples, and reference client: [Apache-2.0](https://github.com/neuroplastio/hotty/blob/main/LICENSE-APACHE).
