Record animated GIFs of Textual terminal apps
Project description
tapegif
Record animated GIFs of Textual terminal apps.
pip install tapegif
tapegif record myapp.py --tape demo.tape --output demo.gif
No screen capture. No window focus tricks. Drives your app headlessly via Textual's Pilot API, renders each SVG frame through a real browser (Playwright), assembles with Pillow. Works in CI. Same GIF every run. Works on Windows, macOS, Linux.
install
pip install tapegif
playwright install chromium
quick start
1. Scaffold a tape file:
tapegif init
This writes a demo.tape in the current directory. Edit it to match your app.
2. Record:
tapegif record path/to/yourapp.py --tape demo.tape
Outputs demo.gif by default.
tape format
size: [120, 30] # terminal cols × rows
gif_width: 900 # output GIF width in pixels
app_args: {} # kwargs passed to your App constructor
steps:
- sleep: 3.0 # wait for app to load
capture: 2000 # snapshot and hold this frame 2s in the GIF
- press: a # press a key
sleep: 0.4
capture: 1200
- type: "hello" # type a string
sleep: 0.5
capture: 1000
- press: enter
sleep: 0.2
capture: 800
Each step can have:
press— a single key name (a,space,enter,ctrl+c, etc.)type— a string to type character by charactersleep— seconds to wait after the actioncapture— take a snapshot and hold it this many ms in the output GIF
Steps without capture perform their action without recording a frame.
passing constructor args
app_args:
root: /home/user/projects
older_than: 30
min_size_mb: 10
CLI reference
tapegif record APP [--tape FILE] [--output FILE] [--width PX]
tapegif init [--output FILE]
APP is path/to/file.py (auto-discovers the App class) or path/to/file.py:ClassName (explicit).
requirements
- Python 3.10+
- Textual 0.80+
- Playwright (Chromium)
- Pillow
license
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tapegif-0.1.1.tar.gz.
File metadata
- Download URL: tapegif-0.1.1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
341638d6a3b32a9cd3bdb63656d15d73fe8c242feb0bc16357f9af6f10885ce8
|
|
| MD5 |
924a4d4c7318d9cbbe46adeabc2e1ef2
|
|
| BLAKE2b-256 |
3051fe3d0b43adba1bdb4437e892d99d1a5bff78a85e49d669d52a24d6fffe0e
|
File details
Details for the file tapegif-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tapegif-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d00e4711d4c0e3da64ad909220ba2abba0e0872f4a829322a4ee7c985eeeb3a1
|
|
| MD5 |
2ccddba4e0ee37491ced74e1630d905c
|
|
| BLAKE2b-256 |
54e3cf8249167d0198accea956075e87bc7bff52c447a5fbc2f5e01256574782
|