-
-
Notifications
You must be signed in to change notification settings - Fork 0
Task Syntax
A Runefile consists of metadata attributes, task signatures, and indented command bodies.
#[Task description]
#[confirm: Confirmation prompt]
task_name [arguments...] [--flags...] [*passthrough] : [dependencies...]
command 1
command 2
| Element | Description |
|---|---|
#[...] |
Metadata — attaches description or safety prompt to the next task |
# |
Comment — ignored entirely |
| Signature | Non-indented line ending with : (or : dep1 dep2) |
| Commands | Lines indented with 4 spaces or a tab |
{{var}} |
Interpolation — expands to the resolved argument or flag value |
Arguments belong directly in the task signature.
greet name:
echo "Hello, {{name}}!"
rune greet Supian
# Output: Hello, Supian!If a required argument is omitted, Rune displays an actionable error:
✗ Missing argument: name
Usage:
rune greet <name>
Assign a default value using = (supports quoted or unquoted values):
build target="dev":
echo "Building for target: {{target}}"
rune build
# Output: Building for target: dev
rune build production
# Output: Building for target: productionNote: Required arguments must always precede default arguments in the signature.
Declare optional boolean flags using --<name>?:
build target="dev" --race?:
go build {{race}} ./...
rune build
rune build --race
rune build production --raceWhen --race is passed, {{race}} expands to --race. When omitted, it expands to nothing.
If you mistype a flag, Rune calculates edit distance and suggests the intended option:
rune build --rce✗ Unknown option: --rce
Did you mean:
--race
When an underlying tool accepts arbitrary arguments or flags, declare an explicit passthrough parameter using *<name> (conventionally *args):
#[Forward arbitrary commands to Docker Compose]
compose *args:
docker compose {{args}}
rune compose exec api sh -c "echo 'Health check'" --user=rootThe underlying command receives each argument and flag intact — quotation marks remain a single discrete argument and unknown flags are not forwarded unless *args is explicitly declared.
Rune attaches the child process directly to your terminal's stdin, stdout, and stderr:
-
Interactive Tools: Commands like
bash,python,psql,ssh,vim, orhtoprun natively. - Arrow Keys & Shortcuts: Interactive navigation and control keys work out-of-the-box.
-
Signal Forwarding:
SIGINT(Ctrl+C),SIGTERM, andSIGHUPare forwarded to child processes. - Exit Code Preservation: The exact exit code of the underlying command is propagated back to your shell.
Tasks seamlessly participate in standard Unix pipes:
cat dump.sql | rune db:import
rune compose ps | grep runningRune Documentation