# Metro Cli tool

<div id="introduction"></div>
## Introduction

Metro is a CLI tool that works under the hood of the Nylo framework. 
It provides a lot of helpful actions to speed up development.

<div id="install"></div>
## Install

Mac guide

1. **Open your bash\_profile**

``` dart
sudo open ~/.bash_profile
```

2. **Add this alias to your bash\_profile**
``` bash
...
alias metro='flutter pub run nylo_framework:main'
```

3. **Then run the following**
``` bash
source ~/.bash_profile
```

If you open a project that uses Nylo, try to run the following in the terminal.

``` bash
metro
```

You should get an output similar to the below.

``` bash
Metro - Nylo\'s Companion to Build Flutter apps by Anthony Gordon

Usage: 
    command [options] [arguments]

Options
    -h

All commands:
 project
  project:init

 make
  make:controller
  make:model
  make:page
  make:stateless_widget
  make:stateful_widget

 appicons
  appicons:build
```

<div id="make-controller"></div>

## Make controller

You can make a new controller by running the below in the terminal.

``` bash
metro make:controller profile_controller
```

This is will create a new controller if it doesn't exist within the `app/controllers` directory.

<div id="make-model"></div>

## Make model

You can make a new model by running the below in the terminal.

``` bash
metro make:model product
```

This is will create a new model if it doesn't exist within the `app/models` directory.

``` bash
metro make:model product --storable
```
You can also make a Storable model which can be saved to the users local storage.

Learn more on Storable models [here](/docs/1.x/storage)


<div id="make-page"></div>

## Make page

You can make a new page by running the below in the terminal.

``` bash
metro make:page product_page
```

This is will create a new page if it doesn't exist within the `common/pages` directory.

``` bash
metro make:page product_page -c
```

Create a page with a controller.

<div id="make-stateless-widget"></div>

## Make stateless widget

You can make a new stateless widget by running the below in the terminal.

``` bash
metro make:stateless_widget product_rating_widget
```

This is will create a new widget if it doesn't exist within the `resources/widgets` directory.

<div id="make-stateful-widget"></div>

## Make stateful widget

You can make a new stateful widget by running the below in the terminal.

``` bash
metro make:stateful_widget product_rating_widget
```

This is will create a new widget if it doesn't exist within the `resources/widgets` directory.


<div id="build-app-icons"></div>

## Building app icons

You can generate all the app icons for IOS and Android by running the below command.

``` dart
metro appicons:build
```

This uses the pubspec.yaml configuration for your app icon. Check out the next section which explains how you can update your app icon in more detail.
