CLI Commands Reference
Complete reference for all CurisJS CLI commands.
Global Commands
curis new
Create a new CurisJS project.
Syntax:
curis new <project-name> [options]Options:
-t, --template <name>- Template to use (default, api, minimal)-d, --db <type>- Database type (sqlite, postgres, mysql)-p, --package-manager <pm>- Package manager (npm, pnpm, yarn, bun)--no-git- Skip git initialization--no-install- Skip dependency installation
Examples:
# Create a basic project
curis new my-app
# Create an API project with PostgreSQL
curis new my-api -t api -d postgres
# Create with custom package manager
curis new my-app -p bun
# Create without git
curis new my-app --no-gitcuris dev
Start the development server with hot reload.
Syntax:
curis dev [options]Options:
-p, --port <number>- Port number (default: 3000)-h, --host <host>- Host address (default: localhost)-w, --watch- Enable file watching (default: true)--no-clear- Don't clear console on restart
Examples:
# Start on default port
curis dev
# Start on custom port
curis dev -p 8080
# Start on all interfaces
curis dev -h 0.0.0.0curis build
Build the project for production.
Syntax:
curis build [options]Options:
-o, --output <dir>- Output directory (default: dist)-t, --target <runtime>- Target runtime (node, bun, deno, cloudflare, vercel)--minify- Minify output--sourcemap- Generate sourcemaps
Examples:
# Build for Node.js
curis build
# Build for Bun
curis build -t bun
# Build with minification
curis build --minify
# Custom output directory
curis build -o ./buildcuris serve
Serve the production build.
Syntax:
curis serve [options]Options:
-p, --port <number>- Port number (default: 3000)-h, --host <host>- Host address-d, --dir <directory>- Build directory (default: dist)
Examples:
# Serve production build
curis serve
# Serve on custom port
curis serve -p 8080
# Serve from custom directory
curis serve -d ./buildGenerator Commands
curis generate model
Generate a model file.
Syntax:
curis generate model <name> [options]
curis g model <name> [options]Options:
--table <name>- Table name (default: pluralized model name)--timestamps- Include timestamps (default: true)--soft-delete- Enable soft deletes
Examples:
# Generate User model
curis g model User
# Generate with custom table name
curis g model User --table app_users
# Generate without timestamps
curis g model Log --no-timestampscuris generate controller
Generate a controller file.
Syntax:
curis generate controller <name> [options]
curis g controller <name> [options]Options:
--resource- Generate resource controller (CRUD methods)--api- Generate API controller (JSON responses)
Examples:
# Generate basic controller
curis g controller UserController
# Generate resource controller
curis g controller UserController --resource
# Generate API controller
curis g controller UserController --apicuris generate middleware
Generate a middleware file.
Syntax:
curis generate middleware <name>
curis g middleware <name>Examples:
# Generate auth middleware
curis g middleware auth
# Generate logging middleware
curis g middleware requestLoggercuris generate migration
Generate a database migration.
Syntax:
curis generate migration <name>
curis g migration <name>Examples:
# Generate migration
curis g migration CreateUsersTable
# Generate migration for adding column
curis g migration AddEmailToUsersDatabase Commands
curis db:migrate
Run database migrations.
Syntax:
curis db:migrate [options]Options:
--rollback- Rollback last migration--reset- Reset all migrations--seed- Run seeders after migration--step <n>- Run/rollback specific number of migrations
Examples:
# Run all pending migrations
curis db:migrate
# Rollback last migration
curis db:migrate --rollback
# Rollback specific steps
curis db:migrate --rollback --step 2
# Reset and migrate
curis db:migrate --reset
# Migrate and seed
curis db:migrate --seedcuris db:seed
Run database seeders.
Syntax:
curis db:seed [options]Options:
-c, --class <name>- Specific seeder class to run
Examples:
# Run all seeders
curis db:seed
# Run specific seeder
curis db:seed -c UserSeedercuris db:reset
Reset the database.
Syntax:
curis db:resetcuris db:fresh
Drop all tables and re-run migrations.
Syntax:
curis db:fresh [options]Options:
--seed- Seed after fresh migration
Examples:
# Fresh migration
curis db:fresh
# Fresh migration with seeding
curis db:fresh --seedUtility Commands
curis info
Display project information.
Syntax:
curis infoOutput:
- CurisJS version
- Node.js version
- Package manager
- Runtime environment
- Installed packages
curis list
List all available commands.
Syntax:
curis listcuris version
Display CLI version.
Syntax:
curis version
curis -v
curis --versioncuris help
Display help for commands.
Syntax:
curis help [command]
curis <command> --helpExamples:
# General help
curis help
# Help for specific command
curis help generate
curis generate --helpConfiguration
curis.config.ts
All commands respect the configuration file:
import { defineConfig } from '@curisjs/cli';
export default defineConfig({
server: {
port: 3000,
host: 'localhost',
},
build: {
outDir: 'dist',
target: 'node',
minify: true,
},
database: {
client: 'better-sqlite3',
connection: {
filename: './database.sqlite',
},
},
});Environment Variables
Commands also respect environment variables:
NODE_ENV=development
PORT=3000
HOST=localhost
DB_CLIENT=better-sqlite3
DB_FILENAME=./database.sqliteExit Codes
0- Success1- General error2- Invalid arguments3- Configuration error4- Database error
Troubleshooting
Command Not Found
If curis command is not found:
# Install globally
npm install -g @curisjs/cli
# Or use npx
npx @curisjs/cli <command>
# Or use package script
npm run curis <command>Permission Errors
On Unix systems, you may need to make scripts executable:
chmod +x node_modules/.bin/curisPort Already in Use
If port is in use:
# Use a different port
curis dev -p 3001
# Or kill the process using the port
lsof -ti:3000 | xargs kill