How to do operations tctl can do from any programming language?

I was able to get it working with both static code generation and dynamic code generation. Thank you everyone for the help. I will put my sample code in a github repo and post it here