Skip to content

Elysia JS CLI is a Command Line Interface (CLI) tool designed to make it easier and faster to create projects using Elysia JS Framework.

License

Notifications You must be signed in to change notification settings

xRiot45/elysia-js-cli

Screenshot from 2025-06-19 16-16-43

Elysia JS CLI

bun.js elysia.js typescript

Elysia JS CLI is a Command Line Interface (CLI) tool designed to make it easier and faster to create projects using Elysia JS Framework.


πŸ“‹ Table of Contents

  1. πŸ€– Introduction
  2. βš™οΈ Tech Stack
  3. πŸ“Œ Features
  4. 🧸 Quick Start
  5. πŸ“œ CLI Usage
  6. πŸ“¦ Project Structure
  7. πŸ”— Links
  8. πŸ™ 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 .env template file.
  • Interactive CLI

    • Smooth, intuitive question-based setup.

🧸 Quick Start

1. Prerequisites

2. Installation

bun install -g elysia-js-cli

3. 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 dev

6. Verify Setup

Check server with Postman or curl:

curl http://localhost:3000

You should receive a successful response from your server.


πŸ“œ CLI Usage

Display Help

elysia -h

Options

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 user

This 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! πŸš€

About

Elysia JS CLI is a Command Line Interface (CLI) tool designed to make it easier and faster to create projects using Elysia JS Framework.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published