CLI reference

Commands

cleat build [file|dir]

Compile to a native binary.

Output binary name:

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.

FlagBehavior
(none)Print formatted output to stdout
-wRewrite files in place (atomic: temp + rename)
-checkPrint 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.

bash
cleat build main.cleat --no-warn
cleat test myapp/ --no-warn
Edit this page on GitHub