CLI Reference
The Floe compiler is a single binary called floe.
Commands
Section titled “Commands”floe build
Section titled “floe build”Compile .fl files to TypeScript.
# Compile a single filefloe build src/main.fl
# Compile a directoryfloe build src/
# Specify output directoryfloe build src/ --out-dir dist/The compiler automatically chooses .ts or .tsx based on whether the file contains JSX.
floe check
Section titled “floe check”Type-check files without generating output.
floe check src/floe check src/main.flfloe fmt
Section titled “floe fmt”Format .fl files in place.
floe fmt src/floe fmt src/main.flThe formatter enforces a canonical style. Notable conventions:
- Blank line before the final expression in multi-statement blocks (visually separates the return value)
- Named arg punning (
name: namebecomesname:) - Consistent spacing around operators
floe test
Section titled “floe test”Run inline test blocks.
floe test src/floe test src/math.flDiscovers all test blocks in .fl files, compiles them in test mode, and executes them. Requires a TypeScript runner (tsx) to be installed.
npm install -g tsxfloe watch
Section titled “floe watch”Watch files and recompile on change.
floe watch src/floe watch src/ --out-dir dist/floe init
Section titled “floe init”Scaffold a new Floe project.
# In current directoryfloe init
# In a new directoryfloe init my-appCreates:
src/main.fl- sample Floe filetsconfig.json- TypeScript configuration
floe lsp
Section titled “floe lsp”Start the language server on stdin/stdout.
floe lspUsed by editor extensions. You don’t typically run this directly.
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Compilation error (parse or type error) |
| 2 | File not found or I/O error |
Environment
Section titled “Environment”| Variable | Description |
|---|---|
FLOE_FILENAME | Override the filename shown in diagnostics |