Skip to content

CLI Reference

The Floe compiler is a single binary called floe.

Compile .fl files to TypeScript.

Terminal window
# Compile a single file
floe build src/main.fl
# Compile a directory
floe build src/
# Specify output directory
floe build src/ --out-dir dist/

The compiler automatically chooses .ts or .tsx based on whether the file contains JSX.

Type-check files without generating output.

Terminal window
floe check src/
floe check src/main.fl

Format .fl files in place.

Terminal window
floe fmt src/
floe fmt src/main.fl

The 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: name becomes name:)
  • Consistent spacing around operators

Run inline test blocks.

Terminal window
floe test src/
floe test src/math.fl

Discovers all test blocks in .fl files, compiles them in test mode, and executes them. Requires a TypeScript runner (tsx) to be installed.

Terminal window
npm install -g tsx

Watch files and recompile on change.

Terminal window
floe watch src/
floe watch src/ --out-dir dist/

Scaffold a new Floe project.

Terminal window
# In current directory
floe init
# In a new directory
floe init my-app

Creates:

  • src/main.fl - sample Floe file
  • tsconfig.json - TypeScript configuration

Start the language server on stdin/stdout.

Terminal window
floe lsp

Used by editor extensions. You don’t typically run this directly.

CodeMeaning
0Success
1Compilation error (parse or type error)
2File not found or I/O error
VariableDescription
FLOE_FILENAMEOverride the filename shown in diagnostics