jkpark 2.1.0 → 2.3.0

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.
Files changed (2) hide show
  1. package/dist/index.js +91 -23
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -25708,10 +25708,14 @@ class PathManager {
25708
25708
  static getWorkspaces(root) {
25709
25709
  if (!fs.existsSync(root))
25710
25710
  return [];
25711
- return fs.readdirSync(root).filter((f) => {
25712
- const fullPath = path2.join(root, f);
25713
- return (f.startsWith("workspace-") || f.startsWith("project-")) && fs.statSync(fullPath).isDirectory();
25714
- });
25711
+ try {
25712
+ return fs.readdirSync(root).filter((f) => {
25713
+ const fullPath = path2.join(root, f);
25714
+ return !f.startsWith(".") && fs.statSync(fullPath).isDirectory();
25715
+ });
25716
+ } catch (e) {
25717
+ return [];
25718
+ }
25715
25719
  }
25716
25720
  static resolveFinalPath(baseDir, relativeOrAbsolute) {
25717
25721
  return path2.isAbsolute(relativeOrAbsolute) ? relativeOrAbsolute : path2.resolve(baseDir, relativeOrAbsolute);
@@ -25747,7 +25751,22 @@ class PluginManager {
25747
25751
  if (!fs2.existsSync(skillsDir))
25748
25752
  return [];
25749
25753
  const skills = fs2.readdirSync(skillsDir).filter((f) => fs2.statSync(path3.join(skillsDir, f)).isDirectory());
25750
- return skills.map((skill) => ({ name: skill, value: skill }));
25754
+ return skills.map((skill) => {
25755
+ const skillPath = path3.join(skillsDir, skill, "SKILL.md");
25756
+ let description = "No description provided";
25757
+ if (fs2.existsSync(skillPath)) {
25758
+ const content = fs2.readFileSync(skillPath, "utf8");
25759
+ const match = content.match(/^description:\s*(.*)$/m);
25760
+ if (match && match[1]) {
25761
+ description = match[1].trim();
25762
+ }
25763
+ }
25764
+ return {
25765
+ name: skill,
25766
+ description,
25767
+ value: skill
25768
+ };
25769
+ });
25751
25770
  }
25752
25771
  getSkillSourcePath(category, skill) {
25753
25772
  return path3.join(this.pluginsDir, category, "skills", skill);
@@ -25757,7 +25776,7 @@ class PluginManager {
25757
25776
  // src/commands/install.ts
25758
25777
  async function runInstallWizard(projectRoot) {
25759
25778
  console.log(`
25760
- \uD83D\uDC3E jkpark 설치 마법사에 오신 걸 환영합니다! (Bun Powered)
25779
+ \uD83D\uDC3E jkpark 설치 마법사에 오신 걸 환영합니다!
25761
25780
  `);
25762
25781
  const pluginManager = new PluginManager(projectRoot);
25763
25782
  const categoryChoices = await pluginManager.getCategories();
@@ -25769,11 +25788,11 @@ async function runInstallWizard(projectRoot) {
25769
25788
  {
25770
25789
  type: "list",
25771
25790
  name: "targetType",
25772
- message: "설치 타겟 유형을 선택하세요:",
25791
+ message: "설치할 서비스(Target)를 선택하세요:",
25773
25792
  choices: [
25774
- { name: "OpenClaw", value: "openclaw" },
25775
- { name: "Claude", value: "claude" },
25776
- { name: "GitHub", value: "github" }
25793
+ { name: "\uD83C\uDFD7️ OpenClaw".padEnd(15) + " - OpenClaw Agents & Shared Skills", value: "openclaw" },
25794
+ { name: "\uD83E\uDD16 Claude".padEnd(15) + " - Claude Code CLI & Global Skills", value: "claude" },
25795
+ { name: "\uD83D\uDC19 GitHub".padEnd(15) + " - GitHub CLI Extensions (gh-extension)", value: "github" }
25777
25796
  ]
25778
25797
  }
25779
25798
  ]);
@@ -25782,11 +25801,14 @@ async function runInstallWizard(projectRoot) {
25782
25801
  type: "list",
25783
25802
  name: "selectedCategory",
25784
25803
  message: "설치할 플러그인 카테고리를 선택하세요:",
25785
- choices: categoryChoices
25804
+ choices: categoryChoices.map((c) => ({
25805
+ name: `${c.name.padEnd(15)} - ${c.description}`,
25806
+ value: c.value
25807
+ }))
25786
25808
  }
25787
25809
  ]);
25788
- const skillChoices = await pluginManager.getSkills(selectedCategory);
25789
- if (skillChoices.length === 0) {
25810
+ const skills = await pluginManager.getSkills(selectedCategory);
25811
+ if (skills.length === 0) {
25790
25812
  console.log(`
25791
25813
  ⚠️ ${selectedCategory} 카테고리에 설치 가능한 스킬이 없습니다.`);
25792
25814
  return;
@@ -25795,12 +25817,14 @@ async function runInstallWizard(projectRoot) {
25795
25817
  {
25796
25818
  type: "checkbox",
25797
25819
  name: "selectedSkills",
25798
- message: "설치할 스킬들을 선택하세요:",
25799
- choices: skillChoices,
25820
+ message: "설치할 스킬들을 선택하세요 (Space로 선택, Enter로 완료):",
25821
+ choices: skills.map((s) => ({
25822
+ name: `${s.name.padEnd(25)} - ${s.description}`,
25823
+ value: s.value
25824
+ })),
25800
25825
  validate: (answer) => answer.length > 0 ? true : "최소 하나 이상의 스킬을 선택해야 합니다."
25801
25826
  }
25802
25827
  ]);
25803
- let finalTargetDir;
25804
25828
  let rootPath;
25805
25829
  if (targetType === "openclaw") {
25806
25830
  rootPath = PathManager.getOpenClawRoot();
@@ -25810,7 +25834,9 @@ async function runInstallWizard(projectRoot) {
25810
25834
  rootPath = PathManager.getGitHubRoot();
25811
25835
  }
25812
25836
  const workspaces = PathManager.getWorkspaces(rootPath);
25813
- const scopeChoices = [];
25837
+ const scopeChoices = [
25838
+ { name: "Current Directory (현재 프로젝트)", value: process.cwd() }
25839
+ ];
25814
25840
  if (targetType === "openclaw") {
25815
25841
  scopeChoices.push({ name: `Shared Skills (모든 에이전트 공유: ${path4.join(rootPath, "skills")})`, value: path4.join(rootPath, "skills") });
25816
25842
  } else if (targetType === "claude") {
@@ -25819,16 +25845,17 @@ async function runInstallWizard(projectRoot) {
25819
25845
  scopeChoices.push({ name: `GitHub Extensions (~/.config/gh/extensions)`, value: path4.join(rootPath, "extensions") });
25820
25846
  }
25821
25847
  scopeChoices.push(...workspaces.map((ws) => ({ name: `Workspace: ${ws}`, value: path4.join(rootPath, ws) })));
25822
- scopeChoices.push({ name: "Current Directory (현재 프로젝트)", value: process.cwd() });
25823
25848
  scopeChoices.push({ name: "Custom Path (직접 입력)", value: "custom" });
25824
25849
  const { scope } = await dist_default14.prompt([
25825
25850
  {
25826
25851
  type: "list",
25827
25852
  name: "scope",
25828
- message: `${targetType} 설치 범위를 선택하세요:`,
25829
- choices: scopeChoices
25853
+ message: `${targetType} 설치 범위를 선택하세요 (Default: Current Directory):`,
25854
+ choices: scopeChoices,
25855
+ default: 0
25830
25856
  }
25831
25857
  ]);
25858
+ let finalTargetDir;
25832
25859
  if (scope === "custom") {
25833
25860
  const { customPath } = await dist_default14.prompt([
25834
25861
  {
@@ -25880,15 +25907,56 @@ async function runInstallWizard(projectRoot) {
25880
25907
  ❌ 설치가 취소되었습니다.`);
25881
25908
  }
25882
25909
  }
25910
+ async function runListCommand(projectRoot) {
25911
+ const pluginManager = new PluginManager(projectRoot);
25912
+ const categories = await pluginManager.getCategories();
25913
+ console.log(`
25914
+ \uD83D\uDCE6 사용 가능한 플러그인 목록:
25915
+ `);
25916
+ for (const cat of categories) {
25917
+ console.log(`\uD83D\uDCC2 ${cat.name} (${cat.description})`);
25918
+ const skills = await pluginManager.getSkills(cat.value);
25919
+ for (const skill of skills) {
25920
+ console.log(` - ${skill.name}: ${skill.description}`);
25921
+ }
25922
+ console.log("");
25923
+ }
25924
+ }
25883
25925
 
25884
25926
  // src/index.ts
25885
25927
  var __filename2 = fileURLToPath(import.meta.url);
25886
25928
  var __dirname2 = path5.dirname(__filename2);
25887
25929
  var projectRoot = process.env.JKPARK_CLI_ROOT || path5.join(__dirname2, "..");
25888
25930
  var program2 = new Command;
25889
- program2.name("jkpark").description("JK Park의 개인용 패키지 관리 도구 (Bun Edition)").version("2.0.0");
25931
+ program2.name("jkpark").description("JK Park의 개인용 패키지 관리 도구").version("2.3.0");
25890
25932
  program2.command("install").description("패키지 설치 마법사를 실행합니다").action(() => runInstallWizard(projectRoot));
25891
- program2.parse(process.argv);
25933
+ program2.command("list").description("사용 가능한 모든 플러그인과 스킬을 나열합니다").action(() => runListCommand(projectRoot));
25934
+ async function runMainMenu() {
25935
+ console.log(`
25936
+ \uD83C\uDFD7️ jkpark CLI - Main Menu
25937
+ `);
25938
+ const { action } = await dist_default14.prompt([
25939
+ {
25940
+ type: "list",
25941
+ name: "action",
25942
+ message: "수행할 작업을 선택하세요:",
25943
+ choices: [
25944
+ { name: "\uD83D\uDE80 Install Skills (설치 마법사)", value: "install" },
25945
+ { name: "\uD83D\uDCE6 List Available (목록 보기)", value: "list" },
25946
+ { name: "❌ Exit (종료)", value: "exit" }
25947
+ ]
25948
+ }
25949
+ ]);
25950
+ if (action === "install") {
25951
+ await runInstallWizard(projectRoot);
25952
+ } else if (action === "list") {
25953
+ await runListCommand(projectRoot);
25954
+ } else {
25955
+ process.exit(0);
25956
+ }
25957
+ }
25892
25958
  if (!process.argv.slice(2).length) {
25893
- program2.outputHelp();
25959
+ runMainMenu().catch(console.error);
25960
+ } else {
25961
+ program2.parse(process.argv);
25894
25962
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "jkpark",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "JK Park's Personal Package Manager (Bun Powered)",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "bun build ./src/index.ts --outdir ./dist --target node --bundle",
8
8
  "dev": "bun run ./src/index.ts",
9
- "test": "echo \"Error: no test specified\" && exit 1"
9
+ "test": "echo \"Error: no test specified\" | exit 1"
10
10
  },
11
11
  "keywords": [],
12
12
  "author": "Jeff",
@@ -17,17 +17,17 @@
17
17
  "inquirer": "^13.3.0"
18
18
  },
19
19
  "bin": {
20
- "jkpark": "dist/index.js"
20
+ "jkpark": "./dist/index.js"
21
21
  },
22
- "files": [
23
- "dist",
24
- "plugins"
25
- ],
26
22
  "devDependencies": {
27
23
  "@types/commander": "^2.12.5",
28
24
  "@types/fs-extra": "^11.0.4",
29
25
  "@types/inquirer": "^9.0.9",
30
26
  "@types/node": "^25.3.0",
31
27
  "typescript": "^5.9.3"
32
- }
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "plugins"
32
+ ]
33
33
  }