Back to Home

CLI Reference

Complete reference for all ServCraft CLI commands. Build backends faster from your terminal.

Installation
# Install ServCraft globally npm install -g servcraft # Verify installation servcraft --version
servcraft init <name>

Initialize a new ServCraft project with interactive setup.

Examples

servcraft init my-app
servcraft init api --ts --prisma postgres

Options

--ts- Use TypeScript (default)--js- Use JavaScript--prisma <db>- Database: postgres, mysql, sqlite, mongodb--validator <lib>- Validator: zod, joi, yup--esm- Use ESM modules--cjs- Use CommonJS modules
servcraft add <module>

Add a pre-built module to your project.

Examples

servcraft add auth
servcraft add users --crud
servcraft add email --templates

Options

--crud- Generate CRUD for the module--templates- Include email templates--dry-run- Preview changes without writing
servcraft generate <type> <name>

Generate code for controllers, services, or schemas.

Examples

servcraft generate controller post
servcraft generate service user
servcraft generate schema product

Options

--with-tests- Generate test files--dry-run- Preview changes without writing
servcraft scaffold <name>

Generate complete CRUD operations for a resource.

Examples

servcraft scaffold blog
servcraft scaffold product --with-tests

Options

--with-tests- Generate test files--dry-run- Preview changes without writing
servcraft list

List all available modules with their status.

Examples

servcraft list
servcraft list --available

Options

--available- Show only available modules--installed- Show only installed modules
servcraft remove <module>

Remove a module from your project.

Examples

servcraft remove auth
servcraft remove users --keep-files

Options

--keep-files- Keep generated files
servcraft update

Update ServCraft and installed modules to latest versions.

Examples

servcraft update
servcraft update --modules-only

Options

--modules-only- Update only modules--dry-run- Preview changes without applying
servcraft doctor

Diagnose project configuration and dependencies.

Examples

servcraft doctor
servcraft doctor --fix

Options

--fix- Auto-fix common issues--verbose- Show detailed output
servcraft templates

Manage custom code generation templates.

Examples

servcraft templates list
servcraft templates add my-template
servcraft templates remove my-template
servcraft docs

Generate API documentation in various formats.

Examples

servcraft docs generate
servcraft docs export postman
servcraft docs status

Options

--format <fmt>- Output format: openapi, postman, yaml--output <path>- Output file path
servcraft db <command>

Database management commands.

Examples

servcraft db migrate
servcraft db push
servcraft db seed
servcraft db studio

Subcommands

migrate- Run Prisma migrations
push- Push schema changes
generate- Generate Prisma client
seed- Run database seeders
reset- Reset database
status- Show migration status
studio- Open Prisma Studio
servcraft completion

Generate shell completion scripts.

Examples

servcraft completion bash
servcraft completion zsh
servcraft completion fish

Global Options

--help, -hShow help for a command
--version, -VShow version number
--verbose, -vEnable verbose output
--dry-runPreview changes without writing
--quiet, -qSuppress output except errors
--cwd <dir>Working directory
--config <file>Config file path
--no-colorDisable colored output

Ready to Build?

Start building your backend with the powerful ServCraft CLI.