k9withabone / autocast Goto Github PK
View Code? Open in Web Editor NEWAutomate terminal demos
Home Page: https://crates.io/crates/autocast
License: GNU General Public License v3.0
Automate terminal demos
Home Page: https://crates.io/crates/autocast
License: GNU General Public License v3.0
The problem this tool solves is that cumbersome re-generating of custom asciinema CLI shows once your CLI tool changes etc. This solves a very annoying task. It automates this.
What if we take this paradigm even further?
Can't we create a GitHub workflow to automate it after each change (or tag if CLI output rarely changes and you want to save resources etc.?) For this project it would be a good try?
Going even further, what if why not just create a GitHub Action, so other's can use this, too?
The GitHub Action should:
With https://github.com/EndBug/add-and-commit/ the files could in your workflow then automatically be committed in the repository and a bot would automatically update your preview.
Problem: Do asciinema links need to be replaced? If so, ideally it should do this, too โ though that would be cumbersome obviously? But if not, the better, then a link can stay stable.
I don't know what the format of this would be, but I think the keys array could be improved by also allowing a string which would be treated a simple list of keys using the current typing speed, without any special parsing for waits or control codes.
This is would be easier to type and understand, and is a bit less verbose:
Maybe something like:
- !Interactive
keys:
- h
- e
- l
- l
- o
- 2s
- ^X
- n
becomes
- !Interactive
keys:
- !Str hello
- 2s
- ^X
- n
Loving autocast so far!
I would like to use autocast to demonstrate my generic CLI script's auto
completion features.
As far as I understand this is currently not possible.
Control-I should send a tab character, so I tried to do it with this config.
- !Interactive
command: 'cli '
keys:
- ^C
- i
- ^C
- i
This does not work like I expected though. I think it is because it executes the
command before sending the key codes. It would be nice, if one could defer
execution with a flag, in which case the user would have to send a new line
character in the keys section to manually complete the command.
For example:
!Interactive
command: 'cli '
defer_execution: true
keys:
- ^C
- i
- ^C
- i
- some_autocomletion_input
- ^C
- i
- \n
Cheers!
I haven't got a firm handle on how autocast gets the results it does, so perhaps this is a naive question, but would this tool possibly work with the repo https://github.com/Watfaq/PowerSession-rs which is an asciinema clone able to run on Windows?
Thanks a lot for this tool - I realised the need for something exactly like this when I started trying to set up a range of asciinema recordings recently for documentation I was sprucing up.
This is a tracking issue for adding more built-in shell configurations. For a shell to work with autocast, it must accept input on its stdin. The prompt should be changed to something unique so that autocast does not mistake something in a command's output as the prompt. See the bash defaults for an example. If you get a custom shell working, please comment with your configuration and I'll add it to autocast. Feel free to suggest other shells you would like to see built-in configurations for to be added to the list.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.