🚧 Glyx is pre-release software. APIs may change before v1.0. Get started →
Documentation
CLI Reference

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 tests

Package 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:

LockfileDetected as
bun.lock / bun.lockbbun
pnpm-lock.yamlpnpm
package-lock.jsonnpm
yarn.lockyarn

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 pnpm

Or 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 --native

Scaffolds a new project. By default this is a JS-only project — no Rust toolchain required; the app runs on a prebuilt glyx-runner binary.

FlagDescription
--nativeGenerate 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

TemplateContents
blankMinimal counter app with the Glyx logo (default)
notesSidebar + content layout with navigation
dashboardStat cards, sidebar nav, data display
settingsPreferences 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 dev

glyx dev

glyx dev
glyx dev --inspect          # CDP inspector on port 9229
glyx dev --inspect 9333     # custom port

Builds the JS bundle, opens the native window, and watches for changes — reloads are typically under 100ms.

FlagDescription
--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 budget

Produces a release binary in target/release/.

Build modes

ModeFlagWhat shipsTrade-off
Snapshot(default)One self-contained exe — V8 snapshot + app JS + config embeddedFastest startup (~50ms V8 restore); JS updates require a rebuild
Bundle--bundleBinary + minified js/app.js alongsideUpdate JS by replacing one file, no recompile
Portable--portableBinary + readable JS files alongsideEasiest 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

FlagDefaultDescription
--check-performanceoffAfter building, launch the app and measure frame times
--perf-budget <ms>16.667Frame-time budget (60fps)
--perf-duration <s>10How 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 120fps

Cross-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 / DMG

Wraps the built binary into a distributable. Run glyx build first.

PlatformDefault--installer
Windows.zipNSIS Setup .exe (NSIS auto-downloaded and cached on first use)
macOS.app bundle.dmg (via built-in hdiutil)
Linux.tar.gzAppImage (requires appimagetool)

Packaging also handles:

  • Icon — converts your configured PNG to .ico/.icns and embeds it in the exe (via cached rcedit). If no icon is configured, the default Glyx logo is used so every package has a proper icon.
  • Deep links — if deeplink.scheme is set in config, the URL scheme is registered (Windows registry / macOS Info.plist / Linux .desktop file).
  • 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/.dylib present in the project root are copied into the dist folder and their SHA-256 hashes are written to glyx-caps.lock next to the binary. The runtime verifies these hashes on every launch — a tampered module is refused at startup. Commit glyx-caps.lock to 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
GeneratorCreatesUse 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.jsonvia 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.ts

Fast validation without doing a full build. Useful as a pre-commit hook or in CI before glyx build.

What it checks:

StepConditionWhat runs
ConfigalwaysResolves glyx.config.ts to JSON; checks dev.entry exists
TypeScripttsconfig.json presenttsc --noEmit (via your package manager)
Rustnative projectcargo check (type-checks without linking — much faster than cargo build)
# CI pipeline
glyx check && glyx build

glyx 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
FlagDescription
--jsRun only JS tests
--rustRun 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 -- --nocapture

For 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/.