How can I recreate the Image Pull UX via the docker API?

I am building a project that pulls docker images and runs containers from Go code. However, when I pull and image I don’t have the same output as you because I am not redrawing the terminal I am just streaming to stdout. Can someone please point me to some code that will allow me that have a similar UI/UX experience via my cli as the one people have come to know via the docker engine?

Thank you so much! I <3 docker !