Improve cli mode