internal: Fix duplicate v in CLI version display#247
Merged
peterj merged 1 commit intoagentregistry-dev:mainfrom Mar 3, 2026
Merged
internal: Fix duplicate v in CLI version display#247peterj merged 1 commit intoagentregistry-dev:mainfrom
peterj merged 1 commit intoagentregistry-dev:mainfrom
Conversation
Previously, CLI output prepended "v" even when versions already started with "v", producing values like "vv0.0.1". Now, CLI version display normalizes to a single "v" prefix across publish, delete, deploy, and list output paths.
timflannagan
commented
Mar 3, 2026
Comment on lines
+81
to
+84
| // FormatVersionForDisplay normalizes version display with a leading "v". | ||
| func FormatVersionForDisplay(version string) string { | ||
| return versionpkg.EnsureVPrefix(version) | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
A bit awkward, but thought this approach was better for centralizing a way for other CLI commands to call a function that lives in this package vs. calling the exported function in the version package directly.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes inconsistent CLI version formatting that could display semantic versions with a duplicated v prefix (e.g., vv0.0.1) by centralizing version normalization and using it across relevant commands.
Changes:
- Added
common.FormatVersionForDisplay()(backed byinternal/version.EnsureVPrefix) to normalize user-facing version strings. - Updated publish/delete/deploy and agent list output paths to use the centralized formatter instead of hardcoded
(v%s)formatting. - Added unit tests covering the new formatter behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cli/common/common.go | Introduces FormatVersionForDisplay() wrapper for consistent version display. |
| internal/cli/common/common_test.go | Adds tests to prevent regressions in version display formatting. |
| internal/cli/skill/publish.go | Uses the formatter in skill publish success output. |
| internal/cli/mcp/publish.go | Uses the formatter in MCP publish “publishing” + “published” messages. |
| internal/cli/mcp/deploy.go | Uses the formatter in MCP deploy success output. |
| internal/cli/mcp/delete.go | Uses the formatter in MCP delete success output. |
| internal/cli/agent/publish.go | Uses the formatter in agent publish “publishing” + “published” messages. |
| internal/cli/agent/list.go | Uses the formatter when showing deployed version mismatch in table output. |
| internal/cli/agent/delete.go | Uses the formatter in agent delete success output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
peterj
approved these changes
Mar 3, 2026
christian-posta
pushed a commit
to christian-posta/agentregistry
that referenced
this pull request
Mar 9, 2026
# Description This fixes CLI output formatting that could render semantic versions with a duplicated prefix (for example, `vv0.0.1`) when the input version already included `v`. ```bash $ /bin/arctl skill publish --github https://github.com/antfu/skills/tree/main/skills/vue vue --version v0.0.1 ✓ Published: vue (vv0.0.1) ``` The change centralizes version display normalization in `internal/cli/common` and updates publish, delete, deploy, and agent list output paths to use it consistently. Fixes agentregistry-dev#227 # Change Type /kind fix # Changelog ```release-note Fix duplicate `v` prefix in CLI version output across publish, delete, deploy, and list commands. ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This fixes CLI output formatting that could render semantic versions with a duplicated prefix (for example,
vv0.0.1) when the input version already includedv.The change centralizes version display normalization in
internal/cli/commonand updates publish, delete, deploy, and agent list output paths to use it consistently.Fixes #227
Change Type
/kind fix
Changelog