CLI Documenation
Indepth guides for CleverStack's CLI covering installation, configuration, usage and extending.
Indepth guides for CleverStack's CLI covering installation, configuration, usage and extending.
CleverStack provides a fully featured Command Line Interface that does everything you will need in your Software Development Lifecycle
Our Command Line Interface (CLI) was designed to be as modular as possible, so that applications could take advantage of modules that are created and published to our Open Source EcoSystem by anyone, as well as our Official Modules.
The CLI has a few packages it depends on that cannot be defined inside of it's package.json, you have to install these before you can install or use the Command Line Interface.
npm install -g bower
npm install -g grunt-cli
Installation is made easy using NPM, to install the CleverStack Command Line Interface (CLI) please run the following.
npm install -g cleverstack-cli
You should run this command (and others like it) in the windows command (cmd) prompt, and in some cases you will need to run your cmd prompt as Administrator
You may need to run this command using "sudo", but you should note if you need to use sudo then something is wrong with your file/folder permissions
sudo npm install -g cleverstack-cli
Here is a list of all commands available using our Command Line Interface (CLI).
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
Coming soon, we are working hard on the section!
All functionality except what is in the CleverStack Core must be defined inside of modules, because we take advantage of NPM & Bower for our package management it mean's that you can use the thousands of already available packages as Modules for your CleverStack powered Applications.
We currently have a handful of important Official CleverStack modules available which we list here and update as frequently as possible, however we recommend visiting our Modules page to get the full and upto date list of modules.
This module deeply integrates SequelizeJS into CleverStack, to provide an out of the box Object Relational Mapper which is widely accepted, widely used, full featured and mature SQL Solution for CleverStack.
$ clever install clever-orm
This module deeply integrates MongooseJS into CleverStack, to provide an out of the box Object Document Mapper, which is a primarily MongoDB based NoSQL solution to storing data.
$ clever install clever-odm
This module allows you to define tasks that will be run in the background a separate dedicated process, by providing master-slave locking this module also allows you to never have to use CRON files ever again; Simply define your task as masterOnly and it will only run on the Master server ensuring its execution does not overlap (even in an elastic cloud configuration with hundreds of servers).
While NodeJS is designed around being non blocking it is still very possible for any line of code to block any other code running until that line has finished executing, this means that processing CPU intensive operations cannot be done inside any of the Processes that are responding to HTTP Requests (otherwise the user will get no response, because its busy doing some CPU Intensive Operation).
$ clever install clever-background-tasks
This module provides you with a user model, service, migrations and all the code you need to provide a registration, login/logout, forgotten password as well as Google, LinkedIn, Twitter and Facebook social signup & signin. (Both the Frontend and Backend have this module available for installation).
$ clever install clever-auth
This is a list of modules that are used in the Core of CleverStack, you do not need to install these (as they are by default). However these modules are designed to work with anything, so if you want to use these components in something other than CleverStack you have that option.
This module provides Lightning-fast flexible Controller's for CleverStack, the main aim of the controller is to help simplify the most common tasks that you need to do when setting up routes and functions/classes to handle them.
This module provides Dependency Injection for CleverStack, it is non blocking, Lightning-fast, easy to use and flexible.
Adding, Removing, Upgrading or Downgrading modules is the same with both the Frontend or Backend seeds. Here is some examples of working with the clever-auth module.
$ clever install clever-auth
$ clever remove clever-auth
$ clever upgrade clever-auth
$ clever downgrade clever-auth
Note You can specify multiple modules in each install, remove, upgrade or downgrade command separated by spaces.
Finding modules is easy, here are some of the ways available
# Using the CleverStack CLI
$ clever search cleverstack-module
# Using NPM (using the keyword "cleverstack-module")
$ npm search cleverstack-module
# Using Bower (using the keyword "cleverstack-module")
$ bower search cleverstack-module
You can develop your own CleverStack modules, here's how you create a module using the CleverStack CLI.
Run the following command:
$ clever new <my-module>
This will install and setup a new skeleton module for you.
If you have any problems (including errors, exceptions and even general usage) with the CleverStack CLI.
Firstly please read our guidelines for contributing, Then fork the CleverStack CLI github repo, once you are ready please submit a "Pull Request" for review.
At Clevertech we believe in testing our code as we develop, then if something breaks we know exactly where to start looking. Spending more time on developing the features we love.
To run the unit tests for your app and modules, from the front-end/back-end root directory run:
$ clever test unit
Or simply use the alias:
$ clever test
To setup your environment for e2e testing with Protractor run the following command. This will install Selenium Server (WebDriver), ChromeDriver & PhantomJS based on your OS. If you wish to run selenium server in a separate terminal then use Webdriver Manager (see below).
$ cd Frontend
$ npm run-script setup-protractor
Webdriver Manager comes shipped with protractor and installs selenium server & chrome driver for you. Selenium server can then run in a separate terminal so when you run your e2e tests it doesn't need to boot up (saving heaps of time when running your e2e tests!). To set this up do the following:
npm install -g protractor
webdriver-manager update
webdriver-manager start
Your selenium server should be running in this terminal.
Finally update your e2e test config file located: my-app/Frontend/test-e2e.conf.js
// uncomment this line:
seleniumAddress: 'http://localhost:4444/wd/hub',
// comment these lines:
seleniumServerJar: ''
seleniumPort: ''
chromeDriver: ''
To run the end-to-end tests for your app and modules, from the front-end/back-end root directory run:
$ clever test e2e
To generate a code coverage report for your unit tests, from the front-end directory run:
$ clever test coverage
Your browser should open the following URL:
$ http://localhost:5555
Then select your report from the list.
At Clevertech we build lots of MVP's so we like our deployment to be as efficient as possible. We are going to implement some of these strategies for CleverStack.
To build a production version of your front-end app, from your front-end root directory run:
$ clever build
This will build your app, minifying your assets etc and puts everything into the /dist folder ready for deployment.
Note: You can view a production version of your app on port 9009.
Stay Tuned!! NodeJS deployment strategies coming soon. AWS, Heroku and more.
We will document any "gotchas" here along with any important open GitHub issues. Please open an issue if you see a bug.
Answers to some frequently asked questions about CleverStack. Please open an issue if you are requesting a new feature.
We will add important FAQ here.