Ignite UI CLI for React
Our CLI tools provide project templates pre-configured for the Ignite UI for React toolset that help you get your next application off the ground in record time. The Ignite UI CLI is a stand-alone command-line tool for creating and scaffolding your applications for a variety of different frameworks and provides a substantial productivity boost for developers.
To get started, install the CLI:
npm install -g igniteui-cli
The above install command will make the Ignite UI CLI available for creation, scaffolding, and running of your Ignite UI for React application.
Create a New Project
To create an application that is configured to use the Ignite UI for React controls using the Ignite UI CLI, you can use the following template in your command line:
ig new "[name_of_project]" --framework=[target_framework] --type=[project_type]
Using the above template, if you wanted to create a
React application named "My Project" targeting ES6, you could write the following command:
ig new "My Project" --framework=react --type=igr-es6
Once you have created a project, you can then add additional component templates using ig add at any point. Running this command without any parameters will guide you through the available templates by using a keyboard navigation CLI to add the control of your choosing.
Alternatively, you can simply run the ig list command to get a full list of supported templates in the current project you have created.
After running ig list and you find the component template you would like to add, you can do so quickly by following this template in your command line:
ig add [component_template] [component_name]
The "component_template" above will generally match an Ignite UI for React component ("grid", "category-chart", "linear-gauge", etc.).
For example, if you wanted to add a data grid templated component named "MyGridComponent" to your application, you could run the following:
ig add grid MyGridComponent
Build and Run the Application
In order to build and run the Ignite UI for React application, you can call the ig build and ig run commands:
ig build ig run
Ignite UI CLI Commands
A full list of the available Ignite UI CLI commands and their usage (like passing flags, etc.), can be found at the Ignite UI CLI wiki pages:
|ig start||Builds the application, starts a web server and opens the application in the default browser.|
|ig build||Builds the application into an output directory|
|ig generate||g||Generates a new custom template for supported frameworks and project types|
|ig help||-h||Lists the available commands and provides a brief description of what they do.|
|ig config||Performs read and write operation on the Ignite UI CLI configuration settings.|
|ig doc||Searches the Infragistics knowledge base for information about a given search term|
|ig list||l||Lists all templates for the specified framework and type. When you run the command within a project folder it will list all templates for the project's framework and type, even if you provide different ones.|
|ig test||Executes the tests for the current project.|
|ig version||-v||Shows Ignite UI CLI version installed locally, or globally if local is missing|