CLI Overview
The servercn CLI is a powerful command-line interface designed to streamline development by generating boilerplate code, enforcing project structure, and automating repetitive tasks.
It helps you move faster while keeping your codebase consistent and scalable.
Why Use the CLI?
Instead of manually creating files and wiring everything together, the CLI allows you to:
- Generate controllers, services, and routes instantly
- Maintain a consistent architecture across your project
- Reduce boilerplate and human error
- Scale your application with predictable patterns
Installation
Existing Project
Initialize Servercn in an Existing Project
npx servercn-cli init After running the command, you will be prompted to choose a project foundation:
Choose the Existing Project and press Enter to continue.
Again, you will be prompted to configure your stack:
This generates a servercn.config.json file in your project root:
New Project
Initialize a New Project from a Starter
Available starters:
npx servercn-cli init nextjs-starter --fw=nextjs npx servercn-cli init express-starter npx servercn-cli init mongoose-starter npx servercn-cli init drizzle-mysql-starter npx servercn-cli init drizzle-pg-starter CLI Help
npx servercn-cli --help