lunx.docs
DocsCLI Reference

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 exec <tool> [args…]the tool's own

Run a Vite-based tool on lunx's engine: lunx exec storybook dev, lunx exec storybook build, lunx exec vitest run. The tool runs unchanged with vite (and Rollup, vite-node) pointing at lunx.

lunx dev--port <n> --host --https --open --cors

Start the development server with HMR. Meta-framework projects (SvelteKit, Nuxt, Remix, Astro…) run on lunx's plugin host.

lunx build--outDir <dir> --force --watch --lib [entry] --formats --name --dts

Build for production with Rolldown and Oxc (JS/TS) and LightningCSS (styles), with the security pipeline. Skips the build when nothing changed (--force rebuilds). --lib builds a library.

lunx preview--port <n> --host --https

Serve 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

bash
# 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

bash
# Standard production build (skipped when nothing changed)
lunx build

# Rebuild even if nothing changed
lunx build --force

# Custom output directory
lunx build --outDir public/build

# Rebuild on file changes
lunx build --watch

# Build a library: ES + CommonJS + .d.ts
lunx build --lib src/index.ts
lunx build --lib --formats es,cjs,umd --name MyLib

# Print how long each build phase takes
LUNX_TIMINGS=1 lunx build

Minification, source maps and the browser target are set in lunx.config.ts under build (see Configuration). See also Build Cache and Library Mode.

Environment variables

bash
LUNX_BUILD_CACHE=0   # skip the build cache for one build
LUNX_TIMINGS=1       # print build phase timings
LUNX_PLUGIN_HOST=0   # run a meta-framework's own CLI instead of lunx's plugin host

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.

CommandWhat it does
lunx security auditRuns all 8 security sub-commands in sequence. Returns exit code 1 on any violation to fail CI gates.
lunx security scanDeep-scan source files, env files, and configs for API keys, JWTs, AWS credentials, Stripe secrets, and private keys.
lunx security cveQuery the OSV (Open Source Vulnerability) database for CVEs in all installed packages. Highlights critical/high severity.
lunx security sbomGenerate a CycloneDX 1.5 Software Bill of Materials in JSON or XML. Satisfies SOC 2 and federal supply-chain requirements.
lunx security headersCompute SHA-384 SRI hashes for all output assets and inject them into index.html script and link tags.
lunx security fixInteractively upgrade vulnerable npm packages to safe version ranges. Shows diffs and requires confirmation.
lunx security pluginsVerify sandbox permissions of all installed plugins. Blocks plugins attempting unauthorized disk or network access.
lunx security reportCompile all audit results into a scored HTML or JSON report (0–100 security score). Suitable for compliance review.

Example security audit output

bash
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
CI integration
Add 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

bash
# Show version
lunx --version      # 1.2.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