Skip to content

Add version command with goreleaser integration#11

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-version-command
Draft

Add version command with goreleaser integration#11
Copilot wants to merge 3 commits intomainfrom
copilot/add-version-command

Conversation

Copy link

Copilot AI commented Feb 14, 2026

Adds a version command that displays version information based on build context: clean output for tagged releases, detailed snapshot info for development builds.

Changes

  • cmd/version.go: New command with variables (version, commit, date) injected via ldflags at build time
  • .goreleaser.yaml: Configured ldflags to inject {{.Version}}, {{.Commit}}, {{.Date}} template variables
  • cmd/version_test.go: Test coverage for tagged releases, snapshots, and dev builds

Behavior

# Tagged release
$ semvertool version
semvertool v1.2.3

# Snapshot build (non-tagged commit)
$ semvertool version
semvertool v0.0.0-next (snapshot)
  commit: abc123def456
  built:  2025-02-14T10:30:00Z

# Local dev build (no ldflags)
$ semvertool version
semvertool dev (snapshot)
  commit: none
  built:  unknown

Command logic branches on whether version == "dev" (local build) or commit is populated (goreleaser snapshot) to determine output format.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add version command</issue_title>
<issue_description></issue_description>

<agent_instructions>Create a version command that prints the current version of the tool. If it is a tagged version it should return the tag, if was not built from a tag it should include information that it is a snapshot and info about the commit. Use the information generated by goreleaser for the tag information</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 14, 2026 05:58
Co-authored-by: jaevans <54334+jaevans@users.noreply.github.com>
Co-authored-by: jaevans <54334+jaevans@users.noreply.github.com>
Copilot AI changed the title [WIP] Add version command to display tool's current version Add version command with goreleaser integration Feb 14, 2026
Copilot AI requested a review from jaevans February 14, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add version command

2 participants