Skip to content

feat(cli): prompt for updates on startup#26

Open
Shengming Liang (LiangShengming) wants to merge 1 commit into
feat/self-update-commandfrom
feat/startup-update-prompt
Open

feat(cli): prompt for updates on startup#26
Shengming Liang (LiangShengming) wants to merge 1 commit into
feat/self-update-commandfrom
feat/startup-update-prompt

Conversation

@LiangShengming

@LiangShengming Shengming Liang (LiangShengming) commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

What:

Add a startup update prompt for interactive Dedalus CLI launches. The prompt uses a cached latest-version check, skips noninteractive/CI/help/completion/root update flows, and delegates accepted updates to the existing dedalus update implementation.

Why:

Users should not have to remember to run dedalus update --check manually. The goal is to keep lightweight latest-version state on disk, prompt only when there is a newer version, and route the accepted update through the installer-aware update path.

Test Plan

  • git diff --check
  • go test -run 'Test(StartupUpdate|RootCommandArg|IsNewerVersion|Update|Latest)' ./pkg/cmd
  • go build ./...
  • ./scripts/lint
  • ./scripts/test

Repro / Showcase

When an interactive launch has a cached or freshly fetched newer version, the CLI prints:

A new Dedalus CLI is available.

Current: v0.4.0
Latest:  v0.5.0

Update now?
> Yes
  Not now

Press Enter to update, or type n then Enter to skip:

Pressing Enter runs dedalus update and exits after the update attempt. Typing n continues to the original command. Noninteractive launches, CI, help/version commands, completion generation, and dedalus update itself skip the startup prompt.

Tests Added

  • Unit tests
  • Integration tests
  • E2E tests
  • N/A (no new code paths)

Risk areas:

  • The launch path now may perform a bounded latest-version fetch when the cache is stale or missing; the timeout is 2 seconds and failures are silent.
  • The prompt writes to stderr so stdout remains usable for command output.
  • The prompt intentionally has only Yes and Not now

@LiangShengming Shengming Liang (LiangShengming) changed the base branch from fix/windows-powershell-latest-clean to feat/self-update-command June 24, 2026 01:01
@LiangShengming Shengming Liang (LiangShengming) marked this pull request as ready for review June 24, 2026 01:26
@LiangShengming

Copy link
Copy Markdown
Collaborator Author

End to end evidence: run 28068838181 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant