bfi-cli 0.1.41 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -6672,6 +6672,9 @@ async function runPackage(args, globalOpts) {
6672
6672
  case "search":
6673
6673
  await handleSearch(args.slice(1), api, globalOpts);
6674
6674
  break;
6675
+ case "info":
6676
+ await handleServerInfo(args.slice(1), api, globalOpts);
6677
+ break;
6675
6678
  case "create":
6676
6679
  await handleCreate(args.slice(1), api, globalOpts);
6677
6680
  break;
@@ -7055,6 +7058,37 @@ async function handleRemoveSkills(args, api, globalOpts) {
7055
7058
  process.exit(1);
7056
7059
  }
7057
7060
  }
7061
+ async function handleServerInfo(args, api, globalOpts) {
7062
+ const pkgRef = args[0];
7063
+ if (!pkgRef) {
7064
+ console.error("用法:bfi skills package info <package-ref>");
7065
+ process.exit(1);
7066
+ }
7067
+ const { namespace, slug } = parseSkillRef(pkgRef, globalOpts.namespace);
7068
+ const json = args.includes("--json");
7069
+ try {
7070
+ const result = await api.getPackage(namespace, slug);
7071
+ const pkg = result.data || result;
7072
+ if (json) {
7073
+ console.log(JSON.stringify(pkg, null, 2));
7074
+ return;
7075
+ }
7076
+ console.log(`\n${BOLD$1}${pkg.displayName || pkg.name || slug}${RESET$3}`);
7077
+ console.log(`${DIM$3}${"=".repeat(48)}${RESET$3}`);
7078
+ console.log(` ${BOLD$1}Slug:${RESET$3} ${toCanonicalSlug(namespace, slug)}`);
7079
+ console.log(` ${BOLD$1}命名空间:${RESET$3} @${namespace}`);
7080
+ console.log(` ${BOLD$1}可见性:${RESET$3} ${pkg.visibility || "PRIVATE"}`);
7081
+ const skills = pkg.skills || [];
7082
+ if (skills.length > 0) {
7083
+ console.log(`\n ${BOLD$1}技能(${skills.length} 个):${RESET$3}`);
7084
+ for (const s of skills) console.log(` ${DIM$3}- ${s.displayName || s.slug} (${s.namespace || namespace}--${s.slug})${RESET$3}`);
7085
+ }
7086
+ console.log();
7087
+ } catch (error) {
7088
+ console.error(`${RED$1}获取包信息失败:${error.message}${RESET$3}`);
7089
+ process.exit(1);
7090
+ }
7091
+ }
7058
7092
  function getOptionValue(args, flag) {
7059
7093
  const idx = args.indexOf(flag);
7060
7094
  return idx !== -1 && args[idx + 1] ? args[idx + 1] : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bfi-cli",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "用友大业财BFI统一命令行工具,支持技能,技能包,元数据,UI元数据等",
5
5
  "type": "module",
6
6
  "bin": {
@@ -62,7 +62,11 @@ bfi skills add <来源> -y # 跳过确认
62
62
  ### 1.4 技能包操作
63
63
  ```bash
64
64
  bfi skills package search # 列出所有技能包
65
+ bfi skills package info @ns/pkg # 查看包详情
66
+
65
67
  bfi skills package search <关键词> # 按关键词搜索
68
+ bfi skills package info @ns/pkg # 查看包详情
69
+
66
70
  bfi skills package install @ns/pkg # 安装包(含全部技能)
67
71
  bfi skills package list # 查看已安装的包
68
72
  bfi skills package uninstall @ns/pkg # 卸载包(含全部技能)