Skip to content

CLI reference

rite [flags...] [task...] [KEY=value...]

Runs the named task(s), passing any KEY=value pairs as CLI-tier vars (tier 2). With no task, runs default.

Most-used flags

FlagWhat it does
-i, --initWrite a starter Ritefile.yml in the current dir
-l, --listList tasks with descriptions
-a, --list-allList all tasks (including undescribed)
-j, --jsonJSON output for --list/--list-all
-w, --watchRerun the task when its sources: change
-v, --verboseLog var resolution, execution steps, etc.
-s, --silentSuppress command echo
-f, --forceForce the task to run even if sources are unchanged
-d, --dir DIRSet the Ritefile's working directory
-t, --taskfile FILEPoint at an explicit Ritefile
--set KEY=valueExplicit form of the positional KEY=value
--dryShow what would run, don't execute
--statusNon-zero exit if any named task is not up-to-date
--migrate [FILE]Convert a go-task Taskfile to a Ritefile. See Migration
--completion SHELLPrint completion script (bash, zsh, fish, powershell)
--experimentsList experiment flags
--versionPrint version

Full list: rite --help.

Passing variables

Three ways, in precedence order:

sh
FOO=bar rite build             # 1. Shell env — tier 1 (wins over everything)
rite build FOO=bar             # 2. CLI positional — tier 2
rite --set FOO=bar build       # 3. CLI flag form — same as tier 2

Passing args to the task itself

Anything after -- is available in the task as CLI_ARGS:

sh
rite run -- --dry-run --verbose
yaml
tasks:
  run:
    cmds:
      - myprogram {{.CLI_ARGS}}

CLI_ARGS (and the other CLI_* specials) are marked non-export, so they're visible inside Ritefile templating but don't leak into the process environ of cmd shells.

Exit codes

CodeMeaning
0Success
1Generic error (task failed, typo, etc.)
100-115Ritefile-parse / format errors (see errors/errors.go)
200-201Task-runtime errors (exit is the wrapped cmd's code + 200)

Pass -x / --exit-code to have rite exit with the failing cmd's exact code instead of the 200+ wrapped form.

Environment variables rite reads

VarPurpose
RITE_COLOR_RESETDisable ANSI color output
RITE_TEMP_DIROverride the .task cache directory
RITE_REMOTE_DIROverride the remote-taskfile cache directory
RITE_X_*Enable experiment flags (e.g. RITE_X_ENV_PRECEDENCE=1)
NO_COLORSame as RITE_COLOR_RESET

Task-declared variables reach cmd shells through the process environ by default (see syntax §Non-exported).

MIT licensed · hard fork of go-task