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.
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/PKG-INFO +291 -246
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/README.md +73 -32
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/pyproject.toml +39 -1
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/setup.cfg +4 -4
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/__init__.py +3 -2
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/pty_backend.py +41 -2
- smartcli_toolkit-0.1.4/smartcli_core/py.typed +0 -0
- smartcli_toolkit-0.1.4/smartcli_core/screen_model.py +224 -0
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/session.py +31 -3
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/PKG-INFO +291 -246
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/SOURCES.txt +5 -1
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/requires.txt +6 -0
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/tests/test_degenerate_inputs.py +29 -0
- smartcli_toolkit-0.1.4/tests/test_doc_counts.py +134 -0
- smartcli_toolkit-0.1.4/tests/test_golden_frames.py +161 -0
- smartcli_toolkit-0.1.4/tests/test_vendor_sync.py +43 -0
- smartcli_toolkit-0.1.2/smartcli_core/screen_model.py +0 -132
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/LICENSE +0 -0
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/readiness.py +0 -0
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_core/snapshot.py +0 -0
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/dependency_links.txt +0 -0
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/smartcli_toolkit.egg-info/top_level.txt +0 -0
- {smartcli_toolkit-0.1.2 → smartcli_toolkit-0.1.4}/tests/test_fx_contract.py +0 -0
- {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.
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
[
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
[
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
`
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
+
[](https://pypi.org/project/smartcli-toolkit/)
|
|
56
|
+
[](https://pypi.org/project/smartcli-toolkit/)
|
|
57
|
+
[](https://github.com/dwgx/SmartCLI/actions/workflows/ci.yml)
|
|
58
|
+
[](https://codecov.io/gh/dwgx/SmartCLI)
|
|
59
|
+
[](LICENSE)
|
|
60
|
+
[](https://pypi.org/project/smartcli-toolkit/)
|
|
61
|
+
[](#features)
|
|
62
|
+
[](#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
|
+
|  |  |  |
|
|
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).
|