Commit graph

36 commits

Author SHA1 Message Date
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
chenbaowang
679333c76f feat(cli): show tags and changelog after successful publish
- Always display tags in publish output
- Show changelog when --changelog flag is provided

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 15:02:32 +08:00
chenbaowang
a7b0485e37 fix(cli package.json): package name changed from @motovis/skillhub to @seasoning/skillhub. 2026-04-14 14:17:36 +08:00
chenbaowang
c86d99f227 feat(explore): add --sort parameter for hot/newest/downloads ordering
- Use /api/v1/skills (compat API) when query is empty to get full stats
- Map sort options: hot=rating, newest=newest, downloads=downloads
- Remove vim-style k/j navigation to fix 'k' key input issue
2026-04-14 14:12:37 +08:00
chenbaowang
ffdf8ae30e fix(skillhub-cli): improve publish output with default namespace hint and fixed status
- Show '(default)' suffix when namespace is global (user didn't specify --namespace)
- Display 'Status: Published' on success instead of 'undefined'
- Keep output clean and informative for user feedback
2026-04-14 11:19:58 +08:00
chenbaowang
a85beea6b9 fix(install): change install method from multiselect to single select 2026-04-14 10:50:28 +08:00
chenbaowang
c8e58e0476 fix(resolve): strip 'v' prefix from version for API compatibility 2026-04-14 10:32:49 +08:00
chenbaowang
6c0d4f4f16 feat(skillhub-cli): add skillhub CLI with interactive multi-agent support
- Interactive agent selection for install/uninstall/list
- Namespace search selection for unspecified namespace
- --skill-version option to skip interactive selection
- --from option for local/github source installation
- Remove deprecated add command (use install --from instead)
- Path-based grouping for uninstall results
2026-04-14 10:21:09 +08:00