Commands

Detailed documentation for all CLI commands

build

Compile a Constela program to JavaScript.

bash
constela build app.json --output dist/app.js --minify

Options

OptionDescription
--output, -oOutput file path
--minify, -mMinify output
--sourcemap, -sGenerate source map
--target, -tModule format (esm, cjs, iife)
--jsonOutput result as JSON (for AI tool integration)
--watch, -wWatch for changes and rebuild automatically
--verbose, -vShow detailed progress (timing for each pass)
--debugShow internal debug information

dev

Start the development server with hot reload.

bash
constela dev app.json --port 3000

Options

OptionDescription
--port, -pDev server port (default: 3000)
--open, -oOpen browser automatically

validate

Validate a program without building. Error messages include "Did you mean?" suggestions for typos.

bash
constela validate app.json
constela validate --all src/

Options

OptionDescription
--allValidate all JSON files in the specified directory
--jsonOutput errors as structured JSON
--verbose, -vShow detailed validation info

Example Output

text
Error [UNDEFINED_STATE] at /view/children/0/value/name

  Undefined state reference: 'count'

  Did you mean 'counter'?

inspect

Visualize program structure including state fields, actions, components, and dependencies.

bash
constela inspect app.json
constela inspect --state --json app.json

Options

OptionDescription
--jsonOutput as JSON
--stateShow only state section
--actionsShow only actions section
--verbose, -vShow all details

init

Initialize a new Constela project.

bash
constela init my-app

Creates a new directory with a basic project structure:

text
my-app/
├── src/
│   └── app.json
├── package.json
└── README.md