castwright 0.0.1-alpha.3

Scripted terminal recording.
Documentation

CastWright

[!WARNING] This project is still in the early stages of development, with some core features missing or incomplete. Please refer to the TODO section for more information.

🎥 Scripted terminal recording.

Introduction

[!NOTE] The name castwright is a portmanteau of asciicast and playwright.

Have you re-recorded the same session over and over again, either to hit the right speed or to avoid mistakes? Ever wanted to automate the process of recording terminal sessions, like shell scripts automate the process of running commands? Well, CastWright is here to help.

Features

  • Painless scripting: CastWright scripts are very intuitive and similar to an interactive shell, making it easy to understand, write, and maintain.

Installation

TBD

Usage

Command Line Interface

Usage: castwright [-i <input>] [-o <output>] [-x]

🎥 Scripted terminal recording.

Options:
  -i, --input       the path to the input file (CastWright script `.cwrt`), or
                    stdin if not provided
  -o, --output      the path to the output file (asciicast `.cast`), or stdout
                    if not provided
  -x, --execute     execute and capture the output of shell commands, instead of
                    using dummy output (not implemented)
  -h, --help        display usage information

CastWright Script

A CastWright script is a text file, conventionally with the .cwrt extension. It is line-based, with each line representing a single instruction. For example:

$ echo "Hello, World!"

Would output an asciicast recording of the following:

$ echo "Hello, World!"
Hello, World!

For multiline commands, use the > prefix and \ suffix, as you would in an interactive shell. For example:

$ echo "Multi-" \
> "line" \
> "command"

Would output an asciicast recording of the following:

$ echo "Multi-" \
> "line" \
> "command"
Multi- line command

In addition, CastWright provides various instructions for customizing the produced asciicast, like typing speed or title. See REFERENCE.md for a detailed reference, or example CastWright scripts under the tests directory.

TODO

  • Implement the CastWright script parser.
  • Write to an asciicast file.
  • Terminal width and height detection.
  • Better pub API.
  • Run cargo clippy.
  • Integration tests.
  • Actual command execution and output capture.

Credits