# Ionic2- how to execute ng commands inside an ionic2 project

**URL:** <https://forum.ionicframework.com/t/ionic2-how-to-execute-ng-commands-inside-an-ionic2-project/88844>\
**Category:** ionic-v3\
**Created:** [May 4, 2017, 5:33am UTC](https://forum.ionicframework.com/t/ionic2-how-to-execute-ng-commands-inside-an-ionic2-project/88844 "2017-05-04T05:33:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![themarsbeing](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/themarsbeing/32/109099_2.png) [@themarsbeing](https://forum.ionicframework.com/u/themarsbeing)\
**Post date:** [May 4, 2017, 5:33am UTC](https://forum.ionicframework.com/t/ionic2-how-to-execute-ng-commands-inside-an-ionic2-project/88844/1 "2017-05-04T05:33:47Z")

</div>

Here is the thing, I’m developing an ionic2 mobile app using Angular2 and typescript.  
I’m able to perform ionic2 commands from command line. I’ll list a few I am able to peform:

1)`ionic generate page pagename`  
2) `ionic serve`

since it based on angular2, I thought I can execute angular2 commands as well. I wanna create a class. So I gave the following command

`ng g cl classname`

but it wasn’t executed. Following message was shown:

```auto

You have to be inside an angular-cli project in order to use the generate command

```

So I’m doing it manually. Is there a way I can generate it using command line, so that way dependencies will get added in app.module.ts file as well.

Angular CLI is already installed. NodeJS and all necessary things for angular2 project has already been installed in my machine. I can use these commands in an a pure angular2 project but not in ionic2 project which is build using angualar2

Why is it so?

---

<div class="post-metadata">

**Author:** ![mgldev](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mgldev](https://forum.ionicframework.com/u/mgldev)\
**Post date:** [November 2, 2017, 7:32pm UTC](https://forum.ionicframework.com/t/ionic2-how-to-execute-ng-commands-inside-an-ionic2-project/88844/2 "2017-11-02T19:32:18Z")

</div>

I’m trying to achieve the same thing (using Angular CLI inside an Ionic 2 app) - can anybody help?
