CLI

Entropy comes with an additional CLI tool that helps you to create new projects and generate files like modules and controllers.

Getting Started

To get started, install the CLI tool globally with the following commands:

      

terminal

deno install -A -g https://deno.land/x/entropy_cli/entropy.ts export PATH="$HOME/.deno/bin:$PATH"

If the installation was successful, you should be able to run the entropy [...] commands:

      

terminal

entropy --version # Entropy CLI version 1.0.0

Generating Files

To generate new file, run the make command followed by type and name of the file:

      

terminal

entropy make controller post # Creates file `src/posts/post.controller.ts`

Available file types are:

Type
Description
channel
Create a new WebSocket channel
controller
Create a new route controller
middleware
Create a new middleware class
module
Create a new app module
service
Create a new service class
test
Create a unit test

Creating New Project

To create a fresh Entropy application project, run the new command:

      

terminal

entropy new [app-name]

Shorthand Commands

Entropy CLI also provides some shorthands for common commands for faster usage:

      

terminal

entropy m controller chat entropy n ecommerce-app # same as: entropy make controller chat entropy new ecommerce-app
  • Use the --help option to get more information about the command.
  • Use the --exact flag to generate file with exact name and path (Entropy uses pluralization by default).
  • Use the --force flag to overwrite existing file.
Middleware Localization