Parameters
How tasks take input. Part of the guides; full syntax in the language guide.
Concept
Section titled “Concept”A task can accept parameters: defaulted, required, or variadic. Parameters are
interpolated into the body with {{ }}, and they also define the input schema when the task
is exposed to an agent over MCP.
Syntax
Section titled “Syntax”# Defaulted — rune greet / rune greet Adagreet name="world": @echo "hello "{{quote(name)}}
# Required — rune deploy proddeploy env: @echo "deploying to "{{quote(env)}}
# Variadic — one-or-more (+) and zero-or-more (*)test +packages: @echo go test {{quote_each(packages)}}
# Raw: the value is split into shell words on purpose. rune check "-v -race"check flags:raw="-v -race": @echo go test {{flags}} ./...Run them: rune greet Ada, rune deploy prod, rune test ./... ./cmd/....
quote_each(packages) passes each package as its own quoted argument, so a path
that contains a space stays one argument. flags:raw declares that the value is meant to
be split into words, so rune check "-v -race" passes two flags.
Runnable example
Section titled “Runnable example”See examples/parameters.
Pitfalls
Section titled “Pitfalls”- Required parameters are checked before anything runs. Calling a task (or depending on
one) with too few arguments fails static analysis with an arity error and exit code
3— e.g.task "greet" expects at least 1 argument(s), got 0. See Troubleshooting. - A variadic must be last. Only the final parameter may be
+/*. - Quote values with spaces on the command line, as your shell requires.
- Interpolate parameters with
quote().{{name}}pastes the value into the command as shell text, so a space, quote, or;in it changes the command, even inside shell quotes.rune analyzewarns about this (RUNE2017). Write{{quote(name)}}, or{{quote_each(name)}}for a variadic, outside any shell quotes; declarename:rawwhen you want the value split into words. See Quoting parameters.
Next steps
Section titled “Next steps”- Dependencies & post-hooks — pass arguments to a dependency.
- Settings & dotenv — values that aren’t per-invocation arguments.