smartcli-toolkit 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/PKG-INFO +291 -246
  2. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/README.md +73 -32
  3. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/pyproject.toml +39 -1
  4. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/setup.cfg +4 -4
  5. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/__init__.py +3 -2
  6. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/pty_backend.py +41 -2
  7. smartcli_toolkit-0.1.4/smartcli_core/py.typed +0 -0
  8. smartcli_toolkit-0.1.4/smartcli_core/screen_model.py +224 -0
  9. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/session.py +31 -3
  10. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/PKG-INFO +291 -246
  11. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/SOURCES.txt +5 -1
  12. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/requires.txt +6 -0
  13. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/tests/test_degenerate_inputs.py +29 -0
  14. smartcli_toolkit-0.1.4/tests/test_doc_counts.py +134 -0
  15. smartcli_toolkit-0.1.4/tests/test_golden_frames.py +161 -0
  16. smartcli_toolkit-0.1.4/tests/test_vendor_sync.py +43 -0
  17. smartcli_toolkit-0.1.2/smartcli_core/screen_model.py +0 -132
  18. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/LICENSE +0 -0
  19. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/readiness.py +0 -0
  20. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/snapshot.py +0 -0
  21. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/dependency_links.txt +0 -0
  22. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/top_level.txt +0 -0
  23. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/tests/test_fx_contract.py +0 -0
  24. {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/tests/test_readiness.py +0 -0
@@ -1,246 +1,291 @@
1
- Metadata-Version: 2.4
2
- Name: smartcli-toolkit
3
- Version: 0.1.2
4
- Summary: Pluggable-PTY + pyte screen model + semantic snapshot / readiness core for driving interactive terminal programs (SmartCLI shared core).
5
- Author: dwgx
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/dwgx/SmartCLI
8
- Project-URL: Repository, https://github.com/dwgx/SmartCLI
9
- Project-URL: Changelog, https://github.com/dwgx/SmartCLI/blob/main/CHANGELOG.md
10
- Project-URL: Issues, https://github.com/dwgx/SmartCLI/issues
11
- Project-URL: PyPI, https://pypi.org/project/smartcli-toolkit/
12
- Keywords: terminal,tui,pty,ansi,cli,ascii-art,terminal-effects,claude-skill,pyte,conpty
13
- Classifier: Development Status :: 4 - Beta
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: 3.13
22
- Classifier: Programming Language :: Python :: 3.14
23
- Classifier: Topic :: Terminals
24
- Classifier: Topic :: Software Development :: Libraries
25
- Classifier: Environment :: Console
26
- Requires-Python: >=3.9
27
- Description-Content-Type: text/markdown
28
- License-File: LICENSE
29
- Requires-Dist: pyte>=0.8.1
30
- Requires-Dist: pywinpty>=2.0; platform_system == "Windows"
31
- Provides-Extra: art
32
- Requires-Dist: pyfiglet>=1.0.0; extra == "art"
33
- Provides-Extra: image
34
- Requires-Dist: Pillow>=10.0.0; extra == "image"
35
- Provides-Extra: width
36
- Requires-Dist: wcwidth>=0.2.0; extra == "width"
37
- Provides-Extra: all
38
- Requires-Dist: pyfiglet>=1.0.0; extra == "all"
39
- Requires-Dist: Pillow>=10.0.0; extra == "all"
40
- Requires-Dist: wcwidth>=0.2.0; extra == "all"
41
- Dynamic: license-file
42
-
43
- # SmartCLI
44
-
45
- **A local Python toolkit for driving, perceiving, and rendering the terminal — three agent skills over one pluggable PTY + `pyte` core.**
46
-
47
- [![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-blue)](https://www.python.org/)
48
- [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
49
- [![Version 0.1.0](https://img.shields.io/badge/version-0.1.0-orange)](CHANGELOG.md)
50
- [![Skills: 3](https://img.shields.io/badge/skills-3-purple)](#features)
51
- [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20POSIX-lightgrey)](#install)
52
-
53
- ## What & why
54
-
55
- SmartCLI is a workspace for terminal work that agents and humans both do: **driving**
56
- interactive terminal programs, **perceiving** what a screen actually shows, and
57
- **rendering** visuals and layouts back out. It is built on one shared, pluggable PTY
58
- backend plus a `pyte` screen model — chosen over screenshot/vision so a single
59
- structured screen model feeds both perception (read the screen) and rendering
60
- (draw the screen). The PTY layer is intentionally **not** tmux-bound: local dev runs
61
- on Windows via ConPTY (`pywinpty`), while target programs can run under POSIX ptys
62
- or tmux elsewhere. Three skills sit on that core, each a self-contained tool you run
63
- in place from the checkout.
64
-
65
- Verified on Windows 11, Python 3.14.6, `pyte` + `pywinpty` / ConPTY. This machine has
66
- no real `tmux`, so screenshot reports are honestly labelled `pyte-simulation`, not
67
- real tmux captures.
68
-
69
- ## Screenshots
70
-
71
- A small gallery of `cmd-art` effects, rendered through the `fx` engine. Reproduce any
72
- of these with `python -m fx play <name>` (see [Quickstart](#quickstart)).
73
-
74
- | | | |
75
- |:---:|:---:|:---:|
76
- | ![donut](showcase/donut.png) | ![fire](showcase/fire.png) | ![plasma](showcase/plasma.png) |
77
- | **donut** | **fire** | **plasma** |
78
- | ![rain](showcase/rain.png) | ![starfield](showcase/starfield.png) | ![tunnel](showcase/tunnel.png) |
79
- | **rain** | **starfield** | **tunnel** |
80
-
81
- ## Install
82
-
83
- SmartCLI is **not on PyPI yet** install from a source checkout. Every command below
84
- works today from a clean clone.
85
-
86
- **Primary reproduce the full dev environment** (recommended):
87
-
88
- ```bash
89
- git clone https://github.com/dwgx/SmartCLI SmartCLI
90
- cd SmartCLI
91
- python -m pip install -r requirements.txt
92
- ```
93
-
94
- `requirements.txt` pulls only the two required runtime deps: `pyte` (everywhere) and
95
- `pywinpty` (Windows only — the marker skips it on POSIX, which uses the stdlib `pty`
96
- backend).
97
-
98
- **Install the shared core package** (`smartcli_core`):
99
-
100
- ```bash
101
- pip install .
102
- ```
103
-
104
- > **Distribution vs import name:** the PyPI distribution is `smartcli-toolkit`
105
- > (the names `smartcli` / `smart-cli` were taken or blocked), but the importable
106
- > package is `smartcli_core`. So after `pip install smartcli-toolkit` you still
107
- > write `from smartcli_core import PtySession`.
108
-
109
- Honest scope note: `pip install .` installs the clean, importable `smartcli_core`
110
- package plus its required deps. It does **not** relocate the three skills — those run
111
- in place via their own entry points (`python -m fx`, `python -m ui`,
112
- `skills/drive-tui/scripts/tui.py`), exactly as the Quickstart shows. This is by design;
113
- see the note at the top of [`pyproject.toml`](pyproject.toml).
114
-
115
- **Optional extras** (real FIGlet fonts, raster images, authoritative cell widths — all
116
- degrade gracefully to stdlib fallbacks when absent):
117
-
118
- ```bash
119
- python -m pip install -r requirements-optional.txt
120
- # or, from the checkout, via pyproject extras:
121
- pip install ".[all]" # pyfiglet + Pillow + wcwidth
122
- pip install ".[art]" # pyfiglet only
123
- pip install ".[image]" # Pillow only (also: the PNG screenshot harness needs it)
124
- pip install ".[width]" # wcwidth only
125
- ```
126
-
127
- **Windows note:** set UTF-8 output before running any skill so box-drawing and CJK
128
- glyphs encode cleanly (the CLIs also auto-reconfigure stdout, but set this to be safe):
129
-
130
- ```powershell
131
- set PYTHONIOENCODING=utf-8
132
- ```
133
-
134
- Verified dep versions on the dev box (Windows 11, CPython 3.14.6): `pyte` 0.8.2,
135
- `pywinpty` 3.0.5, `pyfiglet` 1.0.4, `Pillow` 12.2.0, `wcwidth` 0.8.1.
136
-
137
- ## Quickstart
138
-
139
- ### cmd-art — terminal visual effects
140
-
141
- ```bash
142
- cd skills/cmd-art
143
- python -m fx list # list all 18 effects
144
- python -m fx play donut --seconds 5 # play one effect (bounded)
145
- python -m fx gallery # one frame of each effect
146
- python -m fx show --seq "donut:fire:3,plasma::3"
147
- ```
148
-
149
- ### tui-ui cell-accurate terminal UI
150
-
151
- ```bash
152
- cd skills/tui-ui
153
- python -m ui widgets # list all 15 widgets
154
- python -m ui gallery --width 100 --height 30
155
- python -m ui demo table --width 80 --height 12 --theme dashboard
156
- ```
157
-
158
- ### drive-tui perceive & drive interactive programs
159
-
160
- Persistent-session CLI (state survives across shell calls):
161
-
162
- ```bash
163
- python skills/drive-tui/scripts/tui.py start --cmd "python" --cols 80 --rows 24
164
- python skills/drive-tui/scripts/tui.py wait-regex --id <SID> ">>> " --timeout-ms 15000
165
- python skills/drive-tui/scripts/tui.py send-line --id <SID> "print(6*7)"
166
- python skills/drive-tui/scripts/tui.py snapshot --id <SID>
167
- python skills/drive-tui/scripts/tui.py close --id <SID>
168
- ```
169
-
170
- ### As a library
171
-
172
- The shared core is importable directly:
173
-
174
- ```python
175
- import sys
176
- from smartcli_core import PtySession
177
-
178
- s = PtySession()
179
- s.start([sys.executable, "-q"])
180
- s.wait_for(r">>> ") # readiness sync, never a blind sleep
181
- print(s.snapshot().to_text()) # pyte-backed structured screen
182
- s.close()
183
- ```
184
-
185
- For the full command reference, the screenshot/AGENTCLI harnesses, and the regression
186
- suite, see **[`README-USAGE.md`](README-USAGE.md)**.
187
-
188
- ## Features
189
-
190
- **`cmd-art`** (`skills/cmd-art`) a "living-template" effect engine: an `Effect` ABC +
191
- `@register` decorator + auto-discovery. **18 effects** (donut, fire, plasma, rain,
192
- starfield, tunnel, text3d, cube, sphere, boids, life, fireworks, sparkle, decrypt,
193
- gradient_text, banner_scroll, image2ascii, typewriter) across **8 themes** (mono, fire,
194
- ocean, synthwave, viridis, pastel, matrix-green, rainbow). Effects are pure frame
195
- producers; `play` is bounded by default and always restores the terminal.
196
-
197
- **`tui-ui`** (`skills/tui-ui`) a web-like terminal layout engine emitting tmux-safe
198
- ANSI frames (SGR color runs + newlines only; no cursor moves, no alt-screen). **15
199
- widgets** (badge, banner, braille_chart, card, gradient_rule, kv, meter, panel,
200
- progress, radial_glow, rule, slider_track, table, tabs, tree) over a real **engine**:
201
- `field.py` (shader compositors), `raster.py` (sub-cell half/quad/braille pixels),
202
- `box_junction.py` (edge-algebra box joins), `color_model.py` (honest truecolor → 256 →
203
- 16 → mono degrade). Display-cell accurate for CJK/emoji/ZWJ so columns never desync.
204
-
205
- **`drive-tui`** (`skills/drive-tui`) — drives interactive terminal programs (REPLs,
206
- menus, pagers, y/N prompts, wizards) through a PTY via a
207
- perceive decide act wait confirm loop, never a blind sleep. A thin CLI
208
- (`scripts/tui.py`) offers a persistent detached session and a one-shot `run` mode, with
209
- an importable pattern library of **8 recipes** (repl, menu_select, pager, search_filter,
210
- confirm, form, progress, wizard) that `classify()` a screen and `drive()` it.
211
-
212
- **Shared core** (`smartcli_core`) the pluggable PTY backend + `pyte` screen model +
213
- semantic snapshot + readiness sync (`pty_backend / screen_model / snapshot / readiness /
214
- session`). The reusable, importable foundation under all three skills.
215
-
216
- **Knowledge graph** (`knowledge/`) — a 122-note wiki-link graph of exact rendering
217
- formulas, ANSI sequences, and measured constants, each note carrying a source and
218
- cross-links. See [`knowledge/INDEX.md`](knowledge/INDEX.md).
219
-
220
- ## Project layout
221
-
222
- ```text
223
- SmartCLI/
224
- smartcli_core/ shared PTY + pyte engine (importable package)
225
- skills/cmd-art/ fx effect package and CLI (18 effects, 8 themes)
226
- skills/drive-tui/ TUI pattern library and PTY driver CLI (8 recipes)
227
- skills/tui-ui/ terminal UI layout engine and widgets (15 widgets)
228
- tools/screenshot/ pyte -> PNG smoke-test harness
229
- tools/agentcli/ agent-CLI control validation harness
230
- knowledge/ 122-note knowledge graph (see knowledge/INDEX.md)
231
- showcase/ rendered effect PNGs (see Screenshots)
232
- tests/ direct script-style regressions
233
- research/ archived first-pass research notes
234
- ```
235
-
236
- ## Documentation
237
-
238
- - **[`README-USAGE.md`](README-USAGE.md)** the full usage cheat-sheet: every skill,
239
- the screenshot and AGENTCLI harnesses, and the regression commands.
240
- - **[`knowledge/INDEX.md`](knowledge/INDEX.md)** the 122-note knowledge graph.
241
- - **[`AGENTCLI-VALIDATION.md`](AGENTCLI-VALIDATION.md)** — agent-CLI control test matrix.
242
- - **[`CHANGELOG.md`](CHANGELOG.md)**release history.
243
-
244
- ## License
245
-
246
- MIT see [LICENSE](LICENSE).
1
+ Metadata-Version: 2.4
2
+ Name: smartcli-toolkit
3
+ Version: 0.1.4
4
+ Summary: Pluggable-PTY + pyte screen model + semantic snapshot / readiness core for driving interactive terminal programs (SmartCLI shared core).
5
+ Author: dwgx
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/dwgx/SmartCLI
8
+ Project-URL: Repository, https://github.com/dwgx/SmartCLI
9
+ Project-URL: Changelog, https://github.com/dwgx/SmartCLI/blob/main/CHANGELOG.md
10
+ Project-URL: Issues, https://github.com/dwgx/SmartCLI/issues
11
+ Project-URL: PyPI, https://pypi.org/project/smartcli-toolkit/
12
+ Keywords: terminal,tui,pty,ansi,cli,ascii-art,terminal-effects,claude-skill,pyte,conpty
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Terminals
24
+ Classifier: Topic :: Software Development :: Libraries
25
+ Classifier: Environment :: Console
26
+ Requires-Python: >=3.9
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: pyte>=0.8.1
30
+ Requires-Dist: pywinpty>=2.0; platform_system == "Windows"
31
+ Provides-Extra: art
32
+ Requires-Dist: pyfiglet>=1.0.0; extra == "art"
33
+ Provides-Extra: image
34
+ Requires-Dist: Pillow>=10.0.0; extra == "image"
35
+ Provides-Extra: width
36
+ Requires-Dist: wcwidth>=0.2.0; extra == "width"
37
+ Provides-Extra: all
38
+ Requires-Dist: pyfiglet>=1.0.0; extra == "all"
39
+ Requires-Dist: Pillow>=10.0.0; extra == "all"
40
+ Requires-Dist: wcwidth>=0.2.0; extra == "all"
41
+ Provides-Extra: mcp
42
+ Requires-Dist: mcp>=1.0; extra == "mcp"
43
+ Provides-Extra: dev
44
+ Requires-Dist: coverage[toml]>=7.0; extra == "dev"
45
+ Dynamic: license-file
46
+
47
+ <!-- Language: English | [简体中文](docs/i18n/README.zh-Hans.md) | [繁體中文](docs/i18n/README.zh-Hant.md) | [日本語](docs/i18n/README.ja.md) | [한국어](docs/i18n/README.ko.md) -->
48
+
49
+ # SmartCLI
50
+
51
+ *Read this in: **English** · [简体中文](docs/i18n/README.zh-Hans.md) · [繁體中文](docs/i18n/README.zh-Hant.md) · [日本語](docs/i18n/README.ja.md) · [한국어](docs/i18n/README.ko.md)*
52
+
53
+ **A local Python toolkit for driving, perceiving, and rendering the terminal — three agent skills over one pluggable PTY + `pyte` core.**
54
+
55
+ [![PyPI](https://img.shields.io/pypi/v/smartcli-toolkit?color=orange)](https://pypi.org/project/smartcli-toolkit/)
56
+ [![Python](https://img.shields.io/pypi/pyversions/smartcli-toolkit?color=blue)](https://pypi.org/project/smartcli-toolkit/)
57
+ [![CI](https://github.com/dwgx/SmartCLI/actions/workflows/ci.yml/badge.svg)](https://github.com/dwgx/SmartCLI/actions/workflows/ci.yml)
58
+ [![codecov](https://codecov.io/gh/dwgx/SmartCLI/branch/main/graph/badge.svg)](https://codecov.io/gh/dwgx/SmartCLI)
59
+ [![License: MIT](https://img.shields.io/pypi/l/smartcli-toolkit?color=green)](LICENSE)
60
+ [![Downloads](https://img.shields.io/pypi/dm/smartcli-toolkit?color=blueviolet)](https://pypi.org/project/smartcli-toolkit/)
61
+ [![Skills: 3](https://img.shields.io/badge/skills-3-purple)](#features)
62
+ [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey)](#install)
63
+
64
+ ## What & why
65
+
66
+ SmartCLI is a workspace for terminal work that agents and humans both do: **driving**
67
+ interactive terminal programs, **perceiving** what a screen actually shows, and
68
+ **rendering** visuals and layouts back out. It is built on one shared, pluggable PTY
69
+ backend plus a `pyte` screen model — chosen over screenshot/vision so a single
70
+ structured screen model feeds both perception (read the screen) and rendering
71
+ (draw the screen). The PTY layer is intentionally **not** tmux-bound: local dev runs
72
+ on Windows via ConPTY (`pywinpty`), while target programs can run under POSIX ptys
73
+ or tmux elsewhere. Three skills sit on that core, each a self-contained tool you run
74
+ in place from the checkout.
75
+
76
+ ## Driving a real TUI
77
+
78
+ SmartCLI driving **lazygit** a real full-screen curses app — through its
79
+ perceive act confirm loop: it reads the `pyte` cell grid (which row is
80
+ selected, the alt-screen diff), moves with arrow keys, opens a commit's diff,
81
+ and highlights a branch. This is captured by driving the actual program in a
82
+ Linux container, not scripted or mocked. A byte-stream matcher like pexpect
83
+ can't perceive "which row is highlighted"; a screen model can.
84
+
85
+ <p align="center">
86
+ <img src="showcase/drive-lazygit.gif" alt="SmartCLI driving the real lazygit TUI: navigating panels, opening a commit diff, highlighting a branch" width="700">
87
+ </p>
88
+
89
+ > Honest scope: CI runs a Windows + Linux + macOS matrix. The POSIX pty backend
90
+ > (spawn / read / drive / resize / zombie-free terminate) is verified on Linux
91
+ > **and macOS** in CI; the interactive DECCKM/SS3-arrow probe is skipped on CI
92
+ > runners (no controllable terminal) and still wants a real-host run. Real tmux is
93
+ > not yet verified — known edges are listed in
94
+ > [`skills/drive-tui/references/LIMITATIONS.md`](skills/drive-tui/references/LIMITATIONS.md).
95
+
96
+ Verified on Windows 11, Python 3.14.6, `pyte` + `pywinpty` / ConPTY. This machine has
97
+ no real `tmux`, so screenshot reports are honestly labelled `pyte-simulation`, not
98
+ real tmux captures.
99
+
100
+ ## Live effects
101
+
102
+ Real captures of the `cmd-art` `fx` engine — each GIF is the actual effect
103
+ rendered frame-by-frame through the project's own pipeline (no screen recorder).
104
+ Reproduce any with `python -m fx play <name>` (see [Quickstart](#quickstart)).
105
+
106
+ <p align="center">
107
+ <img src="showcase/fx-solarsystem.gif" alt="ASCII solar system orrery — planets orbiting a pulsing sun" width="620"><br>
108
+ <sub><b>solarsystem</b> — an orrery: planets on elliptical orbits around a pulsing sun</sub>
109
+ </p>
110
+
111
+ | | | |
112
+ |:---:|:---:|:---:|
113
+ | ![donut](showcase/fx-donut.gif) | ![fire](showcase/fx-fire.gif) | ![rain](showcase/fx-rain.gif) |
114
+ | **donut** — the classic ASCII torus | **fire** — demoscene heat field | **rain** — Matrix digital rain |
115
+
116
+ > 🌐 **[Explore the live showcase →](https://dwgx.github.io/SmartCLI/)** — play with
117
+ > the effect engine, drive a menu with arrow keys, and poke the widgets, right in
118
+ > your browser.
119
+
120
+ ## Install
121
+
122
+ **Primary from PyPI:**
123
+
124
+ ```bash
125
+ pip install smartcli-toolkit
126
+ ```
127
+
128
+ > **Distribution vs import name:** the PyPI distribution is `smartcli-toolkit`
129
+ > (the names `smartcli` / `smart-cli` were taken or blocked), but the importable
130
+ > package is `smartcli_core`. So after `pip install smartcli-toolkit` you still
131
+ > write `from smartcli_core import PtySession`.
132
+
133
+ **Alternative — reproduce the full dev environment from a source checkout:**
134
+
135
+ ```bash
136
+ git clone https://github.com/dwgx/SmartCLI SmartCLI
137
+ cd SmartCLI
138
+ python -m pip install -r requirements.txt
139
+ ```
140
+
141
+ `requirements.txt` pulls only the two required runtime deps: `pyte` (everywhere) and
142
+ `pywinpty` (Windows only — the marker skips it on POSIX, which uses the stdlib `pty`
143
+ backend). From the checkout, `pip install .` installs the same importable
144
+ `smartcli_core` package.
145
+
146
+ Honest scope note: `pip install smartcli-toolkit` installs the clean, importable `smartcli_core`
147
+ package plus its required deps. It does **not** relocate the three skills — those run
148
+ in place via their own entry points (`python -m fx`, `python -m ui`,
149
+ `skills/drive-tui/scripts/tui.py`), exactly as the Quickstart shows. This is by design;
150
+ see the note at the top of [`pyproject.toml`](pyproject.toml).
151
+
152
+ **Optional extras** (real FIGlet fonts, raster images, authoritative cell widths — all
153
+ degrade gracefully to stdlib fallbacks when absent):
154
+
155
+ ```bash
156
+ python -m pip install -r requirements-optional.txt
157
+ # or, from the checkout, via pyproject extras:
158
+ pip install ".[all]" # pyfiglet + Pillow + wcwidth
159
+ pip install ".[art]" # pyfiglet only
160
+ pip install ".[image]" # Pillow only (also: the PNG screenshot harness needs it)
161
+ pip install ".[width]" # wcwidth only
162
+ ```
163
+
164
+ **Windows note:** set UTF-8 output before running any skill so box-drawing and CJK
165
+ glyphs encode cleanly (the CLIs also auto-reconfigure stdout, but set this to be safe):
166
+
167
+ ```powershell
168
+ set PYTHONIOENCODING=utf-8
169
+ ```
170
+
171
+ Verified dep versions on the dev box (Windows 11, CPython 3.14.6): `pyte` 0.8.2,
172
+ `pywinpty` 3.0.5, `pyfiglet` 1.0.4, `Pillow` 12.2.0, `wcwidth` 0.8.1.
173
+
174
+ ## Quickstart
175
+
176
+ ### cmd-art terminal visual effects
177
+
178
+ ```bash
179
+ cd skills/cmd-art
180
+ python -m fx list # list all 19 effects
181
+ python -m fx play donut --seconds 5 # play one effect (bounded)
182
+ python -m fx gallery # one frame of each effect
183
+ python -m fx show --seq "donut:fire:3,plasma::3"
184
+ ```
185
+
186
+ ### tui-ui — cell-accurate terminal UI
187
+
188
+ ```bash
189
+ cd skills/tui-ui
190
+ python -m ui widgets # list all 15 widgets
191
+ python -m ui gallery --width 100 --height 30
192
+ python -m ui demo table --width 80 --height 12 --theme dashboard
193
+ ```
194
+
195
+ ### drive-tui perceive & drive interactive programs
196
+
197
+ Persistent-session CLI (state survives across shell calls):
198
+
199
+ ```bash
200
+ python skills/drive-tui/scripts/tui.py start --cmd "python" --cols 80 --rows 24
201
+ python skills/drive-tui/scripts/tui.py wait-regex --id <SID> ">>> " --timeout-ms 15000
202
+ python skills/drive-tui/scripts/tui.py send-line --id <SID> "print(6*7)"
203
+ python skills/drive-tui/scripts/tui.py snapshot --id <SID>
204
+ python skills/drive-tui/scripts/tui.py close --id <SID>
205
+ ```
206
+
207
+ Or drive from any MCP client the same verbs as MCP tools, with the
208
+ per-session token attached automatically:
209
+
210
+ ```bash
211
+ pip install "smartcli-toolkit[mcp]"
212
+ python skills/drive-tui/scripts/mcp_server.py # stdio MCP server
213
+ ```
214
+
215
+ ### As a library
216
+
217
+ The shared core is importable directly:
218
+
219
+ ```python
220
+ import sys
221
+ from smartcli_core import PtySession
222
+
223
+ s = PtySession()
224
+ s.start([sys.executable, "-q"])
225
+ s.wait_for(r">>> ") # readiness sync, never a blind sleep
226
+ print(s.snapshot().to_text()) # pyte-backed structured screen
227
+ s.close()
228
+ ```
229
+
230
+ For the full command reference, the screenshot/AGENTCLI harnesses, and the regression
231
+ suite, see **[`README-USAGE.md`](README-USAGE.md)**.
232
+
233
+ ## Features
234
+
235
+ **`cmd-art`** (`skills/cmd-art`) — a "living-template" effect engine: an `Effect` ABC +
236
+ `@register` decorator + auto-discovery. **19 effects** (donut, solarsystem, fire, plasma,
237
+ rain, starfield, tunnel, text3d, cube, sphere, boids, life, fireworks, sparkle, decrypt,
238
+ gradient_text, banner_scroll, image2ascii, typewriter) across **8 themes** (mono, fire,
239
+ ocean, synthwave, viridis, pastel, matrix-green, rainbow). Effects are pure frame
240
+ producers; `play` is bounded by default and always restores the terminal.
241
+
242
+ **`tui-ui`** (`skills/tui-ui`) — a web-like terminal layout engine emitting tmux-safe
243
+ ANSI frames (SGR color runs + newlines only; no cursor moves, no alt-screen). **15
244
+ widgets** (badge, banner, braille_chart, card, gradient_rule, kv, meter, panel,
245
+ progress, radial_glow, rule, slider_track, table, tabs, tree) over a real **engine**:
246
+ `field.py` (shader compositors), `raster.py` (sub-cell half/quad/braille pixels),
247
+ `box_junction.py` (edge-algebra box joins), `color_model.py` (honest truecolor → 256 →
248
+ 16 → mono degrade). Display-cell accurate for CJK/emoji/ZWJ so columns never desync.
249
+
250
+ **`drive-tui`** (`skills/drive-tui`) — drives interactive terminal programs (REPLs,
251
+ menus, pagers, y/N prompts, wizards) through a PTY via a
252
+ perceive → decide → act → wait → confirm loop, never a blind sleep. A thin CLI
253
+ (`scripts/tui.py`) offers a persistent detached session and a one-shot `run` mode, with
254
+ an importable pattern library of **8 recipes** (repl, menu_select, pager, search_filter,
255
+ confirm, form, progress, wizard) that `classify()` a screen and `drive()` it.
256
+
257
+ **Shared core** (`smartcli_core`) — the pluggable PTY backend + `pyte` screen model +
258
+ semantic snapshot + readiness sync (`pty_backend / screen_model / snapshot / readiness /
259
+ session`). The reusable, importable foundation under all three skills.
260
+
261
+ **Knowledge graph** (`knowledge/`) — a 122-note wiki-link graph of exact rendering
262
+ formulas, ANSI sequences, and measured constants, each note carrying a source and
263
+ cross-links. See [`knowledge/INDEX.md`](knowledge/INDEX.md).
264
+
265
+ ## Project layout
266
+
267
+ ```text
268
+ SmartCLI/
269
+ smartcli_core/ shared PTY + pyte engine (importable package)
270
+ skills/cmd-art/ fx effect package and CLI (19 effects, 8 themes)
271
+ skills/drive-tui/ TUI pattern library and PTY driver CLI (8 recipes)
272
+ skills/tui-ui/ terminal UI layout engine and widgets (15 widgets)
273
+ tools/screenshot/ pyte -> PNG smoke-test harness
274
+ tools/agentcli/ agent-CLI control validation harness
275
+ knowledge/ 122-note knowledge graph (see knowledge/INDEX.md)
276
+ showcase/ rendered effect PNGs + demo GIFs (shown above)
277
+ tests/ direct script-style regressions
278
+ research/ archived first-pass research notes
279
+ ```
280
+
281
+ ## Documentation
282
+
283
+ - **[`README-USAGE.md`](README-USAGE.md)** — the full usage cheat-sheet: every skill,
284
+ the screenshot and AGENTCLI harnesses, and the regression commands.
285
+ - **[`knowledge/INDEX.md`](knowledge/INDEX.md)** — the 122-note knowledge graph.
286
+ - **[`AGENTCLI-VALIDATION.md`](AGENTCLI-VALIDATION.md)** — agent-CLI control test matrix.
287
+ - **[`CHANGELOG.md`](CHANGELOG.md)** — release history.
288
+
289
+ ## License
290
+
291
+ MIT — see [LICENSE](LICENSE).