CLI Reference
Common zynx commands and options for running, testing, packaging, formatting, and SDK inspection.
The zynx driver accepts either a source/header input directly or a named
command.
zynx [options] <source.zx|header.h> [native-lib]
zynx <command> [options]
| Command | Purpose |
|---|---|
zynx build [source.zx] | Build an executable. |
zynx run [source.zx] [-- args...] | Build and run a program. |
zynx test <source.zx> | Build and run tests in one source file. |
zynx format [paths...] | Format .zx files. |
zynx server | Run the LSP server over stdio. |
Examples:
./zynx build main.zx
./zynx run main.zx -- input.txt
./zynx test main.zx
./zynx format src
| Command | Purpose |
|---|---|
zynx new <name> | Create a new project directory. |
zynx init | Create zynx.json in the current directory. |
zynx package check | Validate package state without fetching or editing the lockfile. |
zynx fetch | Restore locked dependencies into the package cache. |
zynx update [package] | Update unlocked dependencies and refresh zynx.lock. |
Package commands operate on zynx.json and zynx.lock; see
Packages for the manifest and lockfile
contract.
| Command | Purpose |
|---|---|
zynx module info <file.zxm> | Inspect a module bundle. |
zynx module verify <file.zxm> | Validate bundle metadata. |
zynx sdk list | List installed or available SDK roots. |
zynx sdk path --target <triple> | Print the SDK path for a target. |
zynx sdk doctor --target <triple> | Check target tool availability. |
zynx sdk install <archive.tar.gz> | Install a local SDK archive. |
| Option | Purpose |
|---|---|
-o <file> | Write output to a file. |
--debug | Build without optimization and emit debug info. |
--release | Build with release optimization. |
-O<level> | Set optimization level: 0, 1, 2, 3, fast, g, or s. |
--emit <kind> | Emit llvm-ir, llvm-bc, or object. |
--static | Link executable statically where supported. |
--target <triple> | Set architecture, platform, and ABI. |
--sdk <path> | Use a Zynx SDK root for SDK targets. |
--module-path <dir> | Add a module search path. |
--verbose | Print executed backend commands. |
-h, --help | Show driver help. |
-v, --version | Show the compiler version. |
Dynamic module bundles can be built with --dynamic, but runtime loading with
require(...) is experimental/internal and not normal source language.