move the cli to lib