Run a command in each repository
runExecute one shell command across selected repositories and collect each repo's exit code, stdout, stderr, timeout, and truncation status for fleet-wide audits, tests, or codemods.
Instructions
Run one shell command in each selected repo and collect per-repo {exit_code, stdout, stderr, truncated, timed_out} — the fleet codemod/audit/test primitive (e.g. "cargo fmt --check", "rg TODO", "npm test"). The command runs in each repo's own directory. Requires command and selector. Executing needs --allow-run AND confirm:true; dry_run:true previews the target set with neither. Each repo is bounded by timeout_secs (default 120).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>",
"selector": "<selector>"
},
"name": "run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Shell command run in each selected repo's directory. | |
| confirm | No | Must be true to actually act; preview first with dry_run. | |
| dry_run | No | Preview the resolved target set without acting. | |
| selector | Yes | Predicate that selects repos across the fleet; set fields to AND them, omit a field for no constraint (ADR-024). Scope: all (bool — the whole fleet), ids[str], name (glob, e.g. "pay*"), path_glob (* stays within one path segment, ** crosses /), root, group (a config-defined cluster name, e.g. "payments"). Local state: dirty, ahead (alias unpushed), behind, diverged, no_upstream, unpublished (a branch never pushed although the repo has a remote), stale_fetch (remote not fetched for over 14 days), has_stash, detached, conflicted, in_operation (merge/rebase/… mid-flight), error, branch (exact name), attention ("any"|"notice"|"warn"|"risk"). Remote (needs a GitHub token): ci ("passing"|"failing"|"pending"|"none"), min_prs (int). Combine: any_of[selector] (OR), not (selector). The empty selector {} matches NOTHING by design — pass {"all": true} for the whole fleet. | |
| timeout_secs | No | Per-repo timeout in seconds (default 120). |