ai> drive the agent CLI, navigate its menu, confirm the result

Drive any terminal
program as a human.

A person tells an AI what to do. But menus, spinners, password fields, and agent CLIs are invisible to a plain pipe. SmartCLI lets the model perceive the screen, press keys, and confirm the result — the way a human would.

pip install smartcli-toolkit  ·  Windows · POSIX  ·  MIT
SmartCLI driving an agent CLI TUI
The problem

Your AI is blind in the terminal.

Pipe a fullscreen program and you get nothing, or a hang. Drive it through SmartCLI and the model reads a semantic snapshot, moves with arrow keys, and verifies every step.

  plain subprocess / pipe
$ agent-cli | cat (waiting…) nothing. the TUI needs a real terminal — it never draws, or it just hangs. no menu. no arrows. no cursor.
  drive-tui — perceive → act
[screen 30x100] cursor=r25c6 [stable] ╭─────────────────────────╮ Agent CLI Beta 0.2 New worktree ctrl+w ╰─────────────────────────╯ keys: Down Down model tier: low · switched
✗ blind & hung  →  ✓ perceived, driven, confirmed
Three skills, one core

Drive. Design. Render.

Each skill is a self-contained tool over one pluggable PTY + pyte screen model.

DRIVE-TUI

Drive interactive TUIs

perceive → decide → act → wait → confirm. Reads semantic screen snapshots, never a blind sleep. Classifies a screen and drives it.

8 recipes · repl · menu · pager · form · wizard
CMD-ART

Terminal visual effects

A living-template fx engine: pure frame producers, auto-discovered, themeable, truecolor. Bounded play loop.

19 effects · 8 themes · donut · solarsystem · fire
TUI-UI

Cell-accurate UIs

A web-like layout engine emitting tmux-safe ANSI frames. CSS box model, flex/grid, CJK-accurate so columns never desync.

15 widgets · panel · table · meter · chart
Try it — no install

Play with the actual engine.

These run the same primitives the skills ship — live, in your browser. Poke them.

CMD-ART
A pure frame producer, 30fps — the fx engine idea.
TUI-UI drag the slider
progress62%
cpu
latency
1/8-cell precision bars & braille — no desync.
DRIVE-TUI · live Claude Code menu ↑↓ navigate · Enter/→ open · Esc/← back · 1–9 jump
A real Claude Code menu, captured from the live CLI with drive-tui — navigate it the way the AI does.
Proof — driving a real TUI

Driving lazygit, for real.

SmartCLI driving the actual lazygit TUI through its perceive → act → confirm loop — navigating panels with arrow keys, opening a commit's diff, highlighting a branch — all by reading the pyte cell grid (which row is selected, the alt-screen). Captured by driving the real program in a Linux container, not scripted. A byte-stream matcher like pexpect can't perceive "which row is highlighted"; a screen model can.

drive-tui driving the real lazygit TUI on Debian 13 — perceive → act → confirm (30fps)
dialog — a checklist form: move, toggle rows with Space, submit
vim — modal editing: insert, type, Esc, :wq
htop — tree view, open the sort menu, apply
ncdu — descend into the biggest dir, back out

Every clip is SmartCLI driving the real program — reading the pyte screen grid and pressing keys, not scripted output. A byte-stream matcher like pexpect can't perceive "which row is highlighted"; a screen model can.

One API · three OSes

The same driver. Windows, macOS, Linux.

The genuinely hard, defensible part: one library drives the same real lazygit through the same perceive → act → confirm loop on all three platforms — native ConPTY on Windows, the BSD pty on macOS, and the Linux pty — with adaptive DECCKM/SS3 arrows on each. No WSL, no Cygwin. Each clip below was driven for real on that OS.

Windows — ConPTY (pywinpty)
macOS — BSD pty (Apple Silicon)
Linux — pty.fork()

Windows drove lazygit 0.63 under ConPTY; macOS drove it on an Apple-Silicon M-series over the BSD pty (the DECCKM/SS3 arrow path verified against real ncurses there); Linux via the stdlib pty.fork(). Same scripts/tui.py, same recipes, three OSes.

Real captures

The fx engine, actually running.

Every clip below is the real effect rendered frame-by-frame through the project's own pipeline — no screen recorder. Reproduce any with python -m fx play <name>.

solarsystem — an orrery: planets on Keplerian elliptical orbits around a pulsing sun (60fps)
donut — the classic ASCII torus
tunnel — demoscene fly-through (seamless loop)
fire — heat-buffer flame field
rain — Matrix digital rain
Model-agnostic

Any AI, in any agent CLI.

SmartCLI is a tool the model calls — it works with whatever model is driving, inside whatever agent CLI you run.

Claude Sonnet · Opus · Fable GPT-5.6 · 5.5 Grok 4.5
codexclaude-code grokkiro-cli gemini-cliaider
Get started

Unzip, drop it in, it works.

The core installs from PyPI; the skills run in place. A dropped-in drive-tui folder even carries its own core.

# the shared core, from PyPI pip install smartcli-toolkit # then, in Python from smartcli_core import PtySession # or check a dropped-in skill folder is wired up python skills/drive-tui/scripts/tui.py doctor