{"modulePath":"github.com/kernel/cli","version":"v0.54.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package update\n\n## Functions\n\n```go\nfunc FetchLatest(ctx context.Context) (tag string, url string, err error)\n```\nFetchLatest queries GitHub Releases and returns the latest stable tag and URL. It expects that the GitHub API returns releases in descending chronological order (newest first), which is standard behavior.\n\n```go\nfunc IsNewerVersion(current, latest string) (bool, error)\n```\nIsNewerVersion reports whether latest \u003e current using semver rules.\n\n```go\nfunc IsVeryOldVersion(current, latest string) (bool, error)\n```\nIsVeryOldVersion reports whether current is far enough behind latest to warrant an urgent upgrade warning: two or more majors behind, or at least veryOldMinorGap minor versions behind within the same major. A single major bump intentionally does not escalate so v0.x users are not all flagged \"very old\" the day v1.0 ships.\n\n```go\nfunc MaybeShowMessage(ctx context.Context, currentVersion string, frequency time.Duration)\n```\nMaybeShowMessage orchestrates cache, fetch, compare, and printing. It is designed to be non-fatal and fast; errors are swallowed.\n\n```go\nfunc SuggestUpgradeCommand() string\n```\nSuggestUpgradeCommand attempts to infer how the user installed kernel and returns a tailored upgrade command. Falls back to default brew command on unknown.\n\n## Types\n\n```go\ntype Cache struct {\n\tLastChecked      time.Time `json:\"last_checked\"`\n\tLastShownVersion string    `json:\"last_shown_version\"`\n}\n```\nCache stores update-check metadata to throttle frequency and avoid repeating the same banner too often.\n\n```go\ntype InstallMethod string\n```\nInstallMethod represents how kernel was installed\n\n```go\nconst (\n\tInstallMethodBrew    InstallMethod = \"brew\"\n\tInstallMethodPNPM    InstallMethod = \"pnpm\"\n\tInstallMethodNPM     InstallMethod = \"npm\"\n\tInstallMethodBun     InstallMethod = \"bun\"\n\tInstallMethodUnknown InstallMethod = \"unknown\"\n)\n```\n\n```go\nfunc DetectInstallMethod() (InstallMethod, string)\n```\nDetectInstallMethod detects how kernel was installed and returns the method along with the path to the kernel binary.\n\n","path":"github.com/kernel/cli/pkg/update","name":"update","synopsis":"","isRedistributable":true}
