It would be awesome if asciinema supported Charm’s VHS format as input and be able to convert it to asciicast. It would be incredibly useful for automating asciicasts (reproducible, up-to-date, etc.), which could potentially solve many usecases for editing asciicasts. As far as specification / grammar is concerned, the format could be drawn from the README, the MIT-licensed lexer / parser / tree-sitter grammar, or possibly elsewhere. I’m limited to 2 links, so I’ve listed the relevant resources below (you can navigate to the lexer / parser from the permalink to VHS’s README).
Neat idea. The parser/grammar doesn’t look too complex.
My initial thought was this could be supported by an option to the rec command, e.g. asciinema rec demo.cast --script demo.vhs, which would drive the demo from vhs script instead of reading the keyboard. The vhs file includes a lot of presentation/visual related settings, like font etc, so it’s not only a script, but if we just ignore non-input tokens then it would still work fine I guess.
Another option to achieve this goal would be to provide a more generic mechanism for driving the recording, and use it with a util/script which parses vhs files. I actually plan to implement an RPC mechanism for asciinema rec (probably for 3.1 version), which will allow controlling the recording (including the input) programmatically. This way, instead of natively supporting vhs format, we’d support it via some small tool which can parse vhs and use the new RPC mechanism.