Commands by type

Every qq command grouped by what you use it for, with exit codes and environment variables, plus the tools behind the infra.

qq has four kinds of commands: ones you run in a repo every day, ones a repo defines for itself, ones that send a change through the gate, and the tools that read a repo's manifest or a release channel. Behind them sit the tools each infra repo ships, which most people never run.

Work in a repo

CommandWhat it does
qq fetch URL [DIR]clone a repo, then qq sync in it (Linux)
qq syncfetch every pin in infra/repo.toml, check its digest, link it under .qq/
qq build [TARGET ...]build targets (default all)
qq test [TARGET ...]build and test them; results in .qq/out
qq run "COMMAND"run a command from the repo root, pinned toolchains first on PATH

qq build and qq test take --keep-going, --toolchain NAME=ROOT and --out DIR. See build, test and run.

The repo's own commands

CommandWhat it does
qq create NAME COMMAND...save a command as infra/commands/NAME.sh
qq create --force NAME COMMAND...replace one
qq NAME [ARG ...]run it, like qq run
qq --helpqq's commands, then this repo's

See repo commands.

Send a change

These need gh signed in. Each acts on this branch's pull request unless you pass a number, URL or branch, and takes --repo OWNER/NAME, --backend (default $QQ_BACKEND, else github) and --json.

CommandWhat it does
qq uploadpush this branch, open or update its pull request
qq tryupload, print a run ID and exit; the verdict arrives later
qq statusthe gate's verdict now
qq landland through the merge queue once the gate passes; returns at once (not in xo-space)

upload and try take --title, --body (only with --title), --draft and --base. try and land take --notify CMD. land takes --method merge|squash|rebase. See send a change.

Read or edit the manifest: qqsync

qqsync is the only program that reads or edits infra/repo.toml. Each command exits 1 on any problem with the manifest, printing every problem, and 2 on a usage error such as a missing argument.

CommandWhat it does
qqsync show [PATH]print the manifest as JSON, for tools in any language
qqsync validate [PATH ...] [--kind KIND]check against the schema; with --kind, any other kind is an error
qqsync init DIR --kind KIND --kinds KINDS_TOML --promoted PROMOTED_TOML --qq-version Vwrite a new repo's manifest
qqsync pins [PATH] [--strict]list every pin; --strict rejects placeholder digests
qqsync pin SECTION NAME --digest Dset one pin, keeping the rest of the file byte for byte
qqsync fetch SECTION NAME --dest FILEdownload a pinned artifact, keeping it only if it matches
qqsync verify SECTION NAME PATHcheck a file or checkout against its pin
qqsync guard [ROOT]fail if anything else parses repo.toml (a presubmit for every repo)

PATH defaults to infra/repo.toml.

Install from a channel: qqinstall

CommandWhat it does
qqinstall resolve --repo R --channel Cthe commit, digest and generation the channel names
qqinstall resolve ... --format envthe same, as QQ_CHANNEL_COMMIT=... lines for scripts
qqinstall checkout --repo R --channel C --remote URL --dest DIRput a checkout on exactly that commit
qqinstall verify --repo R --channel C --checkout DIRcheck an install is on that commit with no local changes
qqinstall showevery channel

Exit codes: 0 resolved or matches, 1 mismatch or local changes, 2 error, 3 not published yet. Install it as shown in after it lands.

Exit codes

CommandExit codes
sync0 done; 1 a fetch failed; 2 no infra/repo.toml, or it is invalid
fetch0 done; 1 a clone, fetch or manifest problem
build, test0 all passed; 1 a step failed or a target cannot be planned; 2 no infra/repo.toml, or it is invalid
run, NAMEthe command's own code; 125 qq itself failed; 126 not runnable; 127 not found
create2 bad usage or outside a repo; 1 the name is taken or the file exists
status0 pass or landed; 1 refused or closed; 2 error; 3 pending
upload, try0 done; 2 error
land0 queued or being watched; 1 the gate already refused it; 2 error

With QQ_PINNED=1, an invalid manifest gives 1 instead of 2.

Environment variables

VariableWhat it does
QQ_PYTHONthe Python that runs qq itself (default python3; needs 3.11.4 or newer with venv)
QQ_HOMEwhere qq keeps installed versions and verdicts (default ~/.cache/qq)
QQ_PINNED=1run this qq as it is, ignoring the repo's pinned version
QQ_TRUSTED_SOURCESextra places a pinned qq may be installed from
QQ_BACKENDwhere changes are reviewed and landed (default github)
QQ_NOTIFYthe command that gets each verdict as JSON on stdin

Tools behind the infra

Most people never run these. Each infra repo ships one, and its README has every command.