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 initAfter 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=nextjsnpx servercn-cli init express-starternpx servercn-cli init mongoose-starternpx servercn-cli init drizzle-mysql-starternpx servercn-cli init drizzle-pg-starterCLI Help
npx servercn-cli --help