# How to Update Superfile to the Latest Version

> Quickly update Superfile to the latest version using its auto-update checker, installation scripts, package managers, or direct GitHub releases. Stay current with ease.

- Repository: [Yorukot/superfile](https://github.com/yorukot/superfile)
- Tags: how-to-guide
- Published: 2026-07-29

---

**Superfile ships with a built-in auto-update checker that runs every 24 hours when enabled, or you can manually update through installation scripts, package managers, or direct GitHub releases.**

Superfile is a modern terminal file manager developed by `yorukot/superfile` that handles version management through both automated background checks and manual installation channels. The application implements a configurable update notification system that queries GitHub's releases API, alongside traditional distribution methods for users who prefer explicit control over their binary versions.

## How the Auto-Update Checker Works

The automatic update system is implemented in [`src/cmd/main.go`](https://github.com/yorukot/superfile/blob/main/src/cmd/main.go) and triggers during program startup through the `CheckForUpdates` function (around line 35-51). This system respects user preferences while minimizing network overhead through intelligent timing logic and semantic version comparison.

### Configuration Options

The `auto_check_update` boolean flag controls whether Superfile checks for updates on startup. This setting is defined in the `Config` struct within [`src/internal/common/config_type.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/config_type.go) (lines 70-80) and defaults to `true`. When enabled, the application compares the current binary version against the latest remote release using the `semver.Compare` library.

### Update Timing and Logic

Before fetching remote data, the `shouldCheckForUpdate` helper (defined in [`src/cmd/main.go`](https://github.com/yorukot/superfile/blob/main/src/cmd/main.go) lines 70-72) validates if a check is necessary. It returns `true` only on first run or when more than 24 hours have passed since the timestamp stored in `variable.LastCheckVersion`. This prevents excessive API calls to GitHub while ensuring users receive timely notifications.

### Version Detection and Notification

When a check occurs, the `checkAndNotifyUpdate` function contacts GitHub's releases API using `variable.LatestVersionURL` via `fetchLatestRelease`. The JSON response is unmarshaled into a struct containing `TagName`, which is compared against `variable.CurrentVersion`. If a newer version exists, `notifyUpdateAvailable` prints a colored terminal prompt containing the direct download link from `variable.LatestVersionGithub`.

## How to Update Superfile Manually

When automatic checks are disabled or when you want to force an immediate update, use one of the three primary installation methods documented in the project README and installer scripts located in `website/public/`.

### Using the Official Installer Script

The fastest method to update on macOS or Linux uses the install script stored at `superfile.dev`:

```bash
bash -c "$(curl -sLo- https://superfile.dev/install.sh)"

```

Windows users can use the equivalent PowerShell script (`install.ps1`) hosted at the same domain.

### Via Package Managers

Superfile distributes through several popular package managers:

- **Windows** – `winget install --id yorukot.superfile` or `scoop install superfile`
- **macOS** – `brew install superfile` (or `brew upgrade superfile` for updates)

### Direct Download from GitHub Releases

Download the `spf` binary (or `spf.exe` for Windows) directly from the latest release page linked in update notifications or available in the repository's releases section.

## Disabling Automatic Update Checks

To prevent Superfile from checking for updates on startup, modify your configuration file:

```bash
echo 'auto_check_update = false' >> ~/.config/superfile/config.toml

```

Alternatively, manually edit `~/.config/superfile/config.toml` and set `auto_check_update = false`. This change takes effect immediately on the next launch without requiring a terminal restart.

## For Developers: Triggering Updates Programmatically

If you are building tools that integrate with Superfile, you can invoke the update check logic directly from Go code:

```go
package main

import (
	"github.com/yorukot/superfile/src/cmd"
)

func main() {
	// Calls the same internal logic used on startup
	cmd.CheckForUpdates()
}

```

## Summary

- **Auto-check enabled by default:** Superfile checks for updates every 24 hours via `CheckForUpdates` in [`src/cmd/main.go`](https://github.com/yorukot/superfile/blob/main/src/cmd/main.go) when `auto_check_update` is `true` (defined in [`src/internal/common/config_type.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/config_type.go)).
- **Configurable behavior:** Disable checks by setting `auto_check_update = false` in `~/.config/superfile/config.toml`.
- **Multiple update paths:** Update manually using the installer script ([`website/public/install.sh`](https://github.com/yorukot/superfile/blob/main/website/public/install.sh)), package managers (winget, scoop, brew), or GitHub releases.
- **Notification only:** The application detects updates using `semver.Compare` but does not auto-install them; you must manually download and replace the binary.

## Frequently Asked Questions

### How often does Superfile automatically check for updates?

Superfile checks for updates no more than once every 24 hours. The `shouldCheckForUpdate` function in [`src/cmd/main.go`](https://github.com/yorukot/superfile/blob/main/src/cmd/main.go) compares the current time against `variable.LastCheckVersion` and only proceeds if the elapsed time exceeds 24 hours or if this is the first run.

### Where is the auto-update configuration stored?

The `auto_check_update` setting resides in your user configuration file at `~/.config/superfile/config.toml` on Linux and macOS (or the equivalent configuration directory on Windows). This boolean flag is defined in the `Config` struct in [`src/internal/common/config_type.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/config_type.go).

### Does Superfile update itself automatically or only notify me?

Superfile only notifies you of available updates through the `notifyUpdateAvailable` function; it does not auto-install updates. You must manually download and install the new version using one of the supported methods (installer script, package manager, or GitHub release download).

### How can I trigger an update check manually from the command line?

While there is no dedicated CLI flag for forcing update checks, you can update immediately by running the installation script (`bash -c "$(curl -sLo- https://superfile.dev/install.sh)"`) or by using your package manager's upgrade command (e.g., `brew upgrade superfile`, `winget upgrade yorukot.superfile`).