From d273cac65c6c8cf8e1b817eef25046c96e99faa5 Mon Sep 17 00:00:00 2001 From: chenbaowang <49091147+Rsweater@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:20:28 +0800 Subject: [PATCH] feat(cli): update hide/unhide commands and reorganize help categories - Remove 'admin only' restriction from hide/unhide commands - Update API endpoint from admin path to portal path - Reorganize help categories: - Move rating to My Skills section - Create new Skill Lifecycle section (archive, hide, unhide) - Remove hide/unhide from Notifications & Admin Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- skillhub-cli/src/cli.ts | 10 +++++++--- skillhub-cli/src/commands/hide.ts | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/skillhub-cli/src/cli.ts b/skillhub-cli/src/cli.ts index d11f32bab..75db78f2e 100644 --- a/skillhub-cli/src/cli.ts +++ b/skillhub-cli/src/cli.ts @@ -67,6 +67,7 @@ function buildTopLevelHelp(version: string): string { sections.push(formatSection("My Skills", [ { cmd: "me skills", desc: "List your published skills", alias: "me ls" }, { cmd: "me stars", desc: "List your starred skills" }, + { cmd: "rating ", desc: "View your rating for a skill" }, { cmd: "reviews", desc: "List your review submissions", alias: "reviews my, reviews submissions" }, ])); sections.push(""); @@ -76,13 +77,18 @@ function buildTopLevelHelp(version: string): string { { cmd: "publish [path]", desc: "Publish a skill to SkillHub registry" }, { cmd: "sync [path]", desc: "Scan and publish all skills from a directory" }, { cmd: "delete ", desc: "Delete a skill you own", alias: "del, unpublish" }, + ])); + sections.push(""); + + sections.push(formatSection("Skill Lifecycle", [ { cmd: "archive ", desc: "Archive a skill you own" }, + { cmd: "hide ", desc: "Hide a skill" }, + { cmd: "unhide ", desc: "Unhide a skill" }, ])); sections.push(""); sections.push(formatSection("Community", [ { cmd: "star ", desc: "Star or unstar a skill" }, - { cmd: "rating ", desc: "View your rating for a skill" }, { cmd: "rate ", desc: "Rate a skill (1-5)" }, { cmd: "report ", desc: "Report a skill for review" }, ])); @@ -91,8 +97,6 @@ function buildTopLevelHelp(version: string): string { sections.push(formatSection("Notifications & Admin", [ { cmd: "notifications", desc: "Manage notifications", alias: "notif" }, { cmd: "namespaces", desc: "List namespaces you have access to" }, - { cmd: "hide ", desc: "Hide a skill (admin only)" }, - { cmd: "unhide ", desc: "Unhide a skill (admin only)" }, { cmd: "transfer ", desc: "Transfer namespace ownership" }, ])); sections.push(""); diff --git a/skillhub-cli/src/commands/hide.ts b/skillhub-cli/src/commands/hide.ts index 5908d6f28..bbca13c02 100644 --- a/skillhub-cli/src/commands/hide.ts +++ b/skillhub-cli/src/commands/hide.ts @@ -35,7 +35,7 @@ async function hideSkill( `/api/v1/skills/${namespace}/${skillSlug}` ); - await client.post(`/api/v1/admin/skills/${detail.id}/${action}`, { + await client.post(`/api/v1/skills/${namespace}/${skillSlug}/${action}`, { body: JSON.stringify({}), headers: { "Content-Type": "application/json" }, }); @@ -58,7 +58,7 @@ async function hideSkill( export function registerHide(program: Command) { program .command("hide") - .description("Hide a skill (admin only)") + .description("Hide a skill") .argument("", "Skill name or namespace/skill-name") .option("-y, --yes", "Skip confirmation") .option("--namespace ", "Override namespace (default: parsed from skill or 'global')") @@ -70,7 +70,7 @@ export function registerHide(program: Command) { export function registerUnhide(program: Command) { program .command("unhide") - .description("Unhide a skill (admin only)") + .description("Unhide a skill") .argument("", "Skill name or namespace/skill-name") .option("-y, --yes", "Skip confirmation") .option("--namespace ", "Override namespace (default: parsed from skill or 'global')")