4 ms·
I’ve already been using asciinema 3 as a Rust library to build tools - specifically, a tool that runs a command and streams the output logs directly to AWS Clou
by rmccue 3y ago
I’ve already been using asciinema 3 as a Rust library to build tools - specifically, a tool that runs a command and streams the output logs directly to AWS CloudWatch.
So far, apart from some minor bugs which mostly didn’t affect me, things have been working perfectly - so much so that it’s kind of surprising really. Kudos to Marcin (and my thanks for being so engaged on Mastodon when I had questions!)
- srid 3y agoInteresting. When you use it as Rust library, do you produce a cast? What does it record actually? Does using it as a library obviate vhs?
- rmccue 3y agoThe cast format is effectively line-oriented JSON, which adapts well to being streamed directly to CloudWatch, with each line being a single entry in the CW log stream. It's then fairly easy to pull back out and replay as needed. It's published up at https://github.com/rmccue/cinemastream https://github.com/rmccue/cinemastream if you're interested in trying it - it works, but still very early days, as it was just a holiday side-project. That said, likely to become a production tool for work, so will be cleaning it up a bit soon and squashing some bugs. Worth noting that asciinema is not directly usable as a crate currently, so I did need to fork it to add a lib.rs, but the code was so well-structured that there's not much to do there: https://github.com/rmccue/asciinema/blob/rust-lib/src/lib.rs https://github.com/rmccue/asciinema/blob/rust-lib/src/lib.rs - Marcin did say he's open to it once 3.0 stabilised though.