elysia-js-cli
v2.0.0
Published
Elysia CLI is a simple Command Line Interface created to make it easier for developers to start and manage projects using Elysia JS, a lightweight and fast web framework based on Bun.
Maintainers
Readme
📋 Table of Contents
- 🤖 Introduction
- ⚙️ Tech Stack
- 📌 Features
- 🧸 Quick Start
- 📜 CLI Usage
- 📦 Project Structure
- 🔗 Links
- 🙏 Acknowledgements
🤖 Introduction
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.
⚙️ Tech Stack
- Bun JS : Ultra-fast JavaScript runtime.
- Elysia JS : Minimalist and fast web framework.
- TypeScript : Type-safe JavaScript superset.
📌 Features
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.
🧸 Quick Start
1. Prerequisites
2. Installation
bun install -g elysia-js-cli3. Create New Project
elysia new <projectName>4. CLI Interactive Questions
- 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)
5. Running Your Project
cd <your-project>
bun run format # optional formatting
bun run dev6. Verify Setup
Check server with Postman or curl:
curl http://localhost:3000You should receive a successful response from your server.
📜 CLI Usage
Display Help
elysia -hOptions
| Option | Description |
| --------------- | -------------------- |
| -v, --version | Show current version |
| -i, --info | Show CLI information |
| -h, --help | Show help |
| -u, --update | update elysia js cli |
Commands
| Command | Description |
| --------------------------------- | ---------------------------- |
| new <projectName> | Create new Elysia JS project |
| generate <schematic> <fileName> | Generate new file |
Available Schematics
| 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 |
Example:
elysia generate controller userThis will create src/controllers/user.controller.ts based on template.
📦 Project Structure
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🔗 Links
🙏 Acknowledgements
Big thanks to SaltyAom for creating Elysia JS, which inspired and powered the development of this CLI tool.
Note: More features coming soon! 🚀
