exec Command
What It’s For
Section titled “What It’s For”Run the same ad hoc command in every selected managed repository without writing a shell loop. aw exec is useful for repeated inspection, validation, tests, and maintenance commands across an Arashi workspace.
Each child command runs with its current working directory set to the selected repository path, not the meta-repo root.
aw exec [options] -- <command> [args...]The -- delimiter is required before the child command. Arashi parses options before --; everything after -- is passed to the child command without being interpreted as Arashi options.
Options
Section titled “Options”-o, --only <repos>run only named managed repositories; repeat it, use commas, or mix both forms.-g, --group <group>run only requested groups; repeat it, use commas, or mix both forms.--dirtyrun only in selected repositories that have local working-tree changes.--jobs <positive-int>remains long-only and runs up to that many repositories concurrently. The default is serial execution.--fail-faststop scheduling additional repositories after the first child-command failure. Already-running jobs may finish and be reported.-j, --jsonemit one machine-readable JSON envelope instead of grouped human output.
Examples
Section titled “Examples”# inspect all locally present managed repositoriesaw exec -- git status --short
# validate one repositoryaw exec --only arashi-docs -- pnpm validate
# validate all documentation repositoriesaw exec --group docs -- pnpm validate
# inspect two repositoriesaw exec --only arashi,arashi-docs -- git status --short
# show diffs only for repositories with local changesaw exec --dirty -- git diff --stat
# run tests with bounded parallelismaw exec --jobs 4 -- pnpm test
# stop starting new test jobs after the first failureaw exec --jobs 4 --fail-fast -- pnpm test
# pass child-command flags after the delimiteraw exec -- pnpm test -- --watch=false
# capture per-repository stdout, stderr, status, and totals for automationaw exec --json -- git status --shortOutput And Exit Behavior
Section titled “Output And Exit Behavior”Human output is grouped by repository so stdout, stderr, and failures remain attributable even when --jobs runs commands in parallel. The final summary reports successful, failed, and skipped or not-started repositories.
aw exec exits with status code 0 when every executed child command succeeds. If any executed child command exits non-zero, the Arashi process exits non-zero and identifies the failing repository or repositories.
When --dirty matches no repositories, aw exec exits successfully and reports that no dirty repositories matched.
JSON Mode
Section titled “JSON Mode”Use --json when automation needs to inspect results. JSON mode suppresses grouped human output and writes a single parseable document to stdout using the standard Arashi JSON envelope.
On full success, the result data includes the child command arguments, effective execution options, selected repositories, per-repository stdout and stderr, exit status, duration, and aggregate totals. If any selected repository fails, the JSON envelope uses ok: false and includes the same per-repository result details under the structured error details. The Arashi process exits non-zero when any selected repository fails.
- Use explicit filters for expensive or mutating commands. Prefer
--group <group>for known semantic sets and--only <repo>for one-off repository lists. - When combined with
--only,--groupnarrows the explicit repository list by intersection. - Prefer serial execution for commands that contend for shared resources or produce large output.
--jobs <n>must be a positive integer.aw execis intended for non-interactive fan-out commands; avoid child commands that require a TTY prompt or editor.- Missing or unknown repositories named by
--onlyare reported as errors instead of silently ignored.
Related
Section titled “Related”exec runs across configured repository selections and therefore requires configured mode. From standalone mode, run ordinary aw init to upgrade; see the Standalone Repository workflow.
- status for built-in workspace state inspection.
- setup for configured repository setup scripts.
- Agents workflow for automation guidance.