Overview
A two-keystroke command that prints the sync state of every PyAuto repo against
its origin tracking branch. Catches commit drift early — the 2026-04-27 audit
found 12 repos up to 101 commits behind origin and only noticed by accident.
Wires into the PyAuto / PyAutoGPU / PyAutoNoJAX venv activation aliases
so the dashboard prints automatically every time the user enters the workspace.
Plan
- Create
PyAutoPrompt/scripts/pyauto_status.sh defining a pyauto-status shell function
- The function dynamically discovers all git repos under
~/Code/PyAutoLabs/, fetches in parallel, and prints one line per repo: branch, upstream, behind/ahead counts, dirty count, flag glyphs
- Handle the failure modes the audit surfaced: missing upstream →
NONE flag, renamed default branch → use @{u} not hard-coded origin/main, non-git directories → skip cleanly, fetch failures → don't crash the sweep
- Source the script from
~/.bashrc so the function is available in every shell
- Modify the
PyAuto, PyAutoGPU, PyAutoNoJAX shell functions in ~/.bashrc to call pyauto-status at the end so the dashboard prints automatically after venv activation
- Optionally extend
PyAutoPrompt/scripts/status.sh with a --repos flag that delegates to pyauto-status
- Verify acceptance: full sweep <10s, all repos one screen, non-default branches visible, no-upstream flagged
Detailed implementation plan
Affected Repositories
- PyAutoPrompt (primary — only tracked changes)
Plus a manual append/edit to ~/.bashrc (personal env, no PR).
Work Classification
Library (treated as such for the standard /start_library → worktree → /ship_library flow, even though PyAutoPrompt is workflow tooling rather than a runtime library).
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./PyAutoPrompt |
main |
1 modified + 1 untracked (both pre-existing, unrelated — weak/1_simulator.md and autolens/point_simulator_errors.md.txt) |
Suggested branch: feature/pyauto-status-shell
Worktree root: ~/Code/PyAutoLabs-wt/pyauto-status-shell/ (created later by /start_library)
Implementation Steps
-
PyAutoPrompt/scripts/pyauto_status.sh (new) — sourceable script defining pyauto-status().
- Discovery:
find ~/Code/PyAutoLabs -maxdepth 2 \( -name .git -type d -o -name .git -type f \) -printf '%h\n' | sort (the -type f clause picks up linked worktrees, whose .git is a file).
- Parallel fetch: spawn
git -C "$repo" fetch --quiet origin & per repo, then wait.
- Per repo collect: branch (
rev-parse --abbrev-ref HEAD, mark (detached) if literal HEAD), upstream (rev-parse --abbrev-ref @{u} 2>/dev/null → NONE if empty), behind/ahead (rev-list --left-right --count "$upstream"...HEAD), dirty count (status --porcelain | wc -l).
- Print: header + per-repo row via
printf with fixed columns. Flag glyphs: ↓ behind, ↑ ahead, * dirty, ! no upstream or fetch failed.
- Wrap each repo's collection in error handling so one bad repo doesn't kill the sweep.
-
PyAutoPrompt/scripts/status.sh (edit) — add a --repos arg near the top of the script that sources pyauto_status.sh and runs pyauto-status, then exits. Leave --full and default behavior untouched.
-
~/.bashrc (edit, personal env, no PR) — done after the PR merges:
- Append a sourcing line so the function loads in every shell:
`bash
PyAuto cross-repo sync status
[ -f ~/Code/PyAutoLabs/PyAutoPrompt/scripts/pyauto_status.sh ] &&
source ~/Code/PyAutoLabs/PyAutoPrompt/scripts/pyauto_status.sh
`
- Edit the
PyAuto(), PyAutoGPU(), PyAutoNoJAX() functions to add pyauto-status as the last line inside each. Skip PyAutoOld() (it targets /mnt/c/Users/Jammy/Code/PyAuto, not the labs root).
Key Files
PyAutoPrompt/scripts/pyauto_status.sh — new shell function (the bulk of the work).
PyAutoPrompt/scripts/status.sh — extended with --repos flag.
~/.bashrc — sourced once + venv aliases extended (out-of-PR personal config).
Acceptance Verification
time pyauto-status from a fresh shell — assert wall-clock < 10s.
- Verify all ~19 repos under
~/Code/PyAutoLabs/ appear in the output.
- Temporarily checkout a feature branch in one repo and re-run — confirm no auto-checkout, flag column shows
↑/* correctly.
- Confirm a no-upstream repo (e.g.
autolens_workspace_developer per prompt 06) prints NONE and ! flag.
- Open a fresh shell, run
PyAuto — dashboard prints automatically right after cd ~/Code/PyAutoLabs.
Naming clash to be aware of
There is already a /pyauto-status slash command in PyAutoPrompt/skills/pyauto-status/ that prints the workflow-registry dashboard (planned/active/complete tasks). The shell function reuses the name in the terminal namespace for git drift. Different surfaces, no collision, but worth noting in the README/docstring.
Out of scope
- Auto-pulling — handled by prompt 05's
/sync slash command later.
- Pretty colors / TUI — plain text only.
Original Prompt
Click to expand starting prompt
Cross-repo sync status dashboard
⚠️ Caveat — drafted from a stale repo state. This prompt was drafted on 2026-04-27 during a forensic sweep that found local checkouts up to 101 commits behind origin. The trigger looked like a structural workflow flaw, but later analysis showed the drift was largely driven by stale local checkouts being edited without git pull first, not by missing tooling. Now that PyAutoPrompt is the canonical source-of-truth and skills/install.sh auto-discovers across both repos, some of the recommendations below may be over-engineered for the day-to-day case. Re-evaluate whether each measure is still warranted — the cheap habits (pull before edit, never rewrite history) buy most of the win.
Drift across PyAuto repos is currently invisible — there's no single command
that shows whether each library and workspace is in sync with origin/main.
The 2026-04-27 audit found 12 repos with up to 101 commits of behind-origin
state, and we only noticed because of an unrelated investigation. Catching it
early needs a dashboard that's two keystrokes away.
What to build
A shell function pyauto-status (loaded via ~/.bashrc or ~/.local/bin/)
that, for every git repo under ~/Code/PyAutoLabs/, prints:
- repo name
- current branch
- upstream tracking ref (or
NONE if missing — a real failure mode that hid
autolens_workspace_developer for weeks)
- behind / ahead counts vs
@{u}
- dirty file count
- a single-glyph flag column:
↓ for behind, ↑ for ahead, * for dirty
Implementation notes:
- Run
git fetch origin --quiet per repo before counting (a stale dashboard is
worse than none).
- Skip directories that aren't git repos cleanly (warn, don't crash).
- Use the upstream branch from
git rev-parse --abbrev-ref @{u}, not a
hardcoded origin/main. PyAutoFit recently moved from main_build → main
and a hardcoded version would have hidden that.
A working draft is included in
PyAutoPrompt/autoprompt/snippets/pyauto_status.sh (see file). Test it; tune the
column widths; either inline it into ~/.bashrc or symlink from ~/.local/bin/.
Acceptance
- Running
pyauto-status from any directory shows all 12 repos in one screen.
- A repo on a non-default branch is visible (don't auto-checkout
main).
- A repo with no upstream is flagged, not silently skipped.
- The whole sweep finishes in well under 10 seconds (parallel-friendly fetch).
Out of scope
- Auto-pulling. This is a status command only — fixing drift is a separate
prompt (05_sync_slash_command.md).
- Pretty colors / TUI. Plain text is faster to read and pipe.
Files touched
~/.bashrc (or ~/.local/bin/pyauto-status + chmod +x)
- Optionally:
PyAutoPrompt/scripts/status.sh already prints prompt-registry
counts; consider adding a --repos flag that delegates to this function.
Overview
A two-keystroke command that prints the sync state of every PyAuto repo against
its origin tracking branch. Catches commit drift early — the 2026-04-27 audit
found 12 repos up to 101 commits behind origin and only noticed by accident.
Wires into the
PyAuto/PyAutoGPU/PyAutoNoJAXvenv activation aliasesso the dashboard prints automatically every time the user enters the workspace.
Plan
PyAutoPrompt/scripts/pyauto_status.shdefining apyauto-statusshell function~/Code/PyAutoLabs/, fetches in parallel, and prints one line per repo: branch, upstream, behind/ahead counts, dirty count, flag glyphsNONEflag, renamed default branch → use@{u}not hard-codedorigin/main, non-git directories → skip cleanly, fetch failures → don't crash the sweep~/.bashrcso the function is available in every shellPyAuto,PyAutoGPU,PyAutoNoJAXshell functions in~/.bashrcto callpyauto-statusat the end so the dashboard prints automatically after venv activationPyAutoPrompt/scripts/status.shwith a--reposflag that delegates topyauto-statusDetailed implementation plan
Affected Repositories
Plus a manual append/edit to
~/.bashrc(personal env, no PR).Work Classification
Library (treated as such for the standard
/start_library→ worktree →/ship_libraryflow, even though PyAutoPrompt is workflow tooling rather than a runtime library).Branch Survey
weak/1_simulator.mdandautolens/point_simulator_errors.md.txt)Suggested branch:
feature/pyauto-status-shellWorktree root:
~/Code/PyAutoLabs-wt/pyauto-status-shell/(created later by/start_library)Implementation Steps
PyAutoPrompt/scripts/pyauto_status.sh(new) — sourceable script definingpyauto-status().find ~/Code/PyAutoLabs -maxdepth 2 \( -name .git -type d -o -name .git -type f \) -printf '%h\n' | sort(the-type fclause picks up linked worktrees, whose.gitis a file).git -C "$repo" fetch --quiet origin &per repo, thenwait.rev-parse --abbrev-ref HEAD, mark(detached)if literalHEAD), upstream (rev-parse --abbrev-ref @{u} 2>/dev/null→NONEif empty), behind/ahead (rev-list --left-right --count "$upstream"...HEAD), dirty count (status --porcelain | wc -l).printfwith fixed columns. Flag glyphs:↓behind,↑ahead,*dirty,!no upstream or fetch failed.PyAutoPrompt/scripts/status.sh(edit) — add a--reposarg near the top of the script that sourcespyauto_status.shand runspyauto-status, then exits. Leave--fulland default behavior untouched.~/.bashrc(edit, personal env, no PR) — done after the PR merges:`bashPyAuto cross-repo sync status
[ -f ~/Code/PyAutoLabs/PyAutoPrompt/scripts/pyauto_status.sh ] &&source ~/Code/PyAutoLabs/PyAutoPrompt/scripts/pyauto_status.sh
`PyAuto(),PyAutoGPU(),PyAutoNoJAX()functions to addpyauto-statusas the last line inside each. SkipPyAutoOld()(it targets/mnt/c/Users/Jammy/Code/PyAuto, not the labs root).Key Files
PyAutoPrompt/scripts/pyauto_status.sh— new shell function (the bulk of the work).PyAutoPrompt/scripts/status.sh— extended with--reposflag.~/.bashrc— sourced once + venv aliases extended (out-of-PR personal config).Acceptance Verification
time pyauto-statusfrom a fresh shell — assert wall-clock < 10s.~/Code/PyAutoLabs/appear in the output.↑/*correctly.autolens_workspace_developerper prompt 06) printsNONEand!flag.PyAuto— dashboard prints automatically right aftercd ~/Code/PyAutoLabs.Naming clash to be aware of
There is already a
/pyauto-statusslash command inPyAutoPrompt/skills/pyauto-status/that prints the workflow-registry dashboard (planned/active/complete tasks). The shell function reuses the name in the terminal namespace for git drift. Different surfaces, no collision, but worth noting in the README/docstring.Out of scope
/syncslash command later.Original Prompt
Click to expand starting prompt
Cross-repo sync status dashboard
Drift across PyAuto repos is currently invisible — there's no single command
that shows whether each library and workspace is in sync with
origin/main.The 2026-04-27 audit found 12 repos with up to 101 commits of behind-origin
state, and we only noticed because of an unrelated investigation. Catching it
early needs a dashboard that's two keystrokes away.
What to build
A shell function
pyauto-status(loaded via~/.bashrcor~/.local/bin/)that, for every git repo under
~/Code/PyAutoLabs/, prints:NONEif missing — a real failure mode that hidautolens_workspace_developerfor weeks)@{u}↓for behind,↑for ahead,*for dirtyImplementation notes:
git fetch origin --quietper repo before counting (a stale dashboard isworse than none).
git rev-parse --abbrev-ref @{u}, not ahardcoded
origin/main. PyAutoFit recently moved frommain_build→mainand a hardcoded version would have hidden that.
A working draft is included in
PyAutoPrompt/autoprompt/snippets/pyauto_status.sh(see file). Test it; tune thecolumn widths; either inline it into
~/.bashrcor symlink from~/.local/bin/.Acceptance
pyauto-statusfrom any directory shows all 12 repos in one screen.main).Out of scope
prompt (
05_sync_slash_command.md).Files touched
~/.bashrc(or~/.local/bin/pyauto-status+chmod +x)PyAutoPrompt/scripts/status.shalready prints prompt-registrycounts; consider adding a
--reposflag that delegates to this function.