> For the complete documentation index, see [llms.txt](https://vytautas.gitbook.io/ng-state/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vytautas.gitbook.io/ng-state/other-information/cli.md).

# CLI

`ng-state` has optional package `ng-state-cli` which makes developers lives easier by generating new files or integrating state management to existing ones.

Install it from npm

```
npm install ng-state-cli -g
```

In terminal type `ngstate` and answer couple questions:

1. Name of the component - e.g: `todos`
2. Choose directory
3. Enter state path like you do in `@InjectStore` decorator - e.g: `['todos', '${stateIndex}']` or '`todos'`&#x20;
4. Chose `Add` or `Append`&#x20;

When `Add` is chosen `ng-state-cli` will generate these files

* actions
* component
* html template
* styles
* spec

![](/files/-LbvgBo-KuSplREXp7a4)

When `Append` is chosen `ng-state-cli` will do following

* generate action
* modify component file
* modify spec file

*Append plays nice with angular cli*

![](/files/-LbvgFP2IpIRr0Ei2Lyl)
