Skip to content

rios0rios0/cliforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

cliforge

Latest Release License Go Reference

Shared Go library providing self-update and platform abstraction for CLI tools that distribute binaries via GitHub Releases.

Features

  • 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

Installation

go get github.com/rios0rios0/cliforge

Usage

import "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.

Contributing

Contributions are welcome. See CONTRIBUTING.md for guidelines.

License

See LICENSE file for details.

About

Shared Go library providing self-update and platform abstraction for CLI tools that distribute binaries via GitHub Releases.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors