Asciinema is a nice tool for capture and save all the terminal output in a json file. You can publish the beautiful animated video record with a player on your website.

Install Asciinema

    $ brew install asciinema

Record a terminal session

    $ asciinema rec myrecord.json

Recording finishes when you exit the shell (hit Ctrl+D or type exit)

For More informations you can check the documentation

Publish the record of your terminal session

You can publish the record on Asciinema website or publish it on your website with asciinema-player.

Install asciinema-player

Check the documentation of asciinema-player

Check the result