ttyStudio is a very interesting tool that allows us to generate animated gifs from console output. To do this, we just need to install nodejs and the tool itself.
ttyStudio depends on nodejs, so we install what is necessary:
emerge net-libs/nodejs
npm install ttystudio
npm install ttystudio
To generate a gif:
cd node_modules/ttystudio/bin
./ttystudio test.gif –log
Ctrl+q
./ttystudio test.gif –log
Ctrl+q
The result is test.gif with the console output :)