Skip to content

CLI Reference

The wysna CLI provides an all-in-one toolchain for building, running, type-checking, and formatting Wysna code.

Terminal window
wysna [SUBCOMMAND] [OPTIONS]
Subcommand Description
wysna run <file> Compiles and executes a file or project in memory/temp workspace
wysna build [file] Compiles the source into a native binary or C99 translation unit
wysna check [file] Performs lexing, parsing, and type-checking without emitting code
wysna emit-mir <file> Lowers code to Mid-Level IR (MIR) and outputs the IR graph
wysna init [name] Scaffolds a new Wysna project with standard directory structure
wysna fmt [files] Formats source files according to Wysna style conventions
wysna env Displays compiler version, host architecture, and C backend info

Terminal window
# Basic build producing executable `app`
wysna build src/main.wysna -o app
# Release build with optimizations enabled (passed to Clang/GCC)
wysna build src/main.wysna -o app --opt-level 3
# Emit C99 source file instead of running the C compiler
wysna build src/main.wysna --emit-c -o output.c
# Target WASI (WebAssembly System Interface)
wysna build src/main.wysna --target wasi -o app.wasm

Fast feedback loop for IDEs and CI workflows:

Terminal window
wysna check src/main.wysna

Returns exit code 0 if all types and exhaustive match checks pass, or prints structured diagnostic spans with file and line coordinates upon failure.