Skip to content

Commit d385d97

Browse files
gcmsgclaude
andcommitted
feat: wire up Version variable for GoReleaser ldflags
Replace hardcoded "0.5.0" with cmd.Version variable injected by GoReleaser at build time. Falls back to "dev" for local builds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 80e0d6c commit d385d97

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

internal/cmd/mcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func runMCPServe(args []string, serverURL string) int {
6969
// Create MCP server.
7070
server := mcp.NewServer(&mcp.Implementation{
7171
Name: "peerclaw",
72-
Version: "0.5.0",
72+
Version: Version,
7373
}, nil)
7474

7575
// Register available tools.

internal/cmd/root.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ func addTokenFlag(fs *flag.FlagSet, token *string) {
1212
fs.StringVar(token, "token", t, "JWT auth token (or PEERCLAW_TOKEN env)")
1313
}
1414

15+
// Version is set by GoReleaser via ldflags at build time.
16+
var Version = "dev"
17+
1518
const defaultServer = "http://localhost:8080"
1619

1720
// Run executes the CLI with the given arguments.
@@ -61,7 +64,7 @@ func Run(args []string) int {
6164
printUsage()
6265
return 0
6366
case "version":
64-
fmt.Println("peerclaw version 0.5.0")
67+
fmt.Printf("peerclaw version %s\n", Version)
6568
return 0
6669
default:
6770
fmt.Fprintf(os.Stderr, "unknown command: %s\n\n", args[0])

0 commit comments

Comments
 (0)