Moved CLI logic to specific cli.js file