mirror of
https://github.com/iflytek/skillhub.git
synced 2026-09-16 23:41:19 +00:00
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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
1ba1c9018a
commit
d273cac65c
2 changed files with 10 additions and 6 deletions
|
|
@ -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 <skill>", 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 <skill>", desc: "Delete a skill you own", alias: "del, unpublish" },
|
||||
]));
|
||||
sections.push("");
|
||||
|
||||
sections.push(formatSection("Skill Lifecycle", [
|
||||
{ cmd: "archive <skill>", desc: "Archive a skill you own" },
|
||||
{ cmd: "hide <skill>", desc: "Hide a skill" },
|
||||
{ cmd: "unhide <skill>", desc: "Unhide a skill" },
|
||||
]));
|
||||
sections.push("");
|
||||
|
||||
sections.push(formatSection("Community", [
|
||||
{ cmd: "star <skill>", desc: "Star or unstar a skill" },
|
||||
{ cmd: "rating <skill>", desc: "View your rating for a skill" },
|
||||
{ cmd: "rate <skill> <score>", desc: "Rate a skill (1-5)" },
|
||||
{ cmd: "report <skill>", 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 <skill>", desc: "Hide a skill (admin only)" },
|
||||
{ cmd: "unhide <skill>", desc: "Unhide a skill (admin only)" },
|
||||
{ cmd: "transfer <ns> <user>", desc: "Transfer namespace ownership" },
|
||||
]));
|
||||
sections.push("");
|
||||
|
|
|
|||
|
|
@ -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>", "Skill name or namespace/skill-name")
|
||||
.option("-y, --yes", "Skip confirmation")
|
||||
.option("--namespace <ns>", "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>", "Skill name or namespace/skill-name")
|
||||
.option("-y, --yes", "Skip confirmation")
|
||||
.option("--namespace <ns>", "Override namespace (default: parsed from skill or 'global')")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue