Skip to content

Conversation

@jmetrikat
Copy link
Collaborator

No description provided.

@jmetrikat jmetrikat requested a review from Copilot November 2, 2025 16:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automatic update functionality to the Anytype CLI by extracting update logic into a reusable core package and implementing background update checks. The update now runs silently in the background on CLI startup once every 24 hours.

  • Refactored update logic from cmd/update/update.go to core/update/update.go for reusability
  • Added automatic update checking via core/autoupdate/autoupdate.go that runs in a goroutine on startup
  • Integrated auto-update into main entry point with lock file to prevent concurrent updates

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
main.go Added auto-update check on CLI startup
core/update/update.go New package containing extracted update logic with GitHub API integration and archive extraction
core/autoupdate/autoupdate.go New package implementing background update checks with 24-hour interval and file-based locking
cmd/update/update.go Refactored to use core/update package, removed duplicated code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jmetrikat jmetrikat requested a review from Copilot November 2, 2025 17:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@stevelr
Copy link

stevelr commented Jan 3, 2026

Cool feature!

(1) Please add documentation on how to disable auto-update

Why:

As a developer,
- If I'm in the middle of testing an app that connects to the cli, I don't want the cli to do an automatic update and possibly create confusing test results
- If I've done a custom build of anytype-heart and/or the cli, to test bug fixes, I don't want it to automatically update and revert to the unpatched version

As a NixOS user,
- Apps are installed declaratively, and installed on a read-only file system, so automatic updates will probably fail

(2) It might be useful to add a cli command (such as anytype update check) to report whether an update is available. It is not strictly required, because one can query github for releases, but since the logic is in the cli, it might be simpler to surface in the cli with an easy-to-parse output.

Thanks!

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.

3 participants