Skip to content

HTTP and process

Use this when making HTTP requests, spawning child processes, or wiring external endpoints as typed ilo functions.

HTTP and process-spawn builtins require the native binary. They are not available in the npm/WASM build.

FunctionSignatureDescriptionExample
gett > R t tHTTP GET (returns Result)get "https://..."
gett M > R t tHTTP GET with headersget url headers
pstt t > R t tHTTP POST (url, body). Renamed from post in 0.12.0pst url body
pstt t M > R t tHTTP POST with headerspst url body headers
runt L > R (M t t) tSpawn cmd with argv list. No shell, no glob.run "git" ["status"]
$t L > R (M t t) trun shorthand (sugar for run)$"git" ["status"]
envt > R t tRead environment variableenv "API_KEY"

In 0.12.0 the $ sigil was rebound from HTTP get (parochial — $ for HTTP is unique to ilo) to the new run builtin (argv-list process spawn). $cmd argv compiles to run cmd argv. HTTP get is still called by name.

post was renamed to pst to bring it into line with the I/O compression family (rd, wr, srt, flt, fld, fmt). The old name no longer resolves; the verifier surfaces a did-you-mean hint pointing at pst.

run cmd argv is the only process-spawn primitive. The first argument is the program (text), the second is the argv list (L t), and the result is a Result whose Ok carries a three-key Map of stdout / stderr / code as text.

ilo
r=run "echo" ["hi"]
-- Ok({"stdout":"hi\n","stderr":"","code":"0"})
$"git" ["status" "--short"]
-- equivalent: $ is the sigil shortcut for run

No shell, no interpolation, no glob. The argv list is passed directly to std::process::Command::args. There is no sh -c, no string concatenation between cmd and argv, and no glob expansion. This is the principled defence against shell injection.

Non-zero exit is NOT an error. Err is reserved for spawn failures (command not found, permission denied, output cap exceeded). A child that returns a non-zero exit code surfaces as Ok({"stdout":..., "stderr":..., "code":"<n>"}); the caller inspects code and branches.

Captured output is capped at 10 MiB per stream. Either stream exceeding the cap returns an Err rather than partial capture.

Inherits parent env + cwd. No override knobs in v1. Stdin is /dev/null.

ilo
fetch url:t>R t t;get url

Auto-unwrap with ! propagates errors automatically:

ilo
f url:t>R t t;r=get! url;~r

See Error Handling for full details on ! and Result types.

Tool declarations let you wire external HTTP endpoints as typed ilo functions. Create a tools.json file:

JSON
{
"tools": {
"weather": {
"url": "https://api.example.com/weather"
},
"lookup": {
"url": "https://api.example.com/lookup"
}
}
}

Each key is the tool name. The value must include a url field.

Shell
ilo --tools tools.json 'get-weather city:t>R t t;weather city' "London"

Tools are type-checked at load time, the agent cannot call a tool with the wrong parameter types.

See also Tools for MCP integration.