Skip to Content
Filters and functions

Filters and functions

threads: ${opt:threads, 2 | Number | oneOf(1, 2, 4)} upper: ${opt:name, "demo" | toUpperCase}
FilterPurpose
StringCoerce to string.
NumberValidate and coerce numeric values.
BooleanValidate and coerce common boolean strings.
ArrayParse arrays and comma-separated lists.
ObjectParse JSON/JSON5 object strings.
JsonParse JSON.
oneOf(...)Restrict values to an allowed set.
help(...)Add prompt and requirements metadata.

Functions include split, join, length, merge, upperKeys, and md5. See debug resolution for failure behavior and requirements schema for how filters appear in metadata.

Standalone references preserve non-string types where the source resolves to a number, boolean, array, or object. Interpolated strings become strings unless a filter explicitly parses or coerces them.

port: ${opt:port, 5432 | Number} enabled: ${opt:enabled, true | Boolean} labels: ${opt:labels, '["api","prod"]' | Json} description: service-${opt:stage, "dev"}

help(...) is intentionally an identity filter: it contributes requirements/setup metadata but returns the original value. Use it beside type filters when humans or agents need better prompts.

Last updated on