A Go package for CLI tools that automatically collects and displays version information in multiple formats.
version is a Go package that automatically collects and displays version information for command-line interface (CLI) applications. It solves the problem of repetitive version command implementation by leveraging Go 1.18+ build info to detect version data and present it in multiple formats like YAML, JSON, and pretty output.
Go developers building CLI tools with frameworks like Cobra or urfave/cli who want to implement professional version commands without writing boilerplate code.
Developers choose version because it eliminates repetitive version management code with a single-line integration, provides automatic upgrade notices, and offers polished output formats—all while maintaining full customization and extensibility.
🧬 Pure DNA of your CLI
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages Go 1.18+ embedded build info to detect version, commit, and date automatically, eliminating manual collection boilerplate as highlighted in the README.
Provides YAML, JSON, short, and pretty formats for clean version presentation, catering to different user preferences and use cases.
Enables full version command functionality with a single line of code for Cobra, simplifying setup and reducing repetitive code.
Detects and displays notices for newer project releases via WithUpgradeNotice, enhancing user experience without extra developer effort.
Allows overriding version data via ldflags and extending info with custom Go structs, offering flexibility for advanced use cases.
Requires Go 1.18+ for automatic build info detection, limiting compatibility with projects that cannot upgrade from older Go versions.
For simple CLI tools with basic version output, the package adds unnecessary complexity and an external dependency compared to lightweight custom code.
The README lists 'Autodiscover installation method' as a commented-out feature, indicating it's a planned but not yet implemented weakness.