CLI Reference
The glyx CLI scaffolds projects, runs the dev server, and produces production builds and installers.
glyx create <name> [--native] [--template <t>] Scaffold a new project
glyx dev [--inspect [port]] Dev server with hot reload
glyx build [target] [mode flags] Production build
glyx package [target] [--installer] Distributable archive/installer
glyx runtime list|build|install Manage cached glyx-runner binaries
glyx generate command|plugin <name> Generate boilerplate
glyx check [--config-only] Type-check without building
glyx test [--js] [--rust] Run JS and/or Rust testsPackage manager support
Glyx works with npm, pnpm, yarn, and bun — no configuration needed. It detects your package manager automatically from the lockfile in your project directory:
| Lockfile | Detected as |
|---|---|
bun.lock / bun.lockb | bun |
pnpm-lock.yaml | pnpm |
package-lock.json | npm |
yarn.lock | yarn |
If no lockfile is present, Glyx checks for a "packageManager" field in package.json (the corepack (opens in a new tab) standard), then probes PATH for bun, pnpm, and npm in that order.
You can also override detection explicitly:
# force a specific package manager for this invocation
glyx build --pm npm
glyx dev --pm pnpmOr set it permanently in glyx.config.ts:
export default defineConfig({
packageManager: 'npm', // 'npm' | 'pnpm' | 'yarn' | 'bun'
// ...
})Bundling always uses esbuild (a peer dep of @glyx-dev/react) regardless of which package manager you use, so build output is identical across all PMs.
glyx create
glyx create my-app
glyx create my-app --template dashboard
glyx create my-app --nativeScaffolds a new project. By default this is a JS-only project — no Rust toolchain required; the app runs on a prebuilt glyx-runner binary.
| Flag | Description |
|---|---|
--native | Generate a full Rust workspace (Cargo.toml + src/main.rs). Required if you want to add custom native extensions (glyx generate command). Needs the Rust toolchain. |
--template <t> | Starter template. Default: blank. |
Templates
| Template | Contents |
|---|---|
blank | Minimal counter app with the Glyx logo (default) |
notes | Sidebar + content layout with navigation |
dashboard | Stat cards, sidebar nav, data display |
settings | Preferences panel with sections and toggles |
Every template generates js/app.jsx, glyx.config.ts, package.json, and .gitignore. After creating:
cd my-app && npm install && glyx devglyx dev
glyx dev
glyx dev --inspect # CDP inspector on port 9229
glyx dev --inspect 9333 # custom portBuilds the JS bundle, opens the native window, and watches for changes — reloads are typically under 100ms.
| Flag | Description |
|---|---|
--inspect [port] | Enable the Chrome DevTools Protocol inspector (default port 9229). Open chrome://inspect in Chrome and add 127.0.0.1:<port> under "Discover network targets" to debug JS with breakpoints. |
For JS-only projects, dev launches the cached dev runner (hot reload built in). For --native projects it runs cargo run so your Rust extensions are compiled in.
glyx build
glyx build # snapshot mode (default)
glyx build --bundle
glyx build --portable
glyx build windows # cross-target
glyx build --check-performance # build + verify frame budgetProduces a release binary in target/release/.
Build modes
| Mode | Flag | What ships | Trade-off |
|---|---|---|---|
| Snapshot | (default) | One self-contained exe — V8 snapshot + app JS + config embedded | Fastest startup (~50ms V8 restore); JS updates require a rebuild |
| Bundle | --bundle | Binary + minified js/app.js alongside | Update JS by replacing one file, no recompile |
| Portable | --portable | Binary + readable JS files alongside | Easiest to patch/debug in the field |
For JS-only projects, snapshot mode appends the payload to the cached prod runner as a binary trailer — no cargo invocation at all.
Performance gate
| Flag | Default | Description |
|---|---|---|
--check-performance | off | After building, launch the app and measure frame times |
--perf-budget <ms> | 16.667 | Frame-time budget (60fps) |
--perf-duration <s> | 10 | How long to run the check |
The build fails (exit 1) if any frame exceeds the budget — useful in CI:
glyx build --check-performance --perf-budget 8.33 # enforce 120fpsCross-compilation
Pass a target OS: glyx build windows, glyx build linux, glyx build macos. The Rust target is installed automatically if missing. For JS-only snapshot builds, the runner binary must match the target platform — build it on the target machine with glyx runtime build and copy it to ~/.glyx/runners/prod/.
glyx package
glyx package # zip (Windows), tar.gz (Linux), .app (macOS)
glyx package --installer # NSIS .exe / AppImage / DMGWraps the built binary into a distributable. Run glyx build first.
| Platform | Default | --installer |
|---|---|---|
| Windows | .zip | NSIS Setup .exe (NSIS auto-downloaded and cached on first use) |
| macOS | .app bundle | .dmg (via built-in hdiutil) |
| Linux | .tar.gz | AppImage (requires appimagetool) |
Packaging also handles:
- Icon — converts your configured PNG to
.ico/.icnsand embeds it in the exe (via cachedrcedit). If no icon is configured, the default Glyx logo is used so every package has a proper icon. - Deep links — if
deeplink.schemeis set in config, the URL scheme is registered (Windows registry / macOSInfo.plist/ Linux.desktopfile). - Add/Remove Programs — the Windows installer writes uninstall registry entries, Start Menu and Desktop shortcuts.
- Licenses — bundles
LICENSES/(your app license + Glyx's) into the package. - Capability modules — any
glyx_cap_*.dll/.so/.dylibpresent in the project root are copied into the dist folder and their SHA-256 hashes are written toglyx-caps.locknext to the binary. The runtime verifies these hashes on every launch — a tampered module is refused at startup. Commitglyx-caps.lockto source control.
Output lands in target/glyx/dist/.
glyx runtime
Manages the prebuilt glyx-runner binaries that JS-only projects run on.
glyx runtime list # show cached runners (dev + prod) and sizes
glyx runtime build # build both runners from source and cache them
glyx runtime install # install a runner (currently builds from source)Runners are cached in ~/.glyx/runners/{dev,prod}/. The dev runner includes hot reload and the dev overlay; the prod runner is lean.
glyx generate
glyx generate command fetchUser # native Rust backend command
glyx generate plugin analytics # JS plugin| Generator | Creates | Use from JS |
|---|---|---|
command <name> | src-glyx/commands/<name>.rs — typed async handler (requires a --native project) | await backend.fetchUser(args) |
plugin <name> | src/plugins/<name>.plugin.js — async exports, plus the config snippet for glyx.config.json | via the plugin namespace |
See JS Plugins for the full plugin workflow, and Native Extensions for Rust commands.
glyx check
glyx check # validate config + TS types + Rust
glyx check --config-only # only validate glyx.config.tsFast validation without doing a full build. Useful as a pre-commit hook or in CI before glyx build.
What it checks:
| Step | Condition | What runs |
|---|---|---|
| Config | always | Resolves glyx.config.ts to JSON; checks dev.entry exists |
| TypeScript | tsconfig.json present | tsc --noEmit (via your package manager) |
| Rust | native project | cargo check (type-checks without linking — much faster than cargo build) |
# CI pipeline
glyx check && glyx buildglyx check exits 1 if any step fails and prints a summary.
glyx test
glyx test # run all tests (JS + Rust if native)
glyx test --js # JS only
glyx test --rust # Rust only (native projects)
glyx test -- --watch # pass extra flags to the JS test runner| Flag | Description |
|---|---|
--js | Run only JS tests |
--rust | Run only cargo test (native projects) |
-- <args> | Extra args forwarded to the JS test runner or cargo test |
For JS tests, Glyx looks for test files in js/src/, js/, or src/ (first one that exists). Tests use the @glyx-dev/testing package which stubs all native bindings — they run without a native window. bun has a built-in test runner; for npm/pnpm/yarn, Glyx runs the "test" script from your package.json.
# Run JS tests in watch mode (bun)
glyx test --js -- --watch
# Run a specific test file (bun)
glyx test --js -- js/src/__tests__/store.test.js
# Run Rust tests with output
glyx test --rust -- --nocaptureFor more on writing tests, see Testing and @glyx-dev/testing.
Every command must run from the project root (where glyx.config.ts or package.json lives). Tools the CLI needs (NSIS, rcedit) are downloaded once and cached in ~/.glyx/tools/.