From b6320afc69b3099c6bce5ddf5ab3cdb99e4530af Mon Sep 17 00:00:00 2001 From: rexdotsh <65942753+rexdotsh@users.noreply.github.com> Date: Thu, 26 Feb 2026 21:10:25 +0530 Subject: [PATCH] fix: normalize repo URLs in remove command --- src/commands/remove.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/remove.ts b/src/commands/remove.ts index 822d486..1bfea90 100644 --- a/src/commands/remove.ts +++ b/src/commands/remove.ts @@ -11,7 +11,7 @@ import { type PackageEntry, type RepoEntry, } from "../lib/agents.js"; -import { isRepoSpec } from "../lib/repo.js"; +import { isRepoSpec, parseRepoSpec } from "../lib/repo.js"; import { getFileModificationPermission } from "../lib/settings.js"; import { detectRegistry } from "../lib/registries/index.js"; import type { Registry } from "../types.js"; @@ -42,10 +42,11 @@ export async function removeCommand( if (isRepo) { // Try to remove as repo - // Convert formats like "vercel/vercel" to "github.com/vercel/vercel" if needed + // Normalize input to "host/owner/repo" format used in sources.json let displayName = item; - if (item.split("/").length === 2 && !item.startsWith("http")) { - displayName = `github.com/${item}`; + const parsed = parseRepoSpec(item); + if (parsed) { + displayName = `${parsed.host}/${parsed.owner}/${parsed.repo}`; } if (!repoExists(displayName, cwd)) {