DocsCLI commands

Reference

CLI commands

Every command of the warmbuild CLI, in the order you meet them. warmbuild <command> --help lists all of a command's flags.

  • Commands that read CI data take --repo owner/name (default: this checkout's GitHub repository) and need a sign-in: warmbuild login on a Mac, the job's OIDC token on CI.
  • Most commands take --json.
  • Exit codes are the same for every command: 0 done, 1 failed, 2 wrong command line, 124 gave up waiting (details).

On a Mac

CommandWhat it does
loginSigns in with GitHub: open the link, enter the code. The read-only token stays in the macOS Keychain. --tenant <account> picks the account when you belong to several; --write asks for a token that may upload (account admins only).
startStarts the cache for local builds. Run it in the repository: it maps every worktree, gives the Xcode app XCODE_XCCONFIG_FILE, and keeps running after a reboot. --add-to-profile adds the XCODE_XCCONFIG_FILE line to your shell profile without asking; --no-modify-profile only prints it. --quiet prints one line.
statusIs the cache on, who is signed in, and the last build's hits and misses, per worktree. Exits 1 when the cache is off.
doctorChecks why builds miss: the server, the sign-in, the xcconfig, DerivedData under /tmp, the Xcode version, CI's last fill and the latest release. Prints the fix for each check that fails. --offline skips the checks that need the network.
waitWaits until the cache serves builds, for scripts: warmbuild wait && xcodebuild …. --timeout in seconds (default 900).
run -- <command>Runs one command, such as xcodebuild, with the cache, and ends with what the cache saved. Exits with the command's own code.
stopTurns the cache off. Builds then run without it.
updateInstalls the latest release now. The cache also does this daily, unless ~/.warmbuild/config.json has "autoUpdate": false.
gcShrinks the local store in ~/.warmbuild/store to its cap now (10 GiB by default, or --max-size 20G). Never touches Xcode's DerivedData.
linkPoints /tmp/warmbuild/src at this checkout, for #filePath and the debugger, and maps its worktrees. start does this for you.

For the team

CommandWhat it does
initOnce per repository, by its owner. Writes an optional xcconfig include and a build step that, on Macs without Warmbuild, prints one warning with the install line. Then prints the git commit command to run.
invitePrints a message for the team chat: the install line and what it does.

Reading CI

The same data as the dashboard's CI report, in the terminal. Agents use these most.

CommandWhat it does
buildsRecent CI jobs: duration, cache hits and misses, test results. --branch main, --limit.
reportOne job: where its time went, targets by compile time with hits and misses, the slowest tasks and tests. --job <id> from builds (default: the newest).
findingsThe dashboard's findings for the repository, each with the time it would save per job.
why-miss [target]A target's hits and misses across recent jobs, and what changed since the last job without misses: Xcode, runner, ref, event or commit. Without a target, it explains the newest job's costliest miss.
insightsWhich module recompiles most and pulls others with it, and which of its parts could move into a package. --local reads this checkout's git history.
testsThe tests your change can reach, as -only-testing arguments for xcodebuild test. --changed includes uncommitted files; --format swift prints a swift test --filter pattern. With --slow, --flaky or --failing: those tests from recent CI jobs.
Terminal
xcodebuild test -scheme App $(warmbuild tests --changed)warmbuild why-miss

Run by the Action

The GitHub Action and the Mac's LaunchAgent run these. You rarely need them yourself.

CommandWhat it does
ci-reportReads the job's build logs and result bundles and writes the CI report and the job summary.
test-cacheplan leaves out test targets that passed before with the same products; step skips a step whose inputs passed before; keys prints the keys.
packagesrestore puts saved Swift packages back before xcodebuild resolves; save stores them once per set of pins.
typecheckplan: which targets a pull request times type-checking in.
flagsPrints the xcodebuild settings the cache needs, one per line.
daemon, supervise, serveThe cache server: under the LaunchAgent, restarted when it crashes, or in the foreground.
selftestAsks the server on a socket for one lookup and prints ok when it answers.