Usage

In order to achieve a high user-experience, the CLI commands share the same command schema.


$ nest [command] [...options]

Options

Each command accepts a set of options that are listed below:

  • --dry-run: allows to simulate the command execution in order to verify how it will affect your working directory

new (alias: n)

The new command generates a Nest project based on the typescript-starter as well as install the required packages. The CLI will ask you for missing information to create the project, for example, which package manager do you want to use to install dependencies.

OptionDescriptionRequiredDefault value
nameYour application namefalsenest-app-name
descriptionYour application descriptionfalsedescription
versionYour application versionfalse1.0.0
authorYour application authorfalse''

Example usage:


$ nest new my-awesome-app
OR 
$ nest n my-awesome-app

generate (alias: g)

The generate command generates a Nest architecture component.

OptionDescriptionRequiredDefault value
schematicThe schematic name from the list bellow.trueN/A
nameThe name of the generated Nest architecture component.trueN/A
pathThe path from to generate the Nest architecture component.falsesrc

A list of available architecture components:

  • class (alias: cl)
  • controller (alias: co)
  • decorator (alias: d)
  • exception (alias: e)
  • filter (alias: f)
  • gateway (alias: ga)
  • guard (alias: gu)
  • interceptor (alias: i)
  • middleware (alias: mi)
  • module (alias: mo)
  • pipe (alias: pi)
  • provider (alias: pr)
  • service (alias: s)

Example usage:


$ nest generate service users
OR
$ nest g s users

info (alias: i)

The info command will display your project information.


$ nest info
 _   _             _      ___  _____  _____  _     _____
| \ | |           | |    |_  |/  ___|/  __ \| |   |_   _|
|  \| |  ___  ___ | |_     | |\ `--. | /  \/| |     | |
| . ` | / _ \/ __|| __|    | | `--. \| |    | |     | |
| |\  ||  __/\__ \| |_ /\__/ //\__/ /| \__/\| |_____| |_
\_| \_/ \___||___/ \__|\____/ \____/  \____/\_____/\___/

[System Information]
OS Version     : macOS High Sierra
NodeJS Version : v8.9.0
YARN Version    : 1.5.1
[Nest Information]
microservices version : 5.0.0
websockets version    : 5.0.0
testing version       : 5.0.0
common version        : 5.0.0
core version          : 5.0.0
  
  • Usage
  • Options
  • new (alias: n)
  • generate (alias: g)
  • info (alias: i)

Support us

Nest is an MIT-licensed open source project. It can grow thanks to the support by these awesome people. If you'd like to join them, please read more here.

Principal Sponsor

Sponsors / Backers