CanxJS provides a powerful CLI to help you scaffold, develop, and maintain your applications.
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
$ bunx create-canx my-appCreate a new CanxJS project with the default MVC template
$ bunx create-canx my-app --type=apiCreate an API-only project without views
$ bunx create-canx my-app --type=microserviceCreate a minimal microservice setup
$ bunx create-canx my-app --language=typescriptCreate project with TypeScript (default)
$ bun run devStart development server with hot reload
$ bun run buildBuild for production
$ bun run startStart production server (NODE_ENV=production)
$ bun testRun the test suite with Bun's test runner
$ bunx canx tinkerInteract with your application in REPL mode
$ bun run migrateRun pending migrations
$ bun run migrate:rollbackRollback the last batch of migrations
$ bun run migrate:freshDrop all tables and re-run all migrations
$ bun run migrate:statusShow the status of each migration
$ bunx canx make:migration CreateUsersTableCreate a new migration file (PascalCase name)
$ bunx canx make:seeder UserSeederCreate a new seeder file
$ bun run make:controller UserControllerCreate a new controller
$ bun run make:model UserCreate a new model
$ bunx canx make:middleware AuthCreate a new middleware
$ bun run canx make:microservice PaymentServiceGenerate a new microservice boilerplate
$ bun run canx make:cqrs-command CreateOrderGenerate a new CQRS Command and Handler
$ bunx canx listList all available CLI commands
$ bunx canx optimizeOptimize framework for production (clear caches, etc)
$ bunx canx schedule:runRun scheduled tasks manually
$ bunx canx route:listList all registered routes
$ bunx canx downPut the application into maintenance mode (canx up to restore)
The CLI generators create boilerplate code for you, following CanxJS conventions.
# Create a controllerbun run make:controller UserController# Creates: src/controllers/UserController.ts# With basic CRUD methods: index, show, store, update, destroy