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.

Listing and inspecting tasks

--list and --list-all produce a per-task summary suitable for grep-ing or piping to a fuzzy-finder.

sh
$ rite --list
task: Available tasks for this project:
* build:        Build the binary
* test:         Run the test suite
* lint:         golangci-lint

--list shows only tasks with a desc: field. --list-all includes everything — even internal-by-convention _helper style tasks (but not tasks marked internal: true; those are hidden from both).

JSON form for tooling:

sh
rite --list --json
rite --list-all --json

The JSON is stable enough to script against — task name, description, aliases, location.

--summary for a single task

--summary <task> prints the long description (the task's summary: field, falling back to desc: if no summary: is set), plus its declared dependencies:

sh
$ rite --summary deploy
task: deploy

Deploy the current build to the named environment. Requires
ENV=staging|prod. Runs build and test as deps before deploying.

dependencies:
 - build
 - test

Use summary: for tasks where the user really needs to know what's about to happen before they invoke. Use desc: for the one-line listing.

Tab completion

rite --completion bash > /etc/bash_completion.d/rite (or zsh/fish/powershell) installs a completion script that knows your task names and flags. The script reads tasks at completion-time, so changes to the Ritefile show up immediately without re-installing.

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 .rite cache directory
RITE_X_*Enable experiment flags (e.g. RITE_X_GENTLE_FORCE=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