Modules & imports
Importing stdlib packages
cleat
import "std/io" import "std/json" import "std/http"
Use imported functions with the package name as qualifier:
cleat
io.println("hello") let encoded = json.encode(my_struct) let resp: http.Response = http.get("https://api.example.com")?
Standard library packages
| Package | Description |
|---|---|
std/io | Console output (print, println) |
std/strings | 19 string manipulation functions |
std/json | JSON encode, decode, pretty-print, validate |
std/math | Numeric utilities (abs, min, max, sqrt, pow, ...) |
std/http | HTTP client (GET, POST, custom requests) |
std/fs | File system operations |
std/env | Environment variable access |
std/log | Leveled logging to stderr |
std/os | Process args, exit, getwd, hostname |
std/crypto | SHA-256 hashing, hex encoding |
std/time | Wall-clock access, deterministic test clocks |
std/llm | LLM prompt, stream, structured output |
std/server | HTTP server types and response helpers |
std/supervisor | Supervised agent execution with retry/timeout/tracing |
std/memory | Persistent key-value store with namespaces |
See the Standard Library Reference for complete API documentation.
Project structure
Cleat projects use cleat.toml for configuration:
toml
[project] name = "my-app" version = "0.1.0" entry = "main.cleat" [build] output = "my-app"
Build commands:
cleat build— readscleat.toml, compilesentry, outputs binary namedoutputcleat build file.cleat— compiles a single file (ignores manifest)cleat build directory/— compiles all.cleatfiles in the directory as a package