CLI means “Command Line Interface”. It is a tool that automates the code setup for your applications from creating your configuration files to generation of different components for your application. To get started, go to www.github.com/angular/angular-cli
Note that installing Angular-CLI also requires updated Node 4.x.x and NPM 3.x.x versions. If you haven’t done it yet, refer to the tutorial on installation of Node and NPM.
In your terminal, type “npm install -g angular-cli”
Once it’s done loading, check if the installation is successful by typing “ng version”.
Once successfully installed, you may now use Angular CLI to create a saved project or archetype and for automated generations of different components such as directives, services or even routers for your application.
Angular-CLI is still in the development stage. In other words, Beta version. From time to time, you may need to update your Angular-CLI version. To do that just follow these commands:
To create a new Angular2 project using Angular-CLI, type this on your terminal:
– This will automatically generate your source files and configuration files
– It will also create the src folder containing your initial Angular2 components and HTML files.
– End-to-end folder or e2e folder is also created
And it’s ready to be run. Just clear your terminal and type “ng serve”
As you can see, it is running on port “localhost:4200”. Go to your browser and type it in the address bar and you’re done.
On the next article, we will be discussing Choosing your Preferred IDE.