Drive interactive terminal programs (TUIs, REPLs, menus) through a PTY: perceive, send keys, wait.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Read this in: English ยท ็ฎไฝไธญๆ ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
A local Python toolkit for driving, perceiving, and rendering the terminal โ three agent skills over one pluggable PTY + pyte core.
Let an AI drive, perceive, and render real terminal programs. SmartCLI reads
the actual screen with a pyte cell model โ not a byte pipe โ so it knows which
menu row is highlighted, presses the right keys, and waits for the screen to
settle. Below: it drives the real lazygit TUI end-to-end (arrow-key
navigation, opening a commit diff, highlighting a branch) โ no script, no mock.
Requires Python 3.10 or newer. The install includes the shared Python library, the persistent TUI driver, and the stdio MCP server.
Copy-paste this. It starts a real Python REPL under a PTY, waits for the prompt
(never a blind sleep), types into it, and reads the screen back:
On Windows use --cmd "py -i -q". Swap the command for vim, htop or
lazygit and the same five verbs drive those too โ that is the whole point:
wait-regex and friends react to what the screen actually shows, so an agent
never guesses whether its keystroke landed.
Want the same thing against a real editor, end to end and verifiable?
examples/drive_vim.py drives the actual vim binary โ
opens a file, appends a line, saves, and then checks the filesystem, not the
screen:
Note the fourth step. It is there because the example itself once sent five
keystrokes back to back with nothing between them, and under load vim had not
processed G by the time o arrived, so nothing was inserted and the run failed
with no useful diagnosis. Confirming insert mode proves both keys landed โ the
same discipline the tool exists to provide, applied to its own demo.
Run the same file against smartcli-toolkit==0.1.8 and two steps fail โ and the
file is never saved, because a driver that cannot see the alternate screen
mistimes the :wq. That is why the emulation work below matters: a wrong screen
model does not error, it silently succeeds at nothing.
Already running an MCP client (Claude Code, Cursor, VS Code)? The same verbs are MCP tools, with the per-session token attached for you:
SmartCLI is a workspace for terminal work that agents and humans both do: driving
interactive terminal programs, perceiving what a screen actually shows, and
rendering visuals and layouts back out. It is built on one shared, pluggable PTY
backend plus a pyte screen model โ chosen over screenshot/vision so a single
structured screen model feeds both perception (read the screen) and rendering
(draw the screen). The PTY layer is intentionally not tmux-bound: local dev runs
on Windows via ConPTY (pywinpty), while target programs can run under POSIX ptys
or tmux elsewhere. Three skills sit on that core, each a self-contained tool you run
in place from the checkout.
The demo above is SmartCLI driving lazygit โ a real full-screen curses app โ
through its perceive โ act โ confirm loop: it reads the pyte cell grid (which
row is selected, the alt-screen diff), moves with arrow keys, opens a commit's
diff, and highlights a branch. Captured by driving the actual program in a Linux
container, not scripted or mocked. A byte-stream matcher like pexpect can't
perceive "which row is highlighted"; a screen model can.
How we know the perception is right. A screen model is only useful if it
matches what a real terminal shows, so we measure that instead of asserting it:
identical bytes go to a real tmux pane and to our model, and the two cell
grids are diffed. Three suites do it โ 35 curated cases, a three-way check that
only trusts a behaviour when tmux and GNU screen agree, and a generative
fuzz over random VT sequences. That campaign found and fixed 12 emulation bugs,
including the alternate screen buffer (pyte implements none of modes
1049/1047/47, so a full-screen program's output used to be painted over the main
screen and never restored). Scope and remaining edges:
LIMITATIONS.md.
Real captures of the cmd-art fx engine โ each GIF is the actual effect
rendered frame-by-frame through the project's own pipeline (no screen recorder).
Reproduce any with python -m fx play <name> (see Quickstart).

solarsystem โ an orrery: planets on elliptical orbits around a pulsing sun
![]() | ![]() | ![]() |
| donut โ the classic ASCII torus | fire โ demoscene heat field | rain โ Matrix digital rain |
๐ Explore the live showcase โ โ play with the effect engine, drive a menu with arrow keys, and poke the widgets, right in your browser.
Just want the three Claude Code skills? Download one zip, unzip it, done โ no git, no pip, no marketplace:
That gives you cmd-art, drive-tui and tui-ui (309 KiB total). cmd-art and
tui-ui then work with nothing but CPython 3.10+ โ verified on a bare virtualenv,
all 30 effects and all 17 widgets load. drive-tui additionally needs pyte, which
the PyPI install below provides. Or install all three via the plugin marketplace:
/plugin marketplace add dwgx/SmartCLI.
Primary โ from PyPI (the library, the CLI, and the MCP server):
Distribution vs import name: the PyPI distribution is
smartcli-toolkit(the namessmartcli/smart-cliwere taken or blocked), but the importable package issmartcli_core. So afterpip install smartcli-toolkityou still writefrom smartcli_core import PtySession.
Alternative โ reproduce the full dev environment from a source checkout:
requirements.txt installs pyte, the MCP SDK, and pywinpty on Windows only
(POSIX uses the stdlib pty backend). pip install . installs smartcli_core
plus the smartcli-tui, smartcli-mcp, and smartcli-toolkit commands. The
visual cmd-art and tui-ui skills still run in place from a checkout via
python -m fx and python -m ui.
Optional extras (real FIGlet fonts, raster images, authoritative cell widths โ all degrade gracefully to stdlib fallbacks when absent):
Windows note: set UTF-8 output before running any skill so box-drawing and CJK glyphs encode cleanly (the CLIs also auto-reconfigure stdout, but set this to be safe):
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/smartcli-drive-tui)<a href="https://allmcps.com/mcp/smartcli-drive-tui"><img src="https://allmcps.com/api/badge/smartcli-drive-tui?style=directory" alt="SmartCLI drive Tui on AllMCPs" /></a>