Skip to content

CLI Reference

P Avinash edited this page May 22, 2026 · 1 revision

CLI Reference

This page provides a complete reference for the Sparx CLI.


Command Structure

All commands follow this structure:

sparx <command> [options]

Commands

dev

Start the development server with sub-100ms HMR.

  • --port <number>: Port to run the dev server on (default: 3000).
  • --host <address>: Host to bind the server to (default: localhost).
  • --https: Enable SSL/TLS encryption for local development.
sparx dev --port 8080 --https

build

Compile and bundle your project for production.

  • --minify: Enable code minification via SWC and LightningCSS (default: true).
  • --sourcemap: Generate source maps for debugging (default: false).
  • --analyze: Generate a visual bundle analysis report.
sparx build --analyze

init

Initialize a new Sparx project or configure an existing one.

  • my-app: Name of the directory to initialize.
  • --manual: Run manual setup without interactive template choices.

Global Flags

These flags are available across all commands:

  • -v, --version: Print current CLI version.
  • -h, --help: Display help information for any command.
  • --verbose: Enable verbose logging for debugging compilation pipelines.

Clone this wiki locally