REPO(1)

πŸ’– NAME πŸ’–

okay so bestie, welcome to REPO(1) β€” this is the Repo Manual, and today's main character is repo forall. like, the actual page for repo forall, fr fr. it's a manual page, it's giving very "read me before you break prod" energy, and we're gonna get through it together πŸ’…


✨ SYNOPSIS ✨

repo forall [<project>...] -c <command> [<arg>...]

that's the whole vibe in one line. yes queen, that's it. πŸŽ€


🌸 DESCRIPTION 🌸

Summary β€” the little tl;dr of what this thing does:

run a shell command in each project. every single one. no skips. πŸ’–

and here's the other shape it can take:

repo forall -r str1 [str2] ... -c <command> [<arg>...]

so like, -r plus a bunch of strings plus a command. we'll get into it, don't worry bestie 🫢


πŸ’… OPTIONS πŸ’…

  • -h, --help β€” shows this help message and then dips out (exits). your bestie when you're lost ✨
  • -j JOBS, --jobs=JOBS β€” how many jobs to run in parallel. default? based on how many CPU cores you've got. so like, it already knows your machine, iykyk πŸ’…
  • -r, --regex β€” only run the command on projects matching the regex or wildcard expression. filtering era 😌
  • -i, --inverse-regex β€” the opposite vibe: only run on projects that do not match the regex or wildcard expression. not like other projects πŸ’€
  • -g GROUPS, --groups=GROUPS β€” only run on projects matching the groups you specify. group chat rules apply 🫢
  • -c, --command β€” the command (and its arguments) you wanna execute. the whole point, honestly πŸ”₯
  • -e, --abort-on-errors β€” if a command exits unsuccessfully, abort. no mercy, no finishing the list 🌈
  • --ignore-missing β€” silently skip and do not exit non-zero just because checkouts are missing. it's giving "no thoughts, head empty" πŸ™ˆ
  • --interactive β€” force interactive usage. yes ma'am, we're doing this live ✨

πŸŽ€ Logging options:

  • -v, --verbose β€” show all output. everything. all of it. the tea is fully spilled πŸ’–
  • -q, --quiet β€” only show errors. peace and quiet, queen πŸ‘‘
  • -p β€” show project headers before output. so you know whose output you're looking at πŸ¦‹

🧚 Multi-manifest options:

  • --outer-manifest β€” operate starting at the outermost manifest. going all the way out ⭐
  • --no-outer-manifest β€” do not operate on outer manifests. boundaries, bestie πŸ’…
  • --this-manifest-only β€” only operate on this (sub)manifest. this one. only this one. periodt ✨
  • --no-this-manifest-only, --all-manifests β€” operate on this manifest and its submanifests. the whole family 🌸
run repo help forall to view the detailed manual. little reminder from the page itself, bestie πŸ’œ

πŸ¦‹ DETAILS πŸ¦‹

executes the same shell command in each project. iconic behavior honestly πŸ’–

the -r option lets you run the command only on projects matching a regex or wildcard expression. filtered, curated, slay ✨

by default, projects are processed non-interactively and in parallel. but if you wanna run interactive commands, make sure you pass --interactive to force --jobs 1. and while the processing order of projects is not guaranteed, the order of project output is stable. so like, the output keeps it together even when the timing doesn't 🫢


πŸŽ€ Output Formatting πŸŽ€

the -p option makes repo forall bind pipes to the command's stdin, stdout and stderr streams, and pipe all that output into one continuous stream displayed in a single pager session. project headings get inserted before each command's output is displayed. and if a command produces no output in a project? no heading gets displayed. silence is silence πŸ’€

the formatting convention used by -p is very suitable for some types of searching, e.g. repo forall -p -c git log -SFoo will print all commits that add or remove references to Foo. chef's kiss for searching, fr fr πŸ”

the -v option makes repo forall display stderr messages if a command produces output only on stderr. normally, the -p option causes command output to be suppressed until the command produces at least one byte of output on stdout. so -v is your "hello?? i'm talking" option πŸ’…


🌈 Environment 🌈

  • pwd is the project's working directory. and if the current client is a mirror client, then pwd is the Git repository. know where you are, bestie ✨
  • REPO_PROJECT is set to the unique name of the project. it's giving main character energy πŸ‘‘
  • REPO_PATH is the path relative the the root of the client. (yes, "the the" β€” that's the manual's typo, we're preserving it, periodt πŸ™ˆ)
  • REPO_OUTERPATH is the path of the sub manifest's root relative to the root of the client.
  • REPO_INNERPATH is the path relative to the root of the sub manifest.
  • REPO_REMOTE is the name of the remote system from the manifest.
  • REPO_LREV is the name of the revision from the manifest, translated to a local tracking branch. if you need to pass the manifest revision to a locally executed git command, use REPO_LREV.
  • REPO_RREV is the name of the revision from the manifest, exactly as written in the manifest. verbatim. no edits πŸ’–
  • REPO_UPSTREAM is the name of the upstream branch as specified in the manifest.
  • REPO_DEST_BRANCH is the name of the destination branch for code review, as specified in the manifest.
  • REPO_PROJECT_FETCH_URL is the full resolved fetch URL for the project.
  • REPO_COUNT is the total number of projects being iterated.
  • REPO_I is the current (1-based) iteration count. can be used in conjunction with REPO_COUNT to add a simple progress indicator to your command. progress bar era ✨
  • REPO__* are any extra environment variables, specified by the "annotation" element under any project element. this can be useful for differentiating trees based on user-specific criteria, or simply annotating tree details. cute little extras 🌸

also: shell positional arguments ($1, $2, .., $#) are set to any arguments following <command>. πŸ’…

Example: to list projects:

repo forall -c 'echo $REPO_PROJECT'

notice that $REPO_PROJECT is quoted to ensure it is expanded in the context of running <command> instead of in the calling shell. quote it or cry about it, bestie 😭

unless -p is used, stdin, stdout, stderr are inherited from the terminal and are not redirected.

if -e is used, when a command exits unsuccessfully, repo forall will abort without iterating through the remaining projects. like, it stops. immediately. no "one more project". πŸ’€

okay that's the whole page, you ate that πŸ“ this was repo forall from the Repo Manual, dated June 2026 β€” go forth and forall responsibly, bestie πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from