Overview
The CLI (command-line interface) tool helps you to create ExpressoTS projects and scaffold ExpressoTS resources.
We use the npm in this tutorial for simplicity. However, you can use your preferred package manager (yarn or pnpm) by replacing npm with the appropriate command.
Installation
First install the CLI globally using the command below:
npm install -g @expressots/cli
Commands available
The CLI provides the following commands:
| Name | Alias | Description |
|---|---|---|
| new project | new | Generate a new project |
| info | i | Provides project information |
| resources | r | Displays CLI commands and resources |
| scripts | scripts | Run scripts list or a specific script |
| help | help | Show command help |
| service | g s | Generate a service [controller, usecase, dto, module] |
| controller | g c | Generate a controller |
| usecase | g u | Generate a usecase |
| dto | g d | Generate a DTO |
| entity | g e | Generate an entity |
| provider | g p | Generate internal provider |
| provider | add | Add external provider to the project |
| provider | remove | remove external provider |
| provider | create | Create external provider |
| module | g mo | Generate a module |
| middleware | g mi | Generate a middleware |
Usage examples
You can use the CLI either with:
expressotsexas an alias.
Command example:
expressots <command> [options]
// Or
ex <command> [options]
Help command
Verify the available commands and options:
expressots help