xc-skills 1.0.6 → 1.1.1
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/README.md +27 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,33 @@ xc-skills add . --dir my-rules
|
|
|
69
69
|
xc-skills add . --out ./my-debug-folder
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
### 5.
|
|
72
|
+
### 5. 查看已安装的技能
|
|
73
|
+
|
|
74
|
+
你可以列出当前项目或全局已安装的所有技能:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# 查看当前项目的技能
|
|
78
|
+
xc-skills list
|
|
79
|
+
|
|
80
|
+
# 查看全局已安装的技能
|
|
81
|
+
xc-skills list -g
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 6. 清理项目技能目录
|
|
85
|
+
|
|
86
|
+
如果你想删除当前项目中安装的所有技能目录(如 `.agent`, `.trae` 等),可以使用 `remove` 命令:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
xc-skills remove
|
|
90
|
+
# 或者使用别名
|
|
91
|
+
xc-skills cleanup
|
|
92
|
+
xc-skills rm
|
|
93
|
+
|
|
94
|
+
# 清理全局目录下的技能
|
|
95
|
+
xc-skills remove --global
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 6. 参数化运行
|
|
73
99
|
|
|
74
100
|
```bash
|
|
75
101
|
# 自动安装所有技能到 Antigravity(跳过交互)
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{cac as F}from"cac";import*as e from"@clack/prompts";import m from"picocolors";import o from"fs-extra";import{join as w,resolve as b}from"path";import E from"os";import{execSync as M}from"child_process";import N from"degit";import S from"os";import{join as x}from"path";var v=[{name:"Antigravity",path:x(S.homedir(),".agent/skills"),description:"Custom AI agent for XC development"},{name:"Trae",path:x(S.homedir(),".trae/skills"),description:"Trae AI IDE"},{name:"Codex",path:x(S.homedir(),".codex/skills"),description:"Codex AI assistant"},{name:"Claude Code",path:x(S.homedir(),".claude/skills"),description:"Anthropic Claude Code CLI"}];import y from"fs-extra";import{join as j,dirname as R,basename as L}from"path";import*as I from"@clack/prompts";import P from"picocolors";import G from"os";async function D(l){let{sourceDir:t,targetAgents:k,selectedSkills:r,scope:s,method:$,strategy:g,customRoot:A}=l,u=I.spinner();for(let c of k){let a="";if(A)a=A;else if(s==="project"){let p=L(R(c.path));a=j(process.cwd(),p,"skills")}else a=c.path.replace(/^~/,G.homedir());u.start(`\u6B63\u5728\u90E8\u7F72\u5230 ${c.name} (${a})...`);try{g==="overwrite"&&await y.pathExists(a)?await y.emptyDir(a):await y.ensureDir(a);for(let p of r){let h=j(t,p),f=j(a,p);await y.pathExists(f)&&await y.remove(f),$==="symlink"?await y.ensureSymlink(h,f,"dir"):await y.copy(h,f)}u.stop(`\u6210\u529F\u540C\u6B65\u5230: ${c.name} (${s==="custom"?"\u81EA\u5B9A\u4E49\u8DEF\u5F84":s+" \u6A21\u5F0F"})`)}catch(p){u.stop(`${P.red("\u5931\u8D25")}: ${c.name} - ${p.message}`)}}}var C=F("xc-skills");function O(l){try{let t=w(l,"SKILL.md");if(o.existsSync(t)){let r=o.readFileSync(t,"utf-8").match(/description:\s*['"]?([^'"\n\r]+)['"]?/);return r?r[1].trim():""}}catch{}return""}C.command("add <source>","Add skills from a local directory or GitHub URL").option("-s, --skill <skills>","Specific skills to install").option("-a, --agent <agents>","Specific agents to install to").option("-d, --dir <dir>","The directory name containing skills",{default:"skills"}).option("-o, --out <path>","Specify a custom output directory").option("-y, --yes","Skip confirmation prompts").action(async(l,t)=>{e.intro(`${m.bgCyan(m.black(" xc-skills "))}`);let k="",r=!1,s=w(E.tmpdir(),`xc-skills-${Date.now()}`),$=l.startsWith("http")||l.startsWith("git@")||l.includes("/")&&!o.existsSync(b(process.cwd(),l));if($){let i=e.spinner();i.start(`\u6B63\u5728\u5C1D\u8BD5\u4E0B\u8F7D\u6280\u80FD\u5E93: ${l}`);let n=!1;try{await N(l,{cache:!1,force:!0,verbose:!1}).clone(s),n=!0,i.stop("\u4E0B\u8F7D\u6210\u529F (degit)")}catch{try{i.message("degit \u4E0D\u652F\u6301\u6B64\u5E73\u53F0\uFF0C\u6B63\u5728\u5C1D\u8BD5\u4F7F\u7528 git clone..."),M(`git clone --depth 1 ${l} ${s}`,{stdio:"ignore"}),o.existsSync(w(s,".git"))&&await o.remove(w(s,".git")),n=!0,i.stop("\u4E0B\u8F7D\u6210\u529F (git clone)")}catch(T){i.stop(m.red(`\u4E0B\u8F7D\u5931\u8D25: ${T.message}`)),process.exit(1)}}n&&(k=s,r=!0)}else k=b(process.cwd(),l);let g=w(k,t.dir);o.existsSync(g)||(e.log.error(`\u627E\u4E0D\u5230\u6280\u80FD\u76EE\u5F55: ${g}`),r&&await o.remove(s),process.exit(1));let u=(await o.readdir(g,{withFileTypes:!0})).filter(i=>i.isDirectory()&&!i.name.startsWith(".")).map(i=>{let n=i.name,d=O(w(g,n));return{name:n,description:d}});u.length===0&&(e.log.error(`\u5728 ${g} \u4E2D\u6CA1\u6709\u627E\u5230\u4EFB\u4F55\u6709\u6548\u7684\u6280\u80FD\u5B50\u76EE\u5F55`),r&&await o.remove(s),process.exit(1));let c=[];t.yes||t.skill==="*"?c=u.map(i=>i.name):t.skill?c=t.skill.split(","):c=await e.multiselect({message:"\u7B2C\u4E00\u6B65\uFF1A\u9009\u62E9\u8981\u5B89\u88C5\u7684\u6280\u80FD (Select skills)",options:u.map(i=>({value:i.name,label:i.name,hint:i.description})),initialValues:[u[0].name]}),e.isCancel(c)&&(r&&await o.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let a=[];if(t.out)a=[{name:"Custom Path",path:b(process.cwd(),t.out)}];else if(t.yes||t.agent==="*")a=v;else if(t.agent){let i=t.agent.split(",");a=v.filter(n=>i.includes(n.name))}else a=await e.multiselect({message:"\u7B2C\u4E8C\u6B65\uFF1A\u9009\u62E9\u76EE\u6807\u5F00\u53D1\u5DE5\u5177 (Select agents)",options:v.map(i=>({value:i,label:i.name,hint:i.path.replace(E.homedir(),"~")})),initialValues:[v[0]]});e.isCancel(a)&&(r&&await o.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let p=t.out?"custom":"project";!t.out&&!t.yes&&(p=await e.select({message:"\u7B2C\u4E09\u6B65\uFF1A\u9009\u62E9\u5B89\u88C5\u8303\u56F4 (Installation scope)",options:[{value:"project",label:"Project (\u9879\u76EE\u7EA7)",hint:"./.<agent>/skills"},{value:"global",label:"Global (\u5168\u5C40)",hint:"\u5DE5\u5177\u9ED8\u8BA4\u8DEF\u5F84"}]})),e.isCancel(p)&&(r&&await o.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let h="symlink";r?h="copy":t.yes||(h=await e.select({message:"\u7B2C\u56DB\u6B65\uFF1A\u9009\u62E9\u5B89\u88C5\u65B9\u5F0F (Installation method)",options:[{value:"symlink",label:"Symlink (\u8F6F\u94FE\u63A5 - \u63A8\u8350)",hint:"\u4E0E\u6E90\u7801\u4FDD\u6301\u5B9E\u65F6\u540C\u6B65"},{value:"copy",label:"Copy (\u7269\u7406\u62F7\u8D1D)",hint:"\u590D\u5236\u6587\u4EF6\u526F\u672C"}]})),e.isCancel(h)&&(r&&await o.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let f="merge";if(!t.yes){let i=!1;for(let n of a){let d=n.path;if(await o.pathExists(d)){i=!0;break}}i&&(f=await e.select({message:"\u68C0\u6D4B\u5230\u76EE\u6807\u76EE\u5F55\u5DF2\u5B58\u5728\uFF0C\u5982\u4F55\u5904\u7406\uFF1F(Handle conflicts)",options:[{value:"merge",label:"Merge (\u5408\u5E76)",hint:"\u53EA\u66F4\u65B0\u9009\u4E2D\u7684\u6280\u80FD\uFF0C\u4FDD\u7559\u5176\u4ED6\u6280\u80FD"},{value:"overwrite",label:"Overwrite (\u8986\u76D6)",hint:"\u6E05\u7A7A\u76EE\u6807\u76EE\u5F55\u540E\u518D\u5B89\u88C5"}]}))}if(e.isCancel(f)&&(r&&await o.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0)),!t.yes){e.log.message(`${m.cyan("\u5B89\u88C5\u7EFC\u8FF0 (Installation Summary)")}`),[`${m.dim("Source:")} ${$?l:"Local"}`,`${m.dim("Skills:")} ${c.join(", ")}`,t.out?`${m.dim("Target:")} ${a[0].path}`:`${m.dim("Agents:")} ${a.map(d=>d.name).join(", ")}`,`${m.dim("Scope:")} ${p}`,`${m.dim("Method:")} ${h}`,`${m.dim("Strategy:")} ${f}`].forEach(d=>e.log.message(` ${d}`));let n=await e.confirm({message:"\u786E\u8BA4\u5B89\u88C5\uFF1F(Proceed with installation?)",initialValue:!0});(e.isCancel(n)||!n)&&(r&&await o.remove(s),e.cancel("\u5B89\u88C5\u5DF2\u53D6\u6D88"),process.exit(0))}await D({sourceDir:g,targetAgents:a,selectedSkills:c,scope:p,method:h,strategy:f,customRoot:t.out?b(process.cwd(),t.out):void 0}),r&&await o.remove(s),e.outro(m.green("\u5B89\u88C5\u5B8C\u6210\uFF01(Installation complete)"))});C.help();C.version("1.0.6");C.parse();
|
|
2
|
+
import{cac as L}from"cac";import*as e from"@clack/prompts";import c from"picocolors";import l from"fs-extra";import{join as k,resolve as C,dirname as W,basename as V}from"path";import b from"os";import{execSync as N}from"child_process";import M from"degit";import j from"os";import{join as D}from"path";var x=[{name:"Antigravity",path:D(j.homedir(),".agent/skills"),description:"Custom AI agent for XC development"},{name:"Trae",path:D(j.homedir(),".trae/skills"),description:"Trae AI IDE"},{name:"Codex",path:D(j.homedir(),".codex/skills"),description:"Codex AI assistant"},{name:"Claude Code",path:D(j.homedir(),".claude/skills"),description:"Anthropic Claude Code CLI"}];import v from"fs-extra";import{join as I,dirname as E,basename as R}from"path";import*as P from"@clack/prompts";import F from"picocolors";import G from"os";async function T(f){let{sourceDir:t,targetAgents:y,selectedSkills:i,scope:s,method:g,strategy:p,customRoot:o}=f,r=P.spinner();for(let m of y){let n="";if(o)n=o;else if(s==="project"){let d=R(E(m.path));n=I(process.cwd(),d,"skills")}else n=m.path.replace(/^~/,G.homedir());r.start(`\u6B63\u5728\u90E8\u7F72\u5230 ${m.name} (${n})...`);try{p==="overwrite"&&await v.pathExists(n)?await v.emptyDir(n):await v.ensureDir(n);for(let d of i){let $=I(t,d),w=I(n,d);await v.pathExists(w)&&await v.remove(w),g==="symlink"?await v.ensureSymlink($,w,"dir"):await v.copy($,w)}r.stop(`\u6210\u529F\u540C\u6B65\u5230: ${m.name} (${s==="custom"?"\u81EA\u5B9A\u4E49\u8DEF\u5F84":s+" \u6A21\u5F0F"})`)}catch(d){r.stop(`${F.red("\u5931\u8D25")}: ${m.name} - ${d.message}`)}}}var S=L("xc-skills");function O(f){try{let t=k(f,"SKILL.md");if(l.existsSync(t)){let i=l.readFileSync(t,"utf-8").match(/description:\s*['"]?([^'"\n\r]+)['"]?/);return i?i[1].trim():""}}catch{}return""}S.command("add <source>","Add skills from a local directory or GitHub URL").option("-s, --skill <skills>","Specific skills to install").option("-a, --agent <agents>","Specific agents to install to").option("-d, --dir <dir>","The directory name containing skills",{default:"skills"}).option("-o, --out <path>","Specify a custom output directory").option("-y, --yes","Skip confirmation prompts").action(async(f,t)=>{e.intro(`${c.bgCyan(c.black(" xc-skills "))}`);let y="",i=!1,s=k(b.tmpdir(),`xc-skills-${Date.now()}`),g=f.startsWith("http")||f.startsWith("git@")||f.includes("/")&&!l.existsSync(C(process.cwd(),f));if(g){let a=e.spinner();a.start(`\u6B63\u5728\u5C1D\u8BD5\u4E0B\u8F7D\u6280\u80FD\u5E93: ${f}`);let h=!1;try{await M(f,{cache:!1,force:!0,verbose:!1}).clone(s),h=!0,a.stop("\u4E0B\u8F7D\u6210\u529F (degit)")}catch{try{a.message("degit \u4E0D\u652F\u6301\u6B64\u5E73\u53F0\uFF0C\u6B63\u5728\u5C1D\u8BD5\u4F7F\u7528 git clone..."),N(`git clone --depth 1 ${f} ${s}`,{stdio:"ignore"}),l.existsSync(k(s,".git"))&&await l.remove(k(s,".git")),h=!0,a.stop("\u4E0B\u8F7D\u6210\u529F (git clone)")}catch(A){a.stop(c.red(`\u4E0B\u8F7D\u5931\u8D25: ${A.message}`)),process.exit(1)}}h&&(y=s,i=!0)}else y=C(process.cwd(),f);let p=k(y,t.dir);l.existsSync(p)||(e.log.error(`\u627E\u4E0D\u5230\u6280\u80FD\u76EE\u5F55: ${p}`),i&&await l.remove(s),process.exit(1));let r=(await l.readdir(p,{withFileTypes:!0})).filter(a=>a.isDirectory()&&!a.name.startsWith(".")).map(a=>{let h=a.name,u=O(k(p,h));return{name:h,description:u}});r.length===0&&(e.log.error(`\u5728 ${p} \u4E2D\u6CA1\u6709\u627E\u5230\u4EFB\u4F55\u6709\u6548\u7684\u6280\u80FD\u5B50\u76EE\u5F55`),i&&await l.remove(s),process.exit(1));let m=[];t.yes||t.skill==="*"?m=r.map(a=>a.name):t.skill?m=t.skill.split(","):m=await e.multiselect({message:"\u7B2C\u4E00\u6B65\uFF1A\u9009\u62E9\u8981\u5B89\u88C5\u7684\u6280\u80FD (Select skills)",options:r.map(a=>({value:a.name,label:a.name,hint:a.description})),initialValues:[r[0].name]}),e.isCancel(m)&&(i&&await l.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let n=[];if(t.out)n=[{name:"Custom Path",path:C(process.cwd(),t.out)}];else if(t.yes||t.agent==="*")n=x;else if(t.agent){let a=t.agent.split(",");n=x.filter(h=>a.includes(h.name))}else n=await e.multiselect({message:"\u7B2C\u4E8C\u6B65\uFF1A\u9009\u62E9\u76EE\u6807\u5F00\u53D1\u5DE5\u5177 (Select agents)",options:x.map(a=>({value:a,label:a.name,hint:a.path.replace(b.homedir(),"~")})),initialValues:[x[0]]});e.isCancel(n)&&(i&&await l.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let d=t.out?"custom":"project";!t.out&&!t.yes&&(d=await e.select({message:"\u7B2C\u4E09\u6B65\uFF1A\u9009\u62E9\u5B89\u88C5\u8303\u56F4 (Installation scope)",options:[{value:"project",label:"Project (\u9879\u76EE\u7EA7)",hint:"./.<agent>/skills"},{value:"global",label:"Global (\u5168\u5C40)",hint:"\u5DE5\u5177\u9ED8\u8BA4\u8DEF\u5F84"}]})),e.isCancel(d)&&(i&&await l.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let $="symlink";i?$="copy":t.yes||($=await e.select({message:"\u7B2C\u56DB\u6B65\uFF1A\u9009\u62E9\u5B89\u88C5\u65B9\u5F0F (Installation method)",options:[{value:"symlink",label:"Symlink (\u8F6F\u94FE\u63A5 - \u63A8\u8350)",hint:"\u4E0E\u6E90\u7801\u4FDD\u6301\u5B9E\u65F6\u540C\u6B65"},{value:"copy",label:"Copy (\u7269\u7406\u62F7\u8D1D)",hint:"\u590D\u5236\u6587\u4EF6\u526F\u672C"}]})),e.isCancel($)&&(i&&await l.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0));let w="merge";if(!t.yes){let a=!1;for(let h of n){let u="";if(t.out)u=C(process.cwd(),t.out);else if(d==="project"){let A=V(W(h.path));u=k(process.cwd(),A,"skills")}else u=h.path.replace(/^~/,b.homedir());if(await l.pathExists(u)){a=!0;break}}a&&(w=await e.select({message:"\u68C0\u6D4B\u5230\u76EE\u6807\u76EE\u5F55\u5DF2\u5B58\u5728\uFF0C\u5982\u4F55\u5904\u7406\uFF1F(Handle conflicts)",options:[{value:"merge",label:"Merge (\u5408\u5E76)",hint:"\u53EA\u66F4\u65B0\u9009\u4E2D\u7684\u6280\u80FD\uFF0C\u4FDD\u7559\u5176\u4ED6\u6280\u80FD"},{value:"overwrite",label:"Overwrite (\u8986\u76D6)",hint:"\u6E05\u7A7A\u76EE\u6807\u76EE\u5F55\u540E\u518D\u5B89\u88C5"}]}))}if(e.isCancel(w)&&(i&&await l.remove(s),e.cancel("\u5DF2\u53D6\u6D88"),process.exit(0)),!t.yes){e.log.message(`${c.cyan("\u5B89\u88C5\u7EFC\u8FF0 (Installation Summary)")}`),[`${c.dim("Source:")} ${g?f:"Local"}`,`${c.dim("Skills:")} ${m.join(", ")}`,t.out?`${c.dim("Target:")} ${n[0].path}`:`${c.dim("Agents:")} ${n.map(u=>u.name).join(", ")}`,`${c.dim("Scope:")} ${d}`,`${c.dim("Method:")} ${$}`,`${c.dim("Strategy:")} ${w}`].forEach(u=>e.log.message(` ${u}`));let h=await e.confirm({message:"\u786E\u8BA4\u5B89\u88C5\uFF1F(Proceed with installation?)",initialValue:!0});(e.isCancel(h)||!h)&&(i&&await l.remove(s),e.cancel("\u5B89\u88C5\u5DF2\u53D6\u6D88"),process.exit(0))}await T({sourceDir:p,targetAgents:n,selectedSkills:m,scope:d,method:$,strategy:w,customRoot:t.out?C(process.cwd(),t.out):void 0}),i&&await l.remove(s),e.outro(c.green("\u5B89\u88C5\u5B8C\u6210\uFF01(Installation complete)"))});S.command("remove","Remove installed skills from the current project or global directory").alias("cleanup").alias("rm").option("-g, --global","Remove global skills instead of project skills").action(async f=>{let t=f.global;e.intro(`${c.bgRed(c.white(t?" xc-skills remove (Global) ":" xc-skills remove (Project) "))}`);let y=process.cwd(),i=[];if(t)for(let o of x){let r=o.path.replace(/^~/,b.homedir());if(l.existsSync(r)){let m=(await l.readdir(r,{withFileTypes:!0})).filter(n=>n.isDirectory()&&!n.name.startsWith(".")).map(n=>n.name);i.push({name:o.name,path:r,skills:m})}}else{let o=[".agent",".trae",".claude",".codex"];for(let r of o){let m=k(y,r,"skills");if(l.existsSync(m)){let n=(await l.readdir(m,{withFileTypes:!0})).filter(d=>d.isDirectory()&&!d.name.startsWith(".")).map(d=>d.name);i.push({name:r,path:k(y,r),skills:n})}}}i.length===0&&(e.log.info(t?"\u6CA1\u6709\u53D1\u73B0\u5DF2\u5B89\u88C5\u7684\u5168\u5C40\u6280\u80FD\u76EE\u5F55\u3002":"\u5728\u5F53\u524D\u9879\u76EE\u4E2D\u6CA1\u6709\u53D1\u73B0\u5DF2\u5B89\u88C5\u7684\u6280\u80FD\u76EE\u5F55\u3002"),process.exit(0));let s=await e.multiselect({message:`\u9009\u62E9\u8981\u6E05\u9664\u7684${t?"\u5168\u5C40":"\u9879\u76EE"}\u76EE\u5F55 (Select to remove)`,options:i.map(o=>({value:o.path,label:o.name,hint:o.skills.length>0?`Skills: ${o.skills.join(", ")}`:"(\u7A7A\u76EE\u5F55)"})),initialValues:i.map(o=>o.path)});(e.isCancel(s)||s.length===0)&&(e.cancel("\u64CD\u4F5C\u5DF2\u53D6\u6D88"),process.exit(0));let g=await e.confirm({message:`\u786E\u8BA4\u5220\u9664\u9009\u4E2D\u7684 ${s.length} \u4E2A\u76EE\u5F55\u53CA\u5176\u6240\u6709\u6280\u80FD\uFF1F(Confirm deletion?)`,initialValue:!1});(e.isCancel(g)||!g)&&(e.cancel("\u64CD\u4F5C\u5DF2\u53D6\u6D88"),process.exit(0));let p=e.spinner();for(let o of s){let r=o.replace(b.homedir(),"~");p.start(`\u6B63\u5728\u5220\u9664 ${r}...`);try{await l.remove(o),p.stop(`\u5DF2\u5220\u9664: ${r}`)}catch(m){p.stop(c.red(`\u5220\u9664 ${r} \u5931\u8D25: ${m.message}`))}}e.outro(c.green("\u6E05\u7406\u5B8C\u6210\uFF01"))});S.command("list","List installed skills").alias("ls").option("-g, --global","List global skills instead of project skills").action(async f=>{let t=f.global;e.intro(`${c.bgBlue(c.white(t?" xc-skills list (Global) ":" xc-skills list (Project) "))}`);let y=process.cwd(),i=[];if(t)for(let s of x){let g=s.path.replace(/^~/,b.homedir());if(l.existsSync(g)){let p=(await l.readdir(g,{withFileTypes:!0})).filter(o=>o.isDirectory()&&!o.name.startsWith(".")).map(o=>o.name);i.push({name:s.name,path:g,skills:p})}}else{let s=[".agent",".trae",".claude",".codex"];for(let g of s){let p=k(y,g,"skills");if(l.existsSync(p)){let o=(await l.readdir(p,{withFileTypes:!0})).filter(r=>r.isDirectory()&&!r.name.startsWith(".")).map(r=>r.name);i.push({name:g,path:p,skills:o})}}}if(i.length===0)e.log.info("\u6CA1\u6709\u53D1\u73B0\u5DF2\u5B89\u88C5\u7684\u6280\u80FD\u3002");else for(let s of i)e.log.message(`${c.cyan(s.name)} ${c.dim(`(${s.path.replace(b.homedir(),"~")})`)}`),s.skills.length===0?e.log.message(` ${c.dim("(\u65E0\u6280\u80FD)")}`):e.log.message(` ${s.skills.join(", ")}`),e.log.message("");e.outro("\u67E5\u8BE2\u5B8C\u6BD5\uFF01")});S.help();S.version("1.1.1");S.parse();
|