CLI reference
Commands
cleat build [file|dir]
Compile to a native binary.
cleat build main.cleat— compile a single filecleat build myapp/— compile a directory (all.cleatfiles)cleat build— (no args) readcleat.tomlin current directory
Output binary name:
- Single file: derived from filename (e.g.,
main.cleat→main) - Directory: derived from directory name
- With
cleat.toml: uses[build] outputfield
cleat run [file|dir]
Compile and execute immediately. Same argument rules as build.
cleat test [file|dir]
Compile with test mode enabled and run all test blocks. Exit code 0 = all pass, 1 = failures, 2 = compilation error.
cleat check <file>
Type-check only. No compilation, no binary output. Useful for CI or editor integration.
cleat fmt [-w|-check] <paths...>
Format source code to canonical style.
| Flag | Behavior |
|---|---|
| (none) | Print formatted output to stdout |
-w | Rewrite files in place (atomic: temp + rename) |
-check | Print files that would change, exit 1 if any |
- | Read stdin, write stdout |
Recursion: directories are traversed, skipping .git, hidden files, and testdata.
cleat lex <file>
Debug tokenizer — prints each token. Development use only.
cleat lsp
Start the language server over stdin/stdout (JSON-RPC 2.0 with Content-Length framing). Used by the VS Code extension.
cleat new <name>
Scaffold a new project. Creates a directory with cleat.toml and main.cleat.
Name validation: lowercase letters, digits, hyphens, underscores only.
Global flags
--no-warn
Suppress warning and info-level diagnostics. Works with build, run, check, and test.
cleat build main.cleat --no-warn cleat test myapp/ --no-warn