Config reference
The wit.sources.json schema, the built-in env source, the
format catalogue, and the security model behind --allow-exec. Source: packages/cli/src/data-sources.ts, packages/runtime/src/data-loader.ts.
wit.sources.json
{
"sources": {
"<alias>": {
"run": ["program", "arg", "{{capture}}"],
"format": "json",
"timeoutMs": 30000
}
}
}| Field | Required | Meaning | Default |
|---|---|---|---|
| sources | yes | top-level object of aliases | — |
| alias.run | yes | non-empty argv array; first element is the program | — |
| alias.format | no | one of the seven formats | json |
| alias.timeoutMs | no | spawn timeout in ms | 30000 |
A missing or non-object sources → expected a top-level "sources" object. An empty or non-array run → source "run" must be a non-empty argv array.
Any {{name}} token in run is replaced by the matching
capture value (missing → empty string). Output cap: 16 MB.
Formats — 7
The value that crosses the seam from a program's stdout.
| Format | stdout becomes |
|---|---|
| json | parsed JSON — empty is null |
| csv | array of records; first row is the header |
| tsv | same but tab-delimited |
| lines | array of non-empty lines |
| text | the raw string |
| svg | the raw string |
| html | the raw string |
The built-in env source
No config needed. @load env load@ returns process.env merged with the --env dotenv file, as a
record; access it with dotted paths.
@load env load@ User is @env.USER
The dotenv parser reads KEY=value lines, treats # as
a comment, strips optional surrounding quotes, and skips blank or key-less lines.
The env source needs no --allow-exec.
Binding forms for load
| Form | Effect |
|---|---|
| body prose alias | names the source to load |
| from alias pipe | names the source explicitly |
| as name pipe | renames the resulting data def |
| any other named pipe | becomes a capture passed to the program |
@load results load@ @load sales |from warehouse| |as rows| |region West| load@
A @load with no resolvable alias → E_LOAD_FAILED(@load needs an alias). The def is named for the alias unless as renames it.
Security and capture-passing
| Rule | Behaviour |
|---|---|
| --allow-exec required | without it any non-env load throws |
| unknown alias | no source configured for that alias |
| child cwd | the document's directory |
| child env | the merged environment |
| captures via argv | name tokens substituted into run |
| captures via stdin | the full args object as JSON |
| non-zero exit or spawn error | surfaces as E_LOAD_FAILED at the load site |
See also
CLI· Data model · Tables · Errors.