Asciinwriter
Asciinwriter is a CLI tool for scripting and automating interactive terminal sessions, primarily designed to generate asciinema .cast files for demos, documentation, and automated testing. It simulates human-like typing and command execution, making it ideal for producing realistic terminal recordings and GIFs.
Purpose
- Automate terminal interactions for reproducible demos and documentation
- Generate
.castfiles for use with asciinema and conversion to GIFs - Script complex shell sessions with SEND/EXPECT primitives
- Useful for CI, documentation, and teaching
Quick Start
Install dependencies (requires Python 3.11+):
pipx install asciinwriter
Prepare a script file (e.g., demo.scene):
SEND(echo Hello, world!)
ENTER()
EXPECT(Hello, world!)
Run the script and record a cast:
export SCENE_FILE=demo.scene
asciinema rec demo.cast -c asciinwriter
You can then convert the .cast to a GIF using agg or similar tools.
Usage
Asciinwriter reads commands from a scene file specified by the SCENE_FILE environment variable. The file should contain lines like:
SEND(...)sends text to the shell.ENTER()sends the Enter key to the shell.EXPECT(...)waits for the given output.DELAY(...)pause the typing for a specified period.
Development
- Source code:
src/asciinwriter - Tests:
tests/ - Build:
poetry build - Lint:
poetry run flake8 src/asciinwriter
License
GPL-3.0-or-later License. See LICENSES/GPL-3.0-or-later.txt for details.
Author
(C) 2025 Alexei Znamensky
Metadata
Release files for asciinwriter 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asciinwriter-0.2.2.tar.gz | 16.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asciinwriter-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.1 kB
Release files / asciinwriter-0.2.2.tar.gz
| Download URL | asciinwriter-0.2.2.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e8debae6b570d8db7d387db28919b9c6f79ab521c3a7feb66e00230011bd3a6
|
|
BLAKE2b-256 checksum How to use checksums |
2a31453ca56de9d01fc6f93f01d9a38578c88332c0c8fdbff2a93c3215ceeaa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 14, 2025.
Transparency logRelease files / asciinwriter-0.2.2-py3-none-any.whl
| Download URL | asciinwriter-0.2.2-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5879c5175b831128e55f2844fe1fc1c66fb7ca895217654e71a20d0cfe0dd623
|
|
BLAKE2b-256 checksum How to use checksums |
709d3755e27d6eb763f1fdc11f8fe359dcc13c78d7dc29335b398e01d320e0ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 14, 2025.
Transparency log