Shared Go library providing self-update and platform abstraction for CLI tools that distribute binaries via GitHub Releases.
- Self-Update: Check for and install updates from GitHub Releases with dry-run, force, and interactive confirmation support
- Platform Abstraction: Cross-platform file operations (Unix/Windows) for download, extract, move, and permissions
- Version Comparison: Semantic version comparison with dev-build awareness
go get github.com/rios0rios0/cliforgeimport "github.com/rios0rios0/cliforge/pkg/selfupdate"
cmd := selfupdate.NewCommand("owner", "repo", "binary-name", currentVersion)
err := cmd.Execute(dryRun, force)The self-update command expects release assets named {binary}-{version}-{os}-{arch}.tar.gz (.zip on Windows), which matches the GoReleaser default naming convention.
Contributions are welcome. See CONTRIBUTING.md for guidelines.
See LICENSE file for details.