Skip to main content

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 .cast files 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

License

GPL-3.0-or-later License. See LICENSES/GPL-3.0-or-later.txt for details.

Author

(C) 2025 Alexei Znamensky

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asciinwriter-0.2.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asciinwriter-0.2.2-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

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

Hashes for asciinwriter-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6e8debae6b570d8db7d387db28919b9c6f79ab521c3a7feb66e00230011bd3a6
MD5 2b5cf6badfe563bda3f3c506cb03fc29
BLAKE2b-256 2a31453ca56de9d01fc6f93f01d9a38578c88332c0c8fdbff2a93c3215ceeaa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciinwriter-0.2.2.tar.gz:

Publisher: release.yml on russoz/asciinwriter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for asciinwriter-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5879c5175b831128e55f2844fe1fc1c66fb7ca895217654e71a20d0cfe0dd623
MD5 e25d33712b8e5c4d067b21f250c0c249
BLAKE2b-256 709d3755e27d6eb763f1fdc11f8fe359dcc13c78d7dc29335b398e01d320e0ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciinwriter-0.2.2-py3-none-any.whl:

Publisher: release.yml on russoz/asciinwriter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page