docs / cli
Command-line interface
The fx binary in bin/ is the compiler and driver for the language package.
Everyday commands
| Command | Purpose |
|---|---|
fx doctor | Check C toolchain + zspec paths |
fx version | Print version (expect v0.7.1) |
fx help | Show 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
| Scaffold | Intent |
|---|---|
simple (default) | Named region + import std/vec; stages std/ |
minimal | Bare main returning 42 |
embedded | Tiny 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
| Flag | Meaning |
|---|---|
-o <dir> | Output directory (default out/) |
--release | Optimize more; less debug instrumentation |
--watch | Rebuild when sources change |
--no-zspec | Do not link zspec (only when appropriate) |
--host <file.c> | Use this C file as main; link fx objects with it |
--link-args-file | Extra linker args, one per line |
--link-include / --link-dir / --link-lib | Extra 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
| Command | Role |
|---|---|
fx lsp | Language server (stdio) |
fx mcp | Lean 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.