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
channelCreate a new WebSocket channel
controllerCreate a new route controller
middlewareCreate a new middleware class
moduleCreate a new app module
serviceCreate a new service class
testCreate 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
--helpoption to get more information about the command. - Use the
--exactflag to generate file with exact name and path (Entropy uses pluralization by default). - Use the
--forceflag to overwrite existing file.