begin writing CLI script
many fixes from writing cli
rename cli script