Script and automate interactive terminal sessions for generating asciinema .cast files and reproducible demos.
Project description
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
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 asciinwriter-0.2.2.tar.gz.
File metadata
- Download URL: asciinwriter-0.2.2.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e8debae6b570d8db7d387db28919b9c6f79ab521c3a7feb66e00230011bd3a6
|
|
| MD5 |
2b5cf6badfe563bda3f3c506cb03fc29
|
|
| BLAKE2b-256 |
2a31453ca56de9d01fc6f93f01d9a38578c88332c0c8fdbff2a93c3215ceeaa1
|
Provenance
The following attestation bundles were made for asciinwriter-0.2.2.tar.gz:
Publisher:
release.yml on russoz/asciinwriter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asciinwriter-0.2.2.tar.gz -
Subject digest:
6e8debae6b570d8db7d387db28919b9c6f79ab521c3a7feb66e00230011bd3a6 - Sigstore transparency entry: 237998019
- Sigstore integration time:
-
Permalink:
russoz/asciinwriter@8aab90db906be9ba58eac480fa77679fc85b8ec6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/russoz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8aab90db906be9ba58eac480fa77679fc85b8ec6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file asciinwriter-0.2.2-py3-none-any.whl.
File metadata
- Download URL: asciinwriter-0.2.2-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5879c5175b831128e55f2844fe1fc1c66fb7ca895217654e71a20d0cfe0dd623
|
|
| MD5 |
e25d33712b8e5c4d067b21f250c0c249
|
|
| BLAKE2b-256 |
709d3755e27d6eb763f1fdc11f8fe359dcc13c78d7dc29335b398e01d320e0ee
|
Provenance
The following attestation bundles were made for asciinwriter-0.2.2-py3-none-any.whl:
Publisher:
release.yml on russoz/asciinwriter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asciinwriter-0.2.2-py3-none-any.whl -
Subject digest:
5879c5175b831128e55f2844fe1fc1c66fb7ca895217654e71a20d0cfe0dd623 - Sigstore transparency entry: 237998025
- Sigstore integration time:
-
Permalink:
russoz/asciinwriter@8aab90db906be9ba58eac480fa77679fc85b8ec6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/russoz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8aab90db906be9ba58eac480fa77679fc85b8ec6 -
Trigger Event:
workflow_dispatch
-
Statement type: