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.

Tested on FreeBSD 13.3 following your instructions (cargo install). Besides the expected (slightly shocking) number of dependencies when using rust and the resulting compile time, everything worked smoothly. Turning this into a port/package should be easy.

Tested scenarios:

  • record (normal shell and arc anoid)
  • play
  • play -s3
  • play -i0.5
  • pause
  • frame step
  • convert to text

Great work (regardless of which language it’s written in now, asciinema is such a lovely tool)!

Thanks for testing!

Great. You could also try the new asciinema stream command.

Awesome. Btw, feel free to comment here Generate man page · Issue #627 · asciinema/asciinema · GitHub and/or here Generate shell completions · Issue #628 · asciinema/asciinema · GitHub if you have any opinion/suggestion from the packaging point of view.

Thanks! Always glad to hear that.