Zornux docs
Get started Spec

Reference

Command Line

The zornux command runs, checks, compiles, serves, formats, tests, documents, and debugs your programs — plus an interactive REPL, a package manager, and a language server.

Commands

CommandWhat it does
zornux run <file>Run a program with the tree-walking interpreter.
zornux vm-run <file>Run a program with the bytecode virtual machine.
zornux check <file>Validate a program without running it.
zornux build <file>Compile to a .zxbc build artifact.
zornux disassemble <file>Print human-readable bytecode (--optimized shows what the VM runs).
zornux serve <file>Run a web-service program and serve it.
zornux format <file>Reformat source — to stdout, or in place with --write.
zornux replStart an interactive session with persistent state.
zornux test [path]Run test / expect tests.
zornux doc [path]Generate Markdown or HTML API documentation.
zornux debug <file>Debug a program interactively in the terminal.
zornux dap <file>Start a Debug Adapter Protocol server for editors.
zornux lspStart the language server for editor support (JSON-RPC over stdio).
zornux init / add / remove / restoreScaffold a project and manage package dependencies.
zornux list packagesList the resolved dependency set.
zornux pack / publishPackage the project, and publish to a registry.
zornux registry / search / info / loginConfigure registries, discover packages, and authenticate.
zornux db <inspect|schema|test-connection|migrate|rollback|status|check>Inspect and evolve the database schema.
zornux config <show|validate>Print resolved settings, or validate config files.
zornux deploy <what> <file>Generate deployment artifacts (docker/service/proxy/config/manifest/all).
zornux deploy status <file>Probe a running pool: how many replicas are serving, draining, or failed.
zornux profile <mode> <file>Profile hot spots, allocations, the heap, a timeline, or a live server.
zornux capabilitiesReport product version, protocol versions, and supported features.

A quick tour

bash
zornux run hello.zx             # run a program
zornux check app.zx             # validate without running
zornux build app.zx             # compile to app.zxbc
zornux serve product_api.zx     # run + serve a web service
zornux format app.zx --write    # reformat in place
zornux test                     # run the project's tests
zornux doc                      # generate API docs into docs/api
zornux debug app.zx             # interactive debugger
zornux repl                     # interactive session

Options

OptionMeaning
--jsonEmit machine-readable JSON output.
--verbosePrint extra detail.
--no-colorDisable colored output.
--write(format) overwrite the file in place.
--allowed-file-root <dir>The only folder file built-ins may use.
--identity <name>Principal name for the run's security context.
--role <role>Grant a role (repeatable).
--permission <perm>Grant a permission (repeatable).
--max-loop-iterations <n>Override the loop safety limit.
--no-migrateOpen databases without running migrations — for a least-privilege runtime login with no DDL rights; apply schema separately with zornux db migrate.
--filter <text>(test) run only tests whose name matches.
--fail-fast(test) stop at the first failing test.
--time-limit <ms>(test) per-test time budget in milliseconds (default 5000).
--debug(test) drop into the debugger on the first failure.
--format markdown|html|openapi(doc) documentation output format.
--output <dir>(doc) documentation output folder.
--include-private(doc) document non-public symbols too.
--include-tests(doc) document tests as specifications.
--include-packages(test/doc) include package dependencies.
--fail-on-missing-comments(doc) error on undocumented public symbols.

Diagnostics

Errors are located and beginner-friendly by default:

text
error ZX0700

file.zx:1:6
show username
     ^^^^^^^^

I don't know what 'username' is — it was never created.
help: create it first, e.g. create username = …

Add --json for the machine-readable diagnostic standard (great for CI and editors).

Security from the command line

--identity, --role, and --permission build the run's security context, so you can test restrict to … locally without a web request.

bash
zornux run guarded.zx                 # anonymous → restricted branch runs
zornux run guarded.zx --role Admin    # authorized → protected code runs

The REPL

State persists across lines, and multi-line blocks keep reading until end:

text
zornux> create x = 5
zornux> x + 3
8
zornux> function greet with n
...      give back "Hi " + n
...   end
zornux> greet("Ada")
Hi Ada
zornux> exit

Exit codes

CodeMeaning
0Success.
1Error diagnostics (syntax, compile, or runtime).
2Invalid command-line usage.
3Source file not found.
4Web host failed to start (or nothing to serve).
5Unexpected internal error.
Build artifact

zornux build writes a portable .zxbc build artifact containing the compiled program, its service metadata, and version stamps.

Built for scale

Zornux stays fast and predictable as a program grows — from a one-line script to a long-running service. Everyday values are shared where it's safe to, collections and members are looked up once and reused, and recursion and resource use are bounded — so package-heavy projects and object- and query-heavy code hold up under load, without you tuning anything.

Editor support

zornux lsp starts a Language Server that speaks JSON-RPC over stdin/stdout, so any LSP-compatible editor gets live diagnostics, completion, hover, go-to-definition, find references, rename, signature help, document symbols, folding, and semantic highlighting. Point your editor's LSP client at the zornux lsp command for .zx files:

js
# Example: a minimal VS Code language client
const serverOptions = { command: "zornux", args: ["lsp"] };
const clientOptions = {
  documentSelector: [{ language: "zornux", pattern: "**/*.zx" }],
};

Neovim, Helix, Sublime, and Emacs configure the same command. The server is editor-independent.

Debugging

zornux dap starts a Debug Adapter Protocol server so any DAP editor gets breakpoints, stepping, variable inspection, and watches. zornux debug is an interactive terminal debugger. See the debugger guide.

Projects, packages, tests & docs

Point run, test, doc, and the rest at a directory or a zornux.project file to work on a whole multi-file project. zornux init, add, restore, pack, and publish manage package dependencies and a local registry; zornux test runs your tests; and zornux doc generates API documentation.