Move cli app to the cli package

Add persist history option