Install rayito & imagemagick
Render the individual frames
rayito -workers=8 -file=p0.txt
rayito -workers=8 -file=p1.txt
rayito -workers=8 -file=p2.txt
rayito -workers=8 -file=p3.txt
rayito -workers=8 -file=p4.txt
rayito -workers=8 -file=p5.txt
Finally, use ImageMagick's convert
utility to assemble the gif
convert -delay 10 -loop 0 *txt*.png loop.gif