convert script to cli app