Is there an api or a way to automate a theme export?
There is unfortunately not a public API for this at this time.