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

PackageDescription
std/ioConsole output (print, println)
std/strings19 string manipulation functions
std/jsonJSON encode, decode, pretty-print, validate
std/mathNumeric utilities (abs, min, max, sqrt, pow, ...)
std/httpHTTP client (GET, POST, custom requests)
std/fsFile system operations
std/envEnvironment variable access
std/logLeveled logging to stderr
std/osProcess args, exit, getwd, hostname
std/cryptoSHA-256 hashing, hex encoding
std/timeWall-clock access, deterministic test clocks
std/llmLLM prompt, stream, structured output
std/serverHTTP server types and response helpers
std/supervisorSupervised agent execution with retry/timeout/tracing
std/memoryPersistent 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:

Edit this page on GitHub