Skip to content

feat(cli): add automatic version update check#46

Merged
zzxwill merged 1 commit into
masterfrom
update-default-models
Jun 10, 2026
Merged

feat(cli): add automatic version update check#46
zzxwill merged 1 commit into
masterfrom
update-default-models

Conversation

@zzxwill

@zzxwill zzxwill commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • On every aigit invocation, a background goroutine checks GitHub's latest release and prints an upgrade notice after the command finishes if a newer version is available
  • The result is cached in ~/.aigit/update-check.json, so the GitHub API is hit at most once per 24 hours; cached runs add zero latency
  • Fails silently on network errors / API rate limits; skipped entirely for dev builds, in CI, or when AIGIT_NO_UPDATE_CHECK is set
  • Version comparison ignores the v prefix and git-describe suffixes (v0.1.1-7-gabc1234 compares as 0.1.1), and compares numerically so v0.0.9 < v0.0.10

Test plan

  • Verified with stamped builds against a seeded cache: v0.1.1 and v0.1.1-7-ga98bc1b show the notice, v0.1.2 stays quiet
  • Verified silent behavior under GitHub API rate limiting
  • go build ./... and gofmt clean

🤖 Generated with Claude Code

Add background update check that notifies users when a new release is
available. The check runs once per day and caches results to avoid
excessive GitHub API calls. This helps users stay up-to-date with
the latest features and bug fixes.
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