Skip to main content
Variables can declare a type constraint. When set, Errand validates the value at run time and converts it to the declared type automatically.

Primitive types

Collection types

list

An ordered collection of values of the same type:

set

An unordered collection with unique values:

map

A collection of key-value pairs where all values share the same type:

object

A collection of named attributes with potentially different types:

tuple

An ordered list where each position has a fixed type:

Optional attributes

Use optional(type) or optional(type, default) within an object to mark fields as optional:
Fields declared with optional(type, default) use the given default when not provided. Fields declared with optional(type) default to null.

Omitting the type

Without a type, Errand accepts any value without validation:
When a value is passed from the command line with no declared type, it is always treated as a string.