CLI Reference
Complete guide to every Lunx command — dev servers, production builds, micro-frontend serving, and the 8-command native security suite.
Core Commands
All primary commands for developing, building, and shipping your application.
lunx dev--port <n> --host --https --open --corsStart the uWebSockets.js development server with native HMR, rust-notify file watching, and SQLite warm cache. p99 server boot < 40ms, HMR latency < 18ms.
lunx build--outDir <dir> --minify --sourcemap --target <target>Compile a production bundle using SWC (JS/TS) and LightningCSS (styles) in parallel. Runs the full 8-command security pipeline before emitting any files.
lunx preview--port <n> --host --httpsServe the production dist/ directory locally using a static file server. Use before deploying to validate SRI hashes, asset paths, and service worker registration.
lunx create<name> --framework <fw> --ts --tailwind --template <tpl>Scaffold a new Lunx project. Runs an interactive wizard or accepts CLI flags for fully non-interactive CI pipelines.
lunx dev — detailed flags
# Start on a custom port and expose to network lunx dev --port 3000 --host # Enable HTTPS with auto-generated certificate lunx dev --https # Open the browser automatically lunx dev --open # Disable CORS (default: enabled) lunx dev --cors false
lunx build — detailed flags
# Standard production build lunx build # Custom output directory lunx build --outDir public/build # Generate source maps for debugging lunx build --sourcemap # Target older browsers lunx build --target es2019 # Skip minification (useful for debugging) lunx build --minify false
Security Commands
Lunx ships a native 8-command security suite that runs in the Rust compiler core — zero additional npm dependencies required. Run lunx security audit to execute all checks in sequence.
| Command | What it does |
|---|---|
| lunx security audit | Runs all 8 security sub-commands in sequence. Returns exit code 1 on any violation to fail CI gates. |
| lunx security scan | Deep-scan source files, env files, and configs for API keys, JWTs, AWS credentials, Stripe secrets, and private keys. |
| lunx security cve | Query the OSV (Open Source Vulnerability) database for CVEs in all installed packages. Highlights critical/high severity. |
| lunx security sbom | Generate a CycloneDX 1.5 Software Bill of Materials in JSON or XML. Satisfies SOC 2 and federal supply-chain requirements. |
| lunx security headers | Compute SHA-384 SRI hashes for all output assets and inject them into index.html script and link tags. |
| lunx security fix | Interactively upgrade vulnerable npm packages to safe version ranges. Shows diffs and requires confirmation. |
| lunx security plugins | Verify sandbox permissions of all installed plugins. Blocks plugins attempting unauthorized disk or network access. |
| lunx security report | Compile all audit results into a scored HTML or JSON report (0–100 security score). Suitable for compliance review. |
Example security audit output
lunx security audit 🔍 [1/8] Secret scanning... ✓ Checked 84 files — 0 secrets detected 🔍 [2/8] CVE check (OSV database)... ✓ 312 packages — 0 critical, 0 high, 1 moderate ⚠ lodash@4.17.20 — CVE-2021-23337 (severity: moderate) → Run: lunx security fix 📋 [3/8] SBOM generation... ✓ dist/bom.json written (CycloneDX 1.5 JSON, 312 components) 🔐 [4/8] SRI hash injection... ✓ SHA-384 hashes injected for 3 assets in index.html 🛡 [5/8] Plugin sandbox audit... ✓ 2 plugins verified — no unauthorized permissions 📊 Security score: 94/100 Report: dist/security-report.html
lunx security audit to your CI pipeline. It returns exit code 1 on any violation, automatically failing the build and blocking insecure deployments.Global flags
# Show version lunx --version # 1.0.0 # Verbose logging (debug mode) lunx dev --debug # Specify config file path lunx build --config ./configs/lunx.prod.ts # Print help for any command lunx dev --help lunx security --help