Moved CLI into a separate file.