areweplaying/cmd/cli/cmd/version.go
Harry Culpan a7ebc192c8 Add build version/time stamp to Setup page and awp-cli version command
Embeds the git short hash and UTC build timestamp into both binaries
via ldflags so it's easy to confirm which build is actually deployed,
without needing to hand-maintain a version number.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-11 19:33:40 -04:00

25 lines
496 B
Go

/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
"fmt"
"github.com/hculpan/areweplaying/pkg/version"
"github.com/spf13/cobra"
)
// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the build version and time",
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Printf("awp-cli %s (built %s)\n", version.Version, version.BuildTime)
return nil
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}