Conversation
Before: bare `gx` on a degraded repo auto-ran `gx doctor --target <root>` which recursively walked every git repo it could find under the parent directory (16 repos in the reported case) before returning control to the user. That blew up a quick status check into a multi-minute repair sweep across unrelated repos. After: the auto-doctor path passes `--current` so it only repairs the repo the user is actually standing in. Recursive repair stays available explicitly via `gx doctor` (no `--current`). Also bumps `@imdeadpool/guardex` to 7.0.30 so the fix ships. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
NagyVikt
added a commit
that referenced
this pull request
Apr 23, 2026
Bare `gx` already lists inactive companions (cavekit, caveman,
oh-my-codex, etc.) but stops at "run `gx setup`". This wires the
existing install pipeline into the default banner so the user gets
a single `[y/n]` prompt inline:
[gitguardex] Missing companion tools: cavekit, caveman.
Guardex needs … Install missing companion tools now?
(npm i -g … && npx … ) [y/n]
On approval, `performCompanionInstall(...)` runs the same `npm i -g`
and local `npx` commands `gx setup` does today. Banner then re-runs
`collectServicesSnapshot()` so the final `Global services:` line and
`Next:` hint already reflect the installed tools.
New knobs:
- `GUARDEX_SKIP_COMPANION_PROMPT=1` fully disables the inline prompt
(keeps the prior banner behavior verbatim).
- `GUARDEX_AUTO_COMPANION_APPROVAL=yes|no` (symmetric with the existing
`GUARDEX_AUTO_UPDATE_APPROVAL`) lets non-interactive callers accept
or decline without a TTY.
Non-interactive runs (`--json`, piped stdout, missing stdin TTY) without
the auto-approval env var skip the prompt so CI / tests / pipes stay
byte-compatible with the prior output.
Factoring:
- `src/toolchain/index.js` exports `performCompanionInstall` +
`buildMissingCompanionInstallPrompt` so bare `gx` can run the install
directly without the `gx setup` preamble ("Already installed globally: …").
- `src/cli/main.js` extracts service detection into
`collectServicesSnapshot()` so the banner can refresh after an install.
Also updates `test/status.test.js` auto-doctor assertion to match the
`--current` upgrade from PR #410 (the regex was still pinned to the
pre-upgrade wording).
Bumps `@imdeadpool/guardex` to 7.0.31.
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated by gx branch finish (PR flow).