textual-serve
Turn your Textual TUIs in to web applications
What it is and what it does
textual-serve bridges terminal user interfaces (TUIs) built with Textual into web browsers. Instead of running a Textual app only in a terminal, you wrap it in a Server instance and call serve() to launch an HTTP server that spawns the app in a subprocess and streams its UI to the browser via WebSocket. The communication uses a custom protocol designed to prevent arbitrary shell access—users can only interact with the app as its author intended.
The package is built on aiohttp for the web server, jinja2 for HTML templating, and rich for terminal rendering. It supports configuration of host, port, title, and paths to static assets and templates. Multiple instances can run across available CPUs. This is useful for sharing terminal tools with non-terminal users, adding a web interface to existing CLI applications, or running TUIs in restricted environments where terminal access is unavailable.
Use it for:
- Share a terminal-based tool (e.g., a log viewer or system monitor) with team members via a web link without requiring terminal access.
- Add a web UI to an existing Textual application with minimal code changes—three lines to wrap and serve.
- Run a Textual app in an environment where SSH or terminal access is blocked or impractical.
- Prototype or demo a TUI to users who are unfamiliar with terminal interfaces.
- Serve multiple instances of the same Textual app across CPU cores for concurrent users.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Runs any Textual terminal application in a web browser by wrapping it in a lightweight HTTP server that communicates with the app via WebSocket.
Yes, if you have a Textual application and want to expose it to web users with minimal code. The low install friction, permissive license, and straightforward API make it a practical choice. However, be aware the project is aging (286 days since last release) and maintenance may be slower; evaluate whether the WebSocket latency and subprocess overhead are acceptable for your use case before deploying to production.
Install
textual-serve on PyPI
pip
pip install textual-serveuv
uv add textual-servepoetry
poetry add textual-serveInstalling textual-serve
Before you install
Low friction—pure Python wheel with five runtime dependencies (aiohttp, aiohttp-jinja2, jinja2, rich, textual). Maintenance status is aging; last commit was 2025-11-01 and the package is 286 days past its latest release, so expect slower response to issues.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install textual-serve
from textual_serve.server import Server
server = Server("python -m textual")
server.serve()
Requires Textual to be installed and a valid shell command that launches a Textual app; server runs on localhost:8000 by default.
Verify before relying
- Whether the WebSocket protocol overhead is acceptable for latency-sensitive terminal interactions.
- Whether subprocess isolation scales well under concurrent browser connections.
- Production deployment guidance and recommended proxy/load-balancing setup.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — aiohttp, aiohttp-jinja2, jinja2, rich, textual |
| Maintenance | aging — 286 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,362,501/month — #4,001 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: textual_serve-1.1.3-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
textual-devtextual-dev provides a command-line tool for…
permissive · top 15,000 on PyPI
trogonTrogon auto-generates a terminal user interface…
permissive · top 15,000 on PyPI
textual-imageRenders images directly in terminal emulators…
copyleft · top 15,000 on PyPI
textual-plotextWraps the Plotext plotting library as a Textual…
permissive · top 15,000 on PyPI
textual-autocompleteAdds fuzzy-matching autocomplete dropdowns to…
permissive · top 15,000 on PyPI
richRich renders styled text, tables, progress…
permissive · top 100 on PyPI
pytest-textual-snapshotA pytest plugin that captures SVG screenshots…
permissive · top 15,000 on PyPI
terminadoTerminado provides a Tornado websocket backend…
permissive · top 1,000 on PyPI
statusA command-line tool that reports HTTP response…
permissive · top 15,000 on PyPI