Elysia JS CLI is a Command Line Interface (CLI) tool designed to make it easier and faster to create projects using Elysia JS Framework.
- π€ Introduction
- βοΈ Tech Stack
- π Features
- π§Έ Quick Start
- π CLI Usage
- π¦ Project Structure
- π Links
- π Acknowledgements
Elysia JS CLI is a developer-friendly CLI tool that simplifies and accelerates the process of scaffolding new projects using the Elysia JS Framework.
It helps developers to:
- Scaffold fully configured projects following industry best practices.
- Automate repetitive setup tasks such as creating folder structures, configuration files, installing dependencies, and more.
- Focus more on building core application features instead of spending time on initial setup.
Whether you're starting a prototype or a production-ready app, Elysia JS CLI provides a smooth and efficient starting point for both beginners and experienced developers.
- Bun JS : Ultra-fast JavaScript runtime.
- Elysia JS : Minimalist and fast web framework.
- TypeScript : Type-safe JavaScript superset.
-
Project Type Selection
- Currently supports REST API scaffolding (more types coming soon).
-
Optional Tools Integration
- Prettier β Code formatting.
- ESLint β Code linting and static analysis.
- Husky β Git hooks integration.
- Commitlint β Enforce conventional commits.
- Swagger - API Documentation
-
Database Support
- MySQL (more databases coming soon).
-
ORM Integration
- Drizzle ORM β Type-safe SQL ORM.
-
Version Control Initialization
- Automatic Git initialization with first commit.
-
Project Boilerplate Generation
- Predefined folder structure, config files, sample code using schematics.
-
Environment Configuration
- Auto-generate
.envtemplate file.
- Auto-generate
-
Interactive CLI
- Smooth, intuitive question-based setup.
bun install -g elysia-js-clielysia new <projectName>- Project type : REST API
- Use Prettier? : (Y/n)
- Use ESLint? : (Y/n)
- Enable Husky & Commitlint? : (Y/n)
- Use Swagger? : (Y/n)
- Choose database : MySQL
- Choose ORM : Drizzle ORM
- Initialize Git? : (Y/n)
cd <your-project>
bun run format # optional formatting
bun run devCheck server with Postman or curl:
curl http://localhost:3000You should receive a successful response from your server.
elysia -h| Option | Description |
|---|---|
-v, --version |
Show current version |
-i, --info |
Show CLI information |
-h, --help |
Show help |
-u, --update |
update elysia js cli |
| Command | Description |
|---|---|
new <projectName> |
Create new Elysia JS project |
generate <schematic> <fileName> |
Generate new file |
| Schematic | Description |
|---|---|
controller |
Generate controller file |
service |
Generate service file |
route |
Generate route file |
repository |
Generate repository file |
validation |
Generate validation file |
model |
Generate model file |
interface |
Generate interface file |
resources |
Generate full resources (controller, service, route, etc) |
config |
Generate config file |
middleware |
Generate middleware file |
util |
Generate utility file |
enum |
Generate enum file |
elysia generate controller userThis will create src/controllers/user.controller.ts based on template.
Example structure after scaffolding:
my-awesome-api/
βββ .husky/
βββ node_modules/
βββ src/
β βββ configs/
β βββ controllers/
β βββ databases/
β β βββ models/
β βββ enums/
β βββ interfaces/
β βββ middlewares/
β βββ repositories/
β βββ routes/
β βββ services/
β βββ types/
β βββ utils/
β βββ validations/
β βββ index.ts
βββ .env
βββ .gitignore
βββ .prettierrc
βββ bun.lockb
βββ commitlint.config.js
βββ drizzle.config.ts
βββ eslint.config.mjs
βββ package.json
βββ README.md
βββ tsconfig.json
Big thanks to SaltyAom for creating Elysia JS, which inspired and powered the development of this CLI tool.
Note: More features coming soon! π
