Avleon Commands
Useful commands
Install the CLI globally, or run it with npx:
Command Overview
| Command | Alias | Description |
|---|---|---|
new | Create a new application | |
serve | Start the dev server with watch + rebuild | |
build | Compile using tsconfig.build.json | |
make:model | m:m | Create a model or TypeORM entity |
make:controller | m:c | Create a controller |
make:service | m:s | Create a service |
make:config | m:cnf | Create a config class |
make:middleware | m:mlwr | Create a middleware |
Every make:* command takes -f / --force to overwrite an existing file.
Application
You are prompted for a package manager and optional features — OpenAPI docs, CORS, TypeORM, Knex and Scalar UI. Then:
Development Server
Compiles src/ with SWC into dist/, starts the app and restarts it on change.
The entry point comes from avleon.entry in package.json, falling back to main.
Controller
Pass -r for a full REST skeleton, and -m <model> to bind it to a model:
With -m, the matching service is generated in src/services and the controller
delegates to it. Add --orm to back that service with a TypeORM repository.
Use -rt <dir> to place the file under a different directory, and --base-path
to emit @ApiController without a route prefix.
Service
A resource service uses an in-memory Collection by default:
Add --orm for one backed by a TypeORM repository:
Model
Middleware
Generates a class extending AvleonMiddleware:
Config
Generates a class extending AvleonConfig and registered with @AppConfig:
Build
Removes dist/ and compiles the project with tsconfig.build.json.