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]

First Commands

CommandPurpose
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 serverRun the LSP server over stdio.

Examples:

./zynx build main.zx
./zynx run main.zx -- input.txt
./zynx test main.zx
./zynx format src

Projects And Packages

CommandPurpose
zynx new <name>Create a new project directory.
zynx initCreate zynx.json in the current directory.
zynx package checkValidate package state without fetching or editing the lockfile.
zynx fetchRestore 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.

Modules And SDKs

CommandPurpose
zynx module info <file.zxm>Inspect a module bundle.
zynx module verify <file.zxm>Validate bundle metadata.
zynx sdk listList 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.

Common Options

OptionPurpose
-o <file>Write output to a file.
--debugBuild without optimization and emit debug info.
--releaseBuild 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.
--staticLink 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.
--verbosePrint executed backend commands.
-h, --helpShow driver help.
-v, --versionShow the compiler version.

Dynamic module bundles can be built with --dynamic, but runtime loading with require(...) is experimental/internal and not normal source language.