C
CanxJS
v1.6.2
  • Learn
  • Blog
  • Showcase
C
CanxJS

Ultra-fast async MVC backend framework for Bun. Build production-ready APIs with elegance and speed.

Resources

  • Documentation
  • Learn
  • Blog
  • Showcase

Documentation

  • Introduction
  • Installation
  • Core Concepts
  • CLI Commands
  • API Reference

Legal

  • Privacy Policy
  • Terms of Service

© 2026 CanxJS. All rights reserved.

Built with ❤️ for Candra Kirana

  • CLI Commands
  • API Reference
  • OpenAPI Spec
Reference

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.

Terminal
# Create a new project
bunx create-canx my-app
# Navigate to project
cd my-app
# Install dependencies
bun install
# Start development server
bun run dev

All Commands

Project Creation

$ bunx create-canx my-app

Create a new CanxJS project with the default MVC template

$ bunx create-canx my-app --api

Create an API-only project without views

$ bunx create-canx my-app --micro

Create a minimal microservice setup

$ bunx create-canx my-app --ts

Create project with strict TypeScript configuration

Development

$ bun run dev

Start development server with hot reload

$ bun run build

Build for production

$ bun run start

Start production server

$ bun run lint

Run ESLint on your codebase

$ bun run canx tinker

Interact with your application in REPL mode

Database

$ bun run migrate

Run pending migrations

$ bun run migrate:rollback

Rollback the last batch of migrations

$ bun run migrate:fresh

Drop all tables and re-run all migrations

$ bun run canx seed

Run database seeders

$ bun run make:migration create_users

Create a new migration file

$ bun run make:seeder UserSeeder

Create a new seeder file

Generators

$ bun run make:controller UserController

Create a new controller

$ bun run make:model User

Create a new model

$ bun run make:middleware Auth

Create a new middleware

$ bun run canx make:microservice PaymentService

Generate a new microservice boilerplate

$ bun run canx make:cqrs-command CreateOrder

Generate a new CQRS Command and Handler

Utilities

$ bun run canx cache:clear

Clear application cache

$ bun run canx optimize

Optimize framework for production (clear caches, etc)

$ bun run canx schedule:run

Run scheduled tasks manually

$ bun run canx routes

List all registered routes

$ bun run canx env

Display current environment configuration

Generator Example

The CLI generators create boilerplate code for you, following CanxJS conventions.

Terminal
# Create a controller
bun run make:controller UserController
# Creates: src/controllers/UserController.ts
# With basic CRUD methods: index, show, store, update, destroy

Next Steps

Learn more about the CanxJS API and how to use it in your applications.