Commit graph

57 commits

Author SHA1 Message Date
chenbaowang
5caf0b360b feat(cli): reorganize help categories - merge Skill Lifecycle into Publish & Manage
- Merge 'Skill Lifecycle' commands (archive, hide, unhide) into 'Publish & Manage'
- Move 'reviews' from My Profile to Publish & Manage (related to publish workflow)
- Rename section from 'Publish & Content' to 'Publish & Manage'

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 16:45:30 +08:00
chenbaowang
0bfcb028c2 feat(cli): move namespaces to me subcommand and reorganize help categories
- Add 'me namespaces' subcommand to list accessible namespaces
- Remove standalone 'namespaces' command from CLI
- Rename 'My Skills' help section to 'My Profile'
- Move namespaces listing under My Profile section

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 15:41:00 +08:00
chenbaowang
d273cac65c 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>
2026-04-24 15:20:28 +08:00
chenbaowang
c14b844c10 refactor(cli): merge list/check commands, unify skill status display
- Merge list and check into unified list command with status filtering
- Add skill-status.ts core module for shared discovery logic
- Unify interaction flow: scope -> agent -> status -> display
- Replace -g/-p/-a flags with --scope option
- Simplify check as alias for list --status managed,missing
- Fix uninstall to properly handle 'All' scope selection
- Display orphaned skills with [orphaned] marker in uninstall
- Update help text and examples

BREAKING CHANGE: Removed -g/--global, -p/--project, -a/--all flags from list command.
Use --scope global|project|all instead.
2026-04-24 14:58:07 +08:00
chenbaowang
d96fb008f9 feat(cli): enhance error handling and auto-create output directory 2026-04-24 11:40:50 +08:00
chenbaowang
bc9b3d1eb2 fix(cli): rename loop variable to avoid conflict with info function 2026-04-24 11:39:54 +08:00
chenbaowang
67c0726046 fix(cli): enhance 503 error handling in download command 2026-04-24 10:58:55 +08:00
chenbaowang
898325ac67 fix(cli): restore -v short option for --skill-version 2026-04-24 10:24:10 +08:00
chenbaowang
84a7288621 fix(cli): remove debug logging from api-client 2026-04-24 10:18:36 +08:00
chenbaowang
aa9fd5f771 feat(cli): add command aliases and unhide command 2026-04-24 10:16:16 +08:00
chenbaowang
f4752f2d9b feat(cli): 优化 download 和 update 命令,添加友好错误提示
- download: 添加智能搜索 namespace 和交互式版本选择
- download: 修复下载失败仍创建文件的问题
- update: 重写为带版本对比的更新流程
- update: 添加 -y/--yes 选项跳过确认
- star/rating/rate/report/delete/archive/hide/unhide: 添加 404 友好错误提示
- 提示用户使用 namespace/skill-name 格式
2026-04-23 17:32:13 +08:00
chenbaowang
273e14a26f feat(cli): 添加 --namespace 选项和智能 namespace 解析
- 新建 skill-resolver.ts 公共函数,提供 resolveSkillNamespace 和 parseSkillNamespace
- 为 resolve, download, star, rating, rate, report, delete, archive, hide, unhide 添加 --namespace 选项
- inspect 使用 resolveSkillNamespace 替代手动解析
- install 优化 --from 为主选项,-a, --add 为别名
- download 优化帮助界面,添加 Examples 和更清晰的描述
2026-04-23 15:20:38 +08:00
chenbaowang
58ee1a5220 fix(install): 修复帮助文本中的循环引用
将 --from 描述改为 'Alias for --add',避免与 -a, --add 的
描述互相引用导致循环感
2026-04-23 14:17:10 +08:00
chenbaowang
3239b4d5b8 fix(inspect): 修复版本选项与全局 --version 冲突
将 inspect 命令的版本选项从 --version 改为 --skill-version,
避免与 skillhub --version 全局版本选项冲突
2026-04-23 14:08:39 +08:00
chenbaowang
08ce3d59a1 feat(cli): 优化帮助界面和命令结构
- 重新组织帮助分类(Publish → Publish & Manage)
- 统一参数命名为 <skill>,添加参数说明
- 简化 config 命令描述
- 优化 explore 帮助,添加选项分组和示例
- 修复参数重复显示问题
- 子命令帮助显示 Arguments 部分
2026-04-23 12:33:04 +08:00
chenbaowang
c7d4f8273d feat(cli): enhance inspect with interactive selection and reorganize help sections
- Add interactive namespace selection to inspect command (like install)
- Add version selection when multiple versions exist (--version to skip)
- Skip version selection when --details is specified (shows all versions)
- Add error handling for 403/404 errors with helpful messages
- Add 'for installation' and 'for details' hints to explore command
- Reorganize help: separate 'Discover & Info' and 'Social & Reviews' sections
2026-04-22 18:02:53 +08:00
chenbaowang
f33a9e0a10 feat(cli): add inspect hint after explore selection 2026-04-22 16:40:51 +08:00
chenbaowang
4a7ebb4efc feat(cli): implement comprehensive sort strategy with backend and client-side sorting
- Backend sorts (direct API): newest, downloads, rating
- Client-side sorts (fetch then re-sort): hot, stars
- Add --rating option for rating-based sorting (backend supported)
- Add applyClientSort() function for client-side sorting logic
- Hot sort formula: downloads * 0.6 + stars * 0.4
- Update SearchSkill interface to include stars, rating, updatedAt fields
- Ensure all sort options work correctly with both list and search APIs
2026-04-22 16:35:06 +08:00
chenbaowang
2fffc2b377 fix(cli): remove unsupported rating sort, add stars sort, clean up versions command
- Remove --rating option and rating sort (API doesn't support it)
- Add --stars shorthand for star-based sorting
- Fix interactive-search.ts to use stars sort instead of rating
- Add ratingAvg field to SkillDetail and display in explore output
- Delete deprecated versions.ts command (functionality merged into inspect)
2026-04-22 16:01:12 +08:00
chenbaowang
3349182072 fix(cli): fix show-env-instructions output format
- Replace dim() function calls with chalk.dim() to return strings
- Use array join approach for clean output formatting
- Fix undefined output in environment variable instructions
2026-04-22 14:11:31 +08:00
chenbaowang
a1fb6d261e feat(cli): simplify config command and enhance inspect/install
- Simplify config command: remove <key> parameter, hardcode registry
- config set <value> now directly sets registry URL
- config get shows resolved value with source information
- Add --source option to config get for env/file/resolved
- Add version normalization (strip 'v' prefix) in install
- Skip version selection when --skill-version or --tag specified
- Enhance inspect with --details option for version history
- Reorganize help: Configuration at top, Discover & Info merged
- Move SkillVersionItem types to schema/routes.ts
- Fix error handling to return after setting exit code
- Remove versions command registration (file retained for compatibility)
2026-04-22 13:45:16 +08:00
chenbaowang
acea441625 feat(cli): enhance inspect/install commands and reorganize help
- Add --details option to inspect for version history and tags
- Normalize version input (strip 'v' prefix) in install command
- Skip version selection when --skill-version or --tag is specified
- Reorganize help: merge Discover & Info sections
- Move SkillVersionItem/VersionsResponse types to schema/routes.ts
- Remove versions command registration from CLI (file retained for now)
- Fix error handling to return after setting exit code
- Update tests to reflect command changes
2026-04-21 19:40:02 +08:00
chenbaowang
d4ea485662 fix(cli): fix registry config priority for login and all commands
- Remove hardcoded default from Commander --registry option that
  overrode config file settings in ALL commands
- Login command now uses loadConfigFromProgram() like other commands
  instead of hardcoded http://localhost:8080
- Improved login error messages with registry URL context
2026-04-21 17:32:06 +08:00
chenbaowang
d96ef86fac fix(cli): replace process.exit(1) with process.exitCode = 1
process.exit() forcefully kills the process, preventing libuv from
cleanly closing HTTP connections (undici). On Windows this triggers
an assertion failure: UV_HANDLE_CLOSING.

Using process.exitCode = 1 lets Node.js exit gracefully after the
event loop drains, eliminating the assertion error while still
returning exit code 1.
2026-04-21 10:54:50 +08:00
chenbaowang
8815c1596c fix(cli): human-readable API error messages
ApiError previously displayed raw JSON like:
  API error 403: {"code":403,"msg":"Access denied..."}

Now extracts the msg field from the API response body and displays:
  Access denied to skill: find-skills
  Run `skillhub login` to authenticate.

Changes:
- Add extractHumanMessage() to pull msg/message/error from response
- ApiError.message now shows human text instead of raw JSON
- 401/403 responses append login hint
- whoami: remove redundant 'Not authenticated:' prefix
2026-04-21 10:21:32 +08:00
chenbaowang
6a6df19f4b chore(cli): bump version to 1.1.3 for --registry parameter fix 2026-04-21 00:12:01 +08:00
chenbaowang
2543cd52e7 fix(cli): make --registry parameter work for all commands
Fixed the issue where the --registry command-line parameter was defined
but not actually used by any commands.

Changes:
- Added loadConfigFromProgram() helper in config.ts to read registry from program.opts()
- Updated all 21 command files to use loadConfigFromProgram() instead of loadConfig()
- Ensured correct priority: CLI args > env vars > config file > defaults

Priority order:
1. --registry <url> (command-line flag) - highest priority
2. SKILLHUB_REGISTRY (environment variable)
3. ~/.skillhub/config.json (config file)
4. http://localhost:8080 (default value)

This allows users to temporarily override the registry without modifying
environment variables or config files, providing better flexibility for:
- Testing against different registries
- Multi-project/multi-environment setups
- CI/CD automation scripts

Updated commands:
- install, download, update, check, sync, uninstall
- explore, search
- publish, delete, archive, versions
- inspect, resolve, rating, rate, star, report, reviews
- whoami, me, namespaces, notifications
- transfer, hide, unhide

Fixes issue where `npx motovis-skillhub install <skill> --registry <url>`
would ignore the --registry parameter and use env vars or defaults instead.
2026-04-21 00:07:15 +08:00
chenbaowang
ee18161d56 feat(cli): improve list and check commands with better filtering
list.ts:
- Remove locked universal section, all agents are now equal
- Users manually select which agents to list from
- No default selections, cleaner UX

check.ts:
- Add agent filtering via --agent flag or interactive selection
- Add status filtering via --status flag or interactive selection
- Default to showing only OK + Missing (not Orphaned)
- Interactive prompts for scope, agents, and statuses
- Show agent names and scope prefix in output
- Smart defaults reduce noise from orphaned skills
2026-04-20 20:24:44 +08:00
chenbaowang
3cf4d64cf5 chore(cli): bump version to 1.1.2 2026-04-20 19:53:35 +08:00
chenbaowang
04bc62fed4 feat(cli): add scope-aware universal grouping and improve output formatting
- list.ts: use isUniversalForScope for dynamic grouping based on scope
- list.ts: group output by skill name to avoid duplicate path listings
- uninstall.ts: use isUniversalForScope for dynamic grouping
- uninstall.ts: add printUninstallResults for consistent formatted output
- .npmignore: exclude development files from npm package
- package.json: bump version to 1.1.1
2026-04-20 19:49:17 +08:00
chenbaowang
e5da7397fa refactor(cli): sort all list outputs and agent names alphabetically
- update.ts: sort skill selection list alphabetically
- check.ts: sort results by status then name, sort agent names in locations
- install.ts: sort agent names in buildAgentSummary, sort --list output
- sync.ts: sort discovered skills by name before display

Ensures consistent alphabetical ordering across all CLI commands for
better user experience and predictability.
2026-04-20 19:49:16 +08:00
chenbaowang
b6301cb9a9 chore(cli): bump version to 1.1.0 2026-04-20 19:49:16 +08:00
chenbaowang
86b8de1fbc feat(cli): merge install results by path for cleaner output
Group agents that share the same install path into a single line.
When more than 5 agents share a path, show first 5 names + count.
Sort agent names alphabetically within each group.
Extract buildInstallResultLines utility function to DRY up
duplicate output logic in installFromRegistry and installFromGit.
2026-04-20 19:49:15 +08:00
chenbaowang
aaf80dbfd8 fix(cli): sort agent lists alphabetically and fix spinner residue
- Sort universal and non-universal agent lists by name in selectAgentsInteractive
- Exclude agents with showInUniversalList===false from locked section
- Replace spinner.stop() with spinner.succeed() before interactive prompts
  to prevent 'Fetching' text from appearing as the step title
- Also fix spinner.stop -> spinner.succeed for 'Installation complete'
2026-04-20 19:49:15 +08:00
chenbaowang
3353953675 fix(cli): determine scope before agent selection for correct universal grouping
- Move scope selection before agent selection in both installFromRegistry
  and installFromGit flows
- Use isUniversalForScope in selectAgentsInteractive so that the Universal
  locked section correctly reflects the actual scope:
  - Project: agents with skillsDir='.agents/skills' (Cline, Codex, Cursor, etc.)
  - Global: agents with globalSkillsDir='.agents/skills' (Cline, Warp only)
- Clean up unused getUniversalAgents/getNonUniversalAgents imports
2026-04-20 19:49:15 +08:00
chenbaowang
32395ee5c2 refactor(cli): use dynamic isUniversalForScope instead of static isUniversalAgent
- Add isUniversalForScope(agent, isGlobal) and getAgentTargetDir(agent, isGlobal) to agent-detector.ts
- An agent is 'universal' when its target install dir equals the canonical .agents/skills directory
- This fixes incorrect symlink skipping for agents like Codex/Cursor whose globalSkillsDir
  differs from .agents/skills (e.g. .codex/skills, .cursor/skills)
- Update installer.ts to use dynamic check via optional AgentInfo parameter
- Update install.ts to use getAgentTargetDir and pass agent info to installSkill
- Update uninstall.ts to use isUniversalForScope for correct path resolution
- Clean up unused isUniversalAgent import in list.ts
2026-04-20 19:48:58 +08:00
chenbaowang
ea4e206ad6 chore(cli): update .npmignore and add release scripts
- Remove "还未发布" from .npmignore, add src/ to excludes
- Add scripts/notify-feishu.sh for Feishu bot release notifications
- Add scripts/release-cli.sh for one-click CLI release workflow
2026-04-20 10:42:12 +08:00
chenbaowang
39db503700 fix(cli): improve install spinner messages and fix interactive search conflict
- Stop spinner before runInteractiveSearch to prevent terminal UI conflict
  (same issue as version selection p.select)
- Make spinner messages more specific: include skill name, version, path
  instead of generic "Fetching"/"Downloading"/"Extracting"
2026-04-20 09:37:59 +08:00
chenbaowang
90809c47ab fix(cli): stop spinner before version selection to prevent UI conflict
The ora spinner was still running during p.select() interactive prompt,
causing the spinner to continuously overwrite the terminal and block
the version selection UI. The user would see "Fetching..." stuck until
pressing Enter.

Stop spinner before p.select() and restart after selection completes.
2026-04-17 18:49:23 +08:00
chenbaowang
5cf44c5a98 feat(cli): custom grouped help page with aliases and examples 2026-04-16 23:26:41 +08:00
chenbaowang
ed21388c30 chore: bump version to 1.0.6 2026-04-16 15:47:51 +08:00
chenbaowang
601644b8a7 fix(cli): fix addToLock namespace doubling, update fallback path, and download stream completion
- install: use actualSlug instead of raw slug in addToLock to prevent
  namespace doubling (vision2group/vision2group/slug)
- update: remove hardcoded 'node dist/cli.mjs' fallback, rely on
  process.argv[1] which is always reliable
- download: use finished() to ensure stream write completes before
  proceeding
2026-04-16 14:46:55 +08:00
chenbaowang
616319fe35 fix(cli): replace execSync unzip with unzipper for cross-platform support
- Add @types/unzipper for TypeScript support
- Fix location header type assertion (string | string[] -> string)
- Bump version to 1.0.5
2026-04-16 11:18:20 +08:00
chenbaowang
c970a76410 chore: bump version to 1.0.3 2026-04-16 10:51:29 +08:00
chenbaowang
626490e554 feat(cli): support SKILLHUB_REGISTRY env var for registry URL
Priority: SKILLHUB_REGISTRY env var > ~/.skillhub/config.json > default
2026-04-16 10:49:40 +08:00
chenbaowang
c9644e8032 chore: bump version to 1.0.2 2026-04-16 10:31:30 +08:00
chenbaowang
af6ebf3058 fix(cli): handle 302 redirect in download and fix --skill-version option parsing
- undici does not auto-follow HTTP redirects, manually follow 302/307/308
  to MinIO presigned URL before piping response body
- Commander.js parses --skill-version as skillVersion (camelCase), not
  skill-version (kebab-case), fix option access in install and download
  commands
2026-04-16 10:16:33 +08:00
chenbaowang
8c87cc5fe4 fix: add shebang to cli.ts for npm bin to work properly 2026-04-15 17:56:42 +08:00
chenbaowang
de7be0fc7d fix: add .npmignore to exclude tests and tmp from published package 2026-04-15 17:15:36 +08:00
chenbaowang
98b04259d8 fix: change package name to @motovis/skillhub for npm org scope 2026-04-15 17:12:32 +08:00