Skip to content

CLI

The Minima.js CLI scaffolds projects, runs the development server, builds for production, and generates code.

The ./app runner

Every scaffolded project includes an executable ./app script that forwards commands to the local minimajs binary. You never need a global install — the project always uses its own pinned version.

bash
./app dev          # start dev server
./app build        # production build
./app start        # run compiled output
./app add module users  # generate a module

new — Scaffold a project

bash
# Node.js (default)
npx @minimajs/cli new my-app

# Bun
bunx @minimajs/cli new my-app --bun

# With options
npx @minimajs/cli new my-app --pm pnpm --no-git
FlagDefaultDescription
--pmauto-detectedPackage manager (bun, pnpm, yarn, npm)
--runtimeauto-detectedRuntime target (node or bun)
--bunShorthand for --runtime=bun
--install / --no-installtrueInstall dependencies after scaffolding
--git / --no-gittrueRun git init after scaffolding

Scaffolded structure:

my-app/
├── src/
│   ├── index.ts           # entry point
│   ├── module.ts          # root module
│   └── users/
│       ├── module.ts
│       └── users.handler.ts
├── minimajs.config.ts     # project config
├── tsconfig.json
├── .env
├── .gitignore
└── app                    # runner script (executable)

dev — Development server

bash
./app dev
./app dev -s               # with sourcemaps
./app dev --no-check       # skip TypeScript type checking
./app dev --no-run         # watch/rebuild only, don't run the process
./app dev --env-file .env.local
FlagDefaultDescription
-s, --sourcemapfalseEnable sourcemaps (--enable-source-maps on Node)
--env-filePath to .env file
-p, --tsconfigPath to tsconfig.json
--check / --no-checktrueRun TypeScript type checking on each rebuild
--resetClear screen on each rebuild
--kill-signalSIGTERMSignal used to stop process before restart
--grace / --no-gracetrueGraceful shutdown before restart
--run / --no-runtrueWatch and rebuild without running the process
--execCustom run command (e.g. 'node [filename]')

build — Production build

bash
./app build
./app build --minify --sourcemap
./app build --outdir dist --target node22
FlagDefaultDescription
-o, --outdirdistOutput directory
-m, --minifyMinify output
-s, --sourcemapEmit sourcemaps
-p, --tsconfigPath to tsconfig.json
--check / --no-checktrueRun TypeScript type checking before building
-t, --targetTarget environment (e.g. node22)

start — Run production build

bash
./app start
./app start -s             # with sourcemaps
./app start --env-file .env.production
FlagDefaultDescription
-s, --sourcemapEnable sourcemaps on Node
--env-filePath to .env file

add — Generators & integrations

Code generators

All generators create a file and auto-patch the nearest module.ts to register it.

CommandDescription
add module <name>Scaffold a route module
add service <name>Scaffold a service file
add hook <name>Scaffold a lifecycle hook, register in nearest module.ts
add plugin <name>Scaffold a plugin, register in nearest module.ts
add middleware <name>Scaffold a middleware, register in root src/module.ts
bash
./app add module orders
./app add hook request-logger
./app add hook users/validate --type=request
./app add plugin rate-limit
./app add plugin orders/audit
./app add middleware request
./app add middleware auth/jwt

Integrations

CommandDescription
add diskScaffold a disk storage instance
add openapiInstall OpenAPI / Swagger documentation
add lintScaffold ESLint with TypeScript support
add formatScaffold Prettier formatting
add dockerfileGenerate a Dockerfile
add skillsInstall the MinimaJS skill for AI agents
bash
./app add disk                          # src/disks/index.ts
./app add disk uploads --driver=aws-s3  # named, S3-backed
./app add disk router --proto           # ProtoDisk for multi-provider routing
./app add openapi
./app add dockerfile
./app add skills --claude

Configuration

See Configuration for minimajs.config.ts options and the plugin system.