Skip to content

The flux binary is the developer CLI for the Flux UI language: it scaffolds projects, runs the hot-reload dev server, codegens native apps, and inspects the stdlib and environment. The surface below is generated from the CLI’s command definitions in crates/flux-cli.

Terminal
flux <command> [flags]
Command Purpose
flux init <name> Scaffold a new Flux project at <name>/
flux dev Start the hot-reload dev server
flux build <platform> Codegen the project for a native platform
flux lsp <file> Emit parse + type-check diagnostics as JSON
flux fmt [files…] Format .flux sources to canonical style
flux doc Emit a JSON schema of the stdlib API
flux doctor Run the environment health check

Scaffolds <name>/ with main.flux (a stateful counter component), flux.toml, and .fluxignore.

Argument Value
name Project name; also the directory that is created
Flag Default Description
--root <path> . Project root to watch and serve
--ws-host <addr> 127.0.0.1 WebSocket bind host; 0.0.0.0 exposes the LAN
--ws-port <port> 7331 WebSocket patch channel
--http-port <port> 7332 HTTP asset server
--token <secret> unset Require the token in the host Hello handshake

Hosts authenticate with the token read from FLUX_DEV_TOKEN or [dev] token in flux.toml. Without --token, localhost keeps an open dev loop. See the dev server guide for the operational details.

Argument / flag Values Description
platform ios, android Target platform (positional)
--root <path> . Project root to build

Emits generated sources to platforms/<platform>/Generated/ (main.swift / main.kt), then invokes the native toolchain when present.

Argument / flag Default Description
file required The .flux source file to analyze
--no-types off Parse diagnostics only — the fast path for large files

Prints parse and type-check diagnostics as JSON; every diagnostic carries a span and an optional hint.

Argument / flag Default Description
files… main.flux Files to format; with no paths, formats main.flux in the project root
--check off Verify without writing; exits non-zero when a file would change (CI gating)

No flags. Prints the JSON schema of the stdlib API to stdout — the source-of-truth surface behind the stdlib reference.

Flag Default Description
--strict off Exit non-zero on advisory findings so the command can gate a pre-commit hook

Checks toolchain state, stdlib parse health, wire protocol version, and (best-effort) connected devices and simulators, plus the local structural checks: approved-dependency drift and house-rule violations.

Variable Used by Purpose
FLUX_DEV_TOKEN Host apps Pairing token for the dev server Hello handshake
RUST_LOG CLI Tracing filter; defaults to info
NO_COLOR CLI Disables ANSI colors in output