staller-cli
v1.0.6
Published
CLI tool for creating Staller apps
Readme
Staller CLI 🚀
A simple CLI tool for creating Staller applications, controllers, middleware, and more.
📦 Installation
You can install the CLI globally or use npx to run it directly.
Global Installation
npm install -g staller-cliNow, you can run:
staller create-app myappUsing npx (Without Installation)
npx staller create-app myapp🚀 Usage
1️⃣ Create a New Staller App
staller create-app myappThis will:
- Download the Staller starter template
- Install dependencies
- Setup the project structure
cd myapp2️⃣ Create a Controller
staller create-controller usersThis will generate UserController.ts inside the controllers/ directory.
Example output:
import { Controller, Get } from "staller-plugin";
@Controller("/users")
export default class UserController {
@Get("/")
getAll() {
return [{ id: 1, name: "John Doe" }];
}
}🔹 Start the app:
npm run dev3️⃣ Create a Middleware
staller create-middleware authThis will generate authMiddleware.ts inside the middlewares/ directory.
Example output:
export default function authMiddleware(req: any, res: any, next: Function) {
console.log("Auth middleware executed");
next();
}