CLI Commands
CanxJS provides a powerful CLI to help you scaffold, develop, and maintain your applications.
Quick Start
Create and run your first CanxJS application in seconds.
# Create a new projectbunx create-canx my-app# Navigate to projectcd my-app# Install dependenciesbun install# Start development serverbun run dev
All Commands
Project Creation
$ bunx create-canx my-appCreate a new CanxJS project with the default MVC template
$ bunx create-canx my-app --apiCreate an API-only project without views
$ bunx create-canx my-app --microCreate a minimal microservice setup
$ bunx create-canx my-app --tsCreate project with strict TypeScript configuration
Development
$ bun run devStart development server with hot reload
$ bun run buildBuild for production
$ bun run startStart production server
$ bun run lintRun ESLint on your codebase
Database
$ bun run canx migrateRun pending migrations
$ bun run canx migrate:rollbackRollback the last batch of migrations
$ bun run canx migrate:freshDrop all tables and re-run all migrations
$ bun run canx seedRun database seeders
$ bun run canx make:migration create_usersCreate a new migration file
$ bun run canx make:seeder UserSeederCreate a new seeder file
Generators
$ bun run canx make:controller UserControllerCreate a new controller
$ bun run canx make:model UserCreate a new model
$ bun run canx make:middleware AuthCreate a new middleware
$ bun run canx make:route apiCreate a new route file
Utilities
$ bun run canx cache:clearClear application cache
$ bun run canx routesList all registered routes
$ bun run canx envDisplay current environment configuration
Generator Example
The CLI generators create boilerplate code for you, following CanxJS conventions.
# Create a controllerbun run canx make:controller UserController# Creates: src/controllers/UserController.ts# With basic CRUD methods: index, show, store, update, destroy