Add inline auto-update prompt after version notification#997
Open
gtrrz-victor wants to merge 9 commits intomainfrom
Open
Add inline auto-update prompt after version notification#997gtrrz-victor wants to merge 9 commits intomainfrom
gtrrz-victor wants to merge 9 commits intomainfrom
Conversation
When the existing daily version check detects a newer release, the CLI prints the usual notification and then asks the user "Install the new version now? [Y/n]". Accepting runs whatever command versioncheck.updateCommand(current) resolves to, streaming stdio so the user sees the installer. Declining skips; the 24h version-check cache prevents re-prompts within a day. Guardrails: TTY + empty CI env + ENTIRE_NO_AUTO_UPDATE kill switch. No subcommands, no settings file, no silent auto-install. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: f880b34689b1
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an interactive inline auto-update flow to the existing daily version check so that, when an outdated release is detected, the CLI can optionally run the appropriate installer command (brew/mise/scoop/curl) immediately.
Changes:
- Invoke a new
MaybeAutoUpdateprompt after printing the “newer version available” notification. - Add the auto-update implementation that prompts the user and shells out to the resolved installer command with stdio passthrough.
- Add unit tests and architecture documentation for the new behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/architecture/auto-update.md | Documents the new post-notification auto-update prompt and its guardrails. |
| cmd/entire/cli/versioncheck/versioncheck.go | Calls MaybeAutoUpdate after printing the outdated-version notification; minor comment tweaks. |
| cmd/entire/cli/versioncheck/autoupdate.go | Implements interactive confirm prompt + installer subprocess execution. |
| cmd/entire/cli/versioncheck/autoupdate_test.go | Adds unit tests covering guardrails, decline path, success, and installer failure messaging. |
| cmd/entire/cli/versioncheck/versioncheck_test.go | Minor refactor in TestUpdateCommand (path constant reuse). |
Pre-select the affirmative so Enter accepts, matching the (Y/n) UX described in docs/architecture/auto-update.md. Previously the zero value of the bound bool made "No" the default, contradicting the prompt and surprising users who expected the implied accept. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 7b8020d9f4cb
Replaces the ad-hoc stdoutIsTerminal seam with the shared
interactive.CanPromptInteractively() helper, which opens /dev/tty
directly. This handles three review items with a single change:
- Cobra redirects via cmd.SetOut(&bytes.Buffer{}) no longer matter;
the TTY check is independent of the writer fd.
- Test binaries running from a real terminal skip the prompt via
ENTIRE_TEST_TTY=0 set in setupCheckAndNotifyTest.
- Agent subprocesses that inherit the user's stdout but have no
controlling terminal for stdin hit the /dev/tty open failure and
are skipped; CI runners land on the same path.
Also drops the redundant os.Getenv("CI") check — the /dev/tty probe
already covers it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 4c7de4acdbd6
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5872166. Configure here.
Self-hosted runners and some Docker configurations leave /dev/tty attached, so the prior /dev/tty-only probe would let huh forms run in CI and hang the pipeline. Gate on CI in addition to /dev/tty; ENTIRE_TEST_TTY still overrides both so existing tests that exercise the interactive path keep working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 096757b44493
Remove the design-doc file from this PR as requested. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 23fdeb653d1e
CI guardrail in CanPromptInteractively short-circuits to false when CI=1, which broke TestResume_LocalLogNewerTimestamp_UserConfirmsOverwrite in GitHub Actions — the pty is real but the env check wins. Override with ENTIRE_TEST_TTY=1 in RunCommandInteractive so interactive prompts work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: a1da08f67a46
Move hasTTY from strategy package to interactive package (its documented home) and replace all interactive.CanPromptInteractively callers with interactive.HasTTY. One check path for agent-subprocess and /dev/tty detection across cli, strategy, and versioncheck. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 1f83680e3b77
Keep the consolidated body (agent-subprocess + /dev/tty checks) under the original name so call sites and tests read the same as before. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: df1ddfe6b261
pfleidi
approved these changes
Apr 22, 2026
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.

https://entire.io/gh/entireio/cli/trails/e09fcff9bd93
Example
Summary
versioncheck.updateCommand(current)resolves to (brew upgrade --cask entire[@nightly],mise upgrade entire,scoop update entire/cli, or the curl-pipe-bash fallback). stdin/stdout/stderr stream through so installer prompts and progress reach the user.CImust be empty,ENTIRE_NO_AUTO_UPDATE=1is a kill switch.Test plan
mise run checkgreen locally (unit + integration + canary)Non-goals
See
docs/architecture/auto-update.md.Replaces #981 (clean history — single commit on top of
mainwith only the auto-update files).🤖 Generated with Claude Code
Note
Medium Risk
Introduces a new interactive prompt and executes installer commands via
sh -c/cmd /C, which could affect UX or fail in edge environments; guardrails and tests reduce but don’t eliminate runtime risk.Overview
When the daily version check detects the CLI is outdated, it now follows the existing notification with an interactive Y/N prompt to install the new version, and on confirmation shells out to the resolved installer command (brew/mise/scoop/curl), streaming stdin/stdout/stderr so prompts and progress are visible.
The prompt is skipped silently when non-interactive (no TTY) or when
ENTIRE_NO_AUTO_UPDATEis set, and failures are non-blocking (debug-logged or printed as a simple update failure message). Adds unit tests for the auto-update flow and documents the behavior indocs/architecture/auto-update.md.Reviewed by Cursor Bugbot for commit 5872166. Configure here.