thcThought Control

Textual

Python TUI framework with DOM, CSS, widgets and web serving.

textual.textualize.io ↗repo ↗docs ↗Devtools guide ↗textual-serve ↗Toad ↗The future of Textualize ↗textual-mcp-server (third party) ↗

license
MIT · Toad (Will McGugan's agent front end on Textual) is AGPL-3.0.
language
Python
backing
Created by Will McGugan; Textualize Ltd (VC-backed) wound down in mid-2025 and Textual continues as an open-source project maintained mainly by McGugan (now on sabbatical, building Toad).
stars
37,416 (as of 2026-10-09)
downloads
14.5M/week, 55.5M/month on PyPI (pypistats.org recent); much of it transitive
latest release
v8.2.8, 2026-06-30
first release
2021-06
borrow

Textual's addressing, driver verbs and screenshot readback are proven designs scene should copy, but its code-defined UI and Python runtime don't fit a Rust JSON-scene.

Borrow from it: take a specific idea, API or format.

the steelman: the best honest case for it

Textual is the closest thing the terminal has to a browser: a real DOM you can query by CSS selector, a real stylesheet language with live reload, a compositor that does overlapping layers and partial updates, a rich widget set (DataTable, TextArea with tree-sitter, Markdown, Tree, Tabs), and an app that runs unchanged in a web browser via textual serve. Its Pilot test driver already gives you what agents need in principle — press keys, click a selector, wait for idle, take an SVG screenshot — and the DOM means an agent can address 'the button with id save' instead of cell coordinates. It is MIT, battle-tested by thousands of apps and millions of weekly installs, and its author has gone all-in on agents with Toad. For Python shops it is the obvious substrate, and a thin MCP over Pilot gets you most of an agent-drivable TUI.

scores
datadriveseeedittimeratetermpxteachmatureopen
UI as data3 scene 5compose() in Python plus TCSS; CSS is data, widget tree is code
Agent can drive it2 scene 5Pilot is an API but only for a test/headless instance; MCP wrappers are third-party and tiny
Agent can see it4 scene 5Selector-queryable DOM plus SVG screenshots (in-process)
Small, targeted edits2 scene 5Selector-addressed mutation exists in-process, not as a protocol
Time travel0 scene 0
Live data rate3 scene 5
Terminal native5 scene 5
Pixel graphics2 scene 4Third-party textual-image (Kitty TGP / Sixel)
Teaching2 scene 3textual serve, SVG screenshots and live CSS make demos easy; no tour features
Maturity4 scene 1Widely used; dev slowdown after Textualize closed keeps it off 5
Openness4 scene 4MIT but effectively single-maintainer controlled

Textual scene now scene planned

how agents use it

How

Code generation, plus in-process automation via Pilot (run_test). Third-party MCP servers wrap Pilot (discohead/textual-mcp-server, 4 stars: 'drive Textual TUI apps headlessly'). Toad is the inverse: a Textual UI for agents over the Agent Client Protocol, not agents driving Textual.

Wiring it in

Moderate: write or adopt an MCP wrapper around Pilot; the agent then gets selector-addressed clicks/keys and SVG screenshots of a headless instance (not the user's live one).

Seeing the result

Good in-process: the DOM can be queried by CSS selector, widget state read, and App.save_screenshot()/Pilot produce SVG renders. No built-in external socket for a live app.

Small edits

In-process code can mutate any widget by id/selector and change styles; from outside only via a custom wrapper.

History

None (devtools console shows logs/events only).

In short

The most introspectable of the mainstream frameworks (DOM + selectors + screenshots), but agent access is in-process/test-harness, not a live-instance protocol.

architecture

Retained mode: an App owns a DOM of Widget objects composed in Python (compose() yields children), styled by Textual CSS (TCSS) with selectors, layout (grid/horizontal/vertical/dock) and live reload. Reactive attributes trigger refresh; message passing between widgets is async (asyncio). A compositor (inherited from Rich's Segment model) merges overlapping widgets into a final segment list and only updates changed regions. Output drivers target terminals and, via textual-serve/textual-web, a browser.

performance

Design write-ups but no published frames/sec or update-throughput benchmarks found.

adoption and upkeep

Adoption

The dominant Python TUI framework, with very high PyPI volume and a large app ecosystem.

Used by: Toad (batrachianai/toad, 3.5k stars), Posting (HTTP client, shown in textual-serve docs), Many Python devtools and agent front ends (e.g. gentui AG-UI client)

Maintainability

Mature and stable ('mature and battle-tested' per McGugan) but now a one-person project with activity dropping off.

Releases: Frequent until mid-2026, now quiet: v8.2.3 2026-04-05, v8.2.4 04-19, v8.2.5 04-30, v8.2.6 05-13, v8.2.7 05-19, v8.2.8 06-30. Last commit to main 2026-07-11. · Contributors: ~192 (GitHub contributors API incl. anonymous) · Recent: 1 commit and 1 merged PR since 2026-07-11 (GitHub API): effectively dormant for 3 months · Bus factor: low: willmcgugan has ~7,000 of the commits; the company that employed the other core devs closed in 2025

weaknesses
and thc-scene

Overlap

Addressable widget tree (ids/selectors), stylesheet-driven theming, headless driving with keys/clicks and rendered screenshots, web serving.

What scene would be reinventing

Selector-addressed nodes, a layout/style system, screenshot readback and a headless test driver — Textual has had these, polished, for years.

The gap it leaves

A UI that is one serializable JSON value pushed/patched over a socket into a live (not test) instance, data streams bypassing the model at thousands/s, hot-swap upgrade, kitty pixel layer beneath text, agent time travel.

What to borrow

  • Pilot's verbs (press, click(selector, offset), hover, pause/wait-for-idle) as the shape of scene's key/mouse ops
  • CSS-selector addressing in addition to plain ids for patch/click
  • SVG screenshot export of the cell frame for docs and readback
  • textual serve's idea: the same scene served to a browser
sources
  1. GitHub API repos/Textualize/textual api.github.com
  2. pypistats textual pypistats.org
  3. The future of Textualize (2025-05-07) textual.textualize.io
  4. Algorithms for high performance terminal apps textual.textualize.io
  5. Textual devtools guide textual.textualize.io
  6. Towards Textual Web Applications (textual-serve) textual.textualize.io
  7. Toad released (Will McGugan) willmcgugan.github.io
  8. batrachianai/toad github.com
  9. discohead/textual-mcp-server github.com
  10. lnqs/textual-image github.com