I've seen a lot of people use asciinema to record and share terminal recordings, it works quite well
You still end up having to turn it into a GIF if you want it to autoplay on GitHub's markdown viewer, or video if you want it to run on the page but require a click-to-play.
I used vhs to record the gif which must not run the script in my native terminal! I’ll have to see about fixing it!