docs / cli

Command-line interface

The fx binary in bin/ is the compiler and driver for the language package.

Everyday commands

CommandPurpose
fx doctorCheck C toolchain + zspec paths
fx versionPrint version (expect v0.7.1)
fx helpShow help
fx new <name>Create a project from a scaffold
fx check <file.fx>Parse and typecheck
fx run <file.fx>Emit C, link, run
fx build <file.fx>Emit C and link (do not run)
fx emit-c <file.fx> -o <dir>Emit .c / .h only

fx doctor

Reports whether gcc, clang, and/or zig are on your PATH, and whether zspec headers/libraries can be found by walking up from the current directory. Exit code 0 if at least one C toolchain is found.

fx new

fx new hello
fx new tiny --scaffold minimal
fx new firmware --scaffold embedded
ScaffoldIntent
simple (default)Named region + import std/vec; stages std/
minimalBare main returning 42
embeddedTiny arena footprint; builtin vec_*; no staged std/

fx run / fx build

fx run main.fx
fx run main.fx --release
fx build main.fx -o out
FlagMeaning
-o <dir>Output directory (default out/)
--releaseOptimize more; less debug instrumentation
--watchRebuild when sources change
--no-zspecDo not link zspec (only when appropriate)
--host <file.c>Use this C file as main; link fx objects with it
--link-args-fileExtra linker args, one per line
--link-include / --link-dir / --link-libExtra include/lib paths

Default linking expects gcc and the zspec library that matches your OS (build/gcc or build/gcc-linux).

fx emit-c

fx emit-c main.fx -o out_c

Agent / editor helpers

CommandRole
fx lspLanguage server (stdio)
fx mcpLean MCP server (fx_check, fx_locate, fx_run, …)
fx locate --c-file <f.c> --line <n>Map a C line back to fx via .fxmap

Exit codes

Application main return values become process exit codes when you fx run (the simple scaffold returns 42). Tooling failures use non-zero codes. fx doctor exits 1 when no C toolchain is found.