Skip to content

internal: Fix duplicate v in CLI version display#247

Merged
peterj merged 1 commit intoagentregistry-dev:mainfrom
timflannagan:fix/double-v-prefix
Mar 3, 2026
Merged

internal: Fix duplicate v in CLI version display#247
peterj merged 1 commit intoagentregistry-dev:mainfrom
timflannagan:fix/double-v-prefix

Conversation

@timflannagan
Copy link
Copy Markdown
Collaborator

@timflannagan timflannagan commented Mar 3, 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.

$ /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 #227

Change Type

/kind fix

Changelog

Fix duplicate `v` prefix in CLI version output across publish, delete, deploy, and list commands.

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.
Copilot AI review requested due to automatic review settings March 3, 2026 15:20
Comment on lines +81 to +84
// FormatVersionForDisplay normalizes version display with a leading "v".
func FormatVersionForDisplay(version string) string {
return versionpkg.EnsureVPrefix(version)
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by internal/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 peterj added this pull request to the merge queue Mar 3, 2026
Merged via the queue into agentregistry-dev:main with commit d31aa1b Mar 3, 2026
13 checks passed
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.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix "vlatest" output when publishing agents/servers with non-semver versions

3 participants