Skip to content
open tomato/ rafa
GitHub
rafa pages
  1. rafa
  2. rafa self-update

rafa self-update

Build rafa from a checkout of its repository and install it as the global rafa every project on the device runs.

rafa self-update builds the rafa checkout it runs in and installs the build under ~/.rafa/runtime/<version>/, then points ~/.rafa/bin/rafa at it. It does not install from npm: to update an npm install, use your package manager. rafa update current is a different command, which brings one project to the installed rafa.

Spends: nothing. Changes: ~/.rafa/runtime/ and the ~/.rafa/bin/rafa link.

Things to know before you use it:

  • It refuses while a loop of the project runs, unless dangerous.selfUpdateDuringLoop is true, because the loop starts its sessions from the installed rafa.
  • A version is installed once; --force replaces that version's folder whole.
NOTE

In the target layout's cut table this code counts toward the command-line package, @open-tomato/rafa, at the root of the repository, which is where it lives in 0.47.0 too (Repository layout). [verify: its final placement]

Reference: rafa self-update

Build this rafa checkout and install it as the global rafa in ~/.rafa.

rafa self-update [--force]

Builds the rafa checkout it runs in with bun run build, copies dist/ into ~/.rafa/runtime/<version>/ with the version from package.json, and links ~/.rafa/bin/rafa at the copied cli.js, the directory and the link landing by a rename so a loop running from that runtime never meets a torn file. It refuses with exit code 1, before building, while a loop of the project is live, naming each loop's branch and pid, unless dangerous.selfUpdateDuringLoop is true; --force does not override that wait. A plan tracker in plan.dir holding an open or blocked task holds the install back only while a loop is live: with none live it warns once, naming each such tracker, and installs; with that key true and a loop live it refuses with exit code 1, naming each one, unless --force is on the line. It refuses with exit code 1 too while that runtime directory is already there, naming it and the version: a version is installed once, and --force replaces the directory whole. It exits 2 when it could not run: a session record it cannot read, a package.json that is not rafa's, a config or tracker it cannot read, or a build, copy or link that failed. It warns when ~/.rafa/bin is not on PATH ahead of ~/.bun/bin. With --output=json the installed paths are the data of the terminal result event.

FlagType and defaultWhat it does
--forcebooleanReplace a ~/.rafa/runtime/<version>/ already there, whole, instead of refusing it, and install beside a plan tracker holding a task while a loop is live.

Examples:

  • rafa self-update: Builds the checkout and points ~/.rafa/bin/rafa at the copy, once no loop of the project is live.
  • rafa self-update --force: Installs over the runtime this version is already installed as, replacing that directory whole.

Output formats: text, json.