Testing the new Rust version of the asciinema CLI

Next major version of the asciinema CLI is a rewrite in Rust, and since this is a new codebase, we need to test it thoroughly on many systems and environments. It’s still in a work-in-progress shape, but reports of successful/failed builds are appreciated.

To build the binary first install the Rust toolchain - there are many ways, but the easiest one is to use https://rustup.rs.

Then install with:

cargo install --git https://github.com/asciinema/asciinema --branch develop

The above will fetch the source code, build the binary, and install it in $HOME/.cargo/bin directory.

Record with:

~/.cargo/bin/asciinema rec demo.cast

Or, if your $PATH includes $HOME/.cargo/bin:

asciinema rec demo.cast

If you prefer to have the source code checkout at hand (e.g. to hack on it), you can build the binary in the cloned repo:

git clone https://github.com/asciinema/asciinema.git
cd asciinema
git switch develop
cargo build --release

This will produce a release mode (optimized) binary at target/release/asciinema.

Run it as:

target/release/asciinema <subcommand> <args..>

So far I tested it on Arch Linux (ARM_64) and NixOS (x86_64).

2 Likes

I just build from develop and tested recording and playing a cast.

Using it on an Apple M2 and it works flawlessly. I used asciinema rec -i 1 -c "tmux attach" ~/Desktop/demo.cast and played around within tmux to try different things where I thought it would be visible to see issues when playing back (colors, control character things etc.) but it just worked.

For one moment the tmux prompt line at the bottom disappeared but then appeared again after a second (probably redrawing?). I will try to reproduce it. All in all really nice :slight_smile:

Are there any things you would like to see tested?

Great, thanks for that.

You can also test recording to a text file with asciinema rec demo.txt, or converting an existing cast file to text with asciinema convert.

Also, have you tried uploading a recording? Does the new flow with the prompt for the server URL feel ok?

I just tried asciinema rec -i 1 --overwrite -c "tmux" ~/Desktop/demo.cast and then asciinema convert --format txt ~/Desktop/demo.cast ~/Desktop/demo.txt.
It took me a while to realize that must be because it doesn’t have other commands to convert than the “tmux” one and it is not seeing things from the tmux session.

Recording and converting from a normal shell works as expected! + uploading too
I also just created an account on asciinema.org – the fact that my previous recorded video was assigned to my account was such a nice surprise :sparkles:

All in all it works really well :slight_smile:

1 Like

Glad to hear that. Thanks for testing again.

So the new version seems to compile and work fine on Linux and macOS (Apple Silicon). If someone has FreeBSD system at hand and can test there that would be lovely.

Initial version of the New `stream` command landed in develop, so this is something worth testing too.