vibe-cokit 1.3.0 → 1.4.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.
Files changed (2) hide show
  1. package/dist/cli.js +170 -65
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,5 +1,63 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
+ var __create = Object.create;
4
+ var __getProtoOf = Object.getPrototypeOf;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __toESM = (mod, isNodeMode, target) => {
9
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
10
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
+ for (let key of __getOwnPropNames(mod))
12
+ if (!__hasOwnProp.call(to, key))
13
+ __defProp(to, key, {
14
+ get: () => mod[key],
15
+ enumerable: true
16
+ });
17
+ return to;
18
+ };
19
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
20
+
21
+ // package.json
22
+ var require_package = __commonJS((exports, module) => {
23
+ module.exports = {
24
+ name: "vibe-cokit",
25
+ version: "0.1.0",
26
+ description: "A toolkit for interacting with Claude Code",
27
+ module: "index.ts",
28
+ type: "module",
29
+ bin: {
30
+ "vibe-cokit": "bin/vk.cjs",
31
+ vk: "bin/vk.cjs"
32
+ },
33
+ files: [
34
+ "bin/",
35
+ "dist/",
36
+ "package.json",
37
+ "README.md"
38
+ ],
39
+ scripts: {
40
+ build: "bun build src/cli.ts --outdir dist --target bun",
41
+ typecheck: "bunx tsc --noEmit"
42
+ },
43
+ publishConfig: {
44
+ access: "public"
45
+ },
46
+ repository: {
47
+ type: "git",
48
+ url: "git+https://github.com/vibe-cokit/cli.git"
49
+ },
50
+ devDependencies: {
51
+ "@types/bun": "latest"
52
+ },
53
+ peerDependencies: {
54
+ typescript: "^5"
55
+ },
56
+ dependencies: {
57
+ cac: "^6.7.14"
58
+ }
59
+ };
60
+ });
3
61
 
4
62
  // node_modules/cac/dist/index.mjs
5
63
  import { EventEmitter } from "events";
@@ -602,8 +660,9 @@ class CAC extends EventEmitter {
602
660
  }
603
661
  var cac = (name = "") => new CAC(name);
604
662
  var dist_default = cac;
605
- // package.json
606
- var version = "0.1.0";
663
+
664
+ // src/cli.ts
665
+ var import__package3 = __toESM(require_package(), 1);
607
666
 
608
667
  // src/commands/init.ts
609
668
  import { join as join2 } from "path";
@@ -749,6 +808,16 @@ async function getSkillsVersion() {
749
808
  }
750
809
  return null;
751
810
  }
811
+ async function upgradeCli() {
812
+ const { version: currentVersion } = await Promise.resolve().then(() => __toESM(require_package(), 1));
813
+ const { stdout: latestRaw } = await exec("npm", ["view", "vibe-cokit", "version"]);
814
+ const latestVersion = latestRaw.trim();
815
+ if (currentVersion === latestVersion) {
816
+ return { upgraded: false, from: currentVersion, to: latestVersion };
817
+ }
818
+ await exec("bun", ["install", "-g", `vibe-cokit@${latestVersion}`]);
819
+ return { upgraded: true, from: currentVersion, to: latestVersion };
820
+ }
752
821
 
753
822
  // src/commands/init.ts
754
823
  async function initCommand() {
@@ -770,8 +839,6 @@ vibe-cokit init
770
839
  log("Updating version tracking...");
771
840
  const sha = await getCommitSha(tmpDir);
772
841
  await updateSettings(sha);
773
- log("Cleaning up...");
774
- await cleanup(tmpDir);
775
842
  console.log(`
776
843
  \u2713 vibe-cokit initialized successfully!`);
777
844
  console.log(` Version: ${sha.slice(0, 8)}`);
@@ -779,12 +846,13 @@ vibe-cokit init
779
846
  console.log(` Claude: ./CLAUDE.md
780
847
  `);
781
848
  } catch (err) {
782
- await cleanup(tmpDir);
783
849
  const msg = err instanceof Error ? err.message : String(err);
784
850
  console.error(`
785
851
  \u2717 Init failed: ${msg}
786
852
  `);
787
853
  process.exit(1);
854
+ } finally {
855
+ await cleanup(tmpDir);
788
856
  }
789
857
  }
790
858
 
@@ -794,21 +862,45 @@ import { execFile as execFile2 } from "child_process";
794
862
  import { promisify as promisify2 } from "util";
795
863
  var exec2 = promisify2(execFile2);
796
864
  async function updateCommand(ref) {
797
- const tmpDir = join3(TEMP_DIR, crypto.randomUUID());
798
865
  try {
799
866
  console.log(`
800
867
  vibe-cokit update
801
868
  `);
802
869
  log("Verifying prerequisites...");
803
870
  await verifyPrerequisites();
804
- log("Checking current version...");
871
+ log("Checking CLI version...");
872
+ try {
873
+ const { upgraded, from, to } = await upgradeCli();
874
+ if (upgraded) {
875
+ log(`CLI upgraded: ${from} \u2192 ${to}`);
876
+ } else {
877
+ log(`CLI: v${from} (latest)`);
878
+ }
879
+ } catch {
880
+ log("CLI upgrade skipped (npm registry unavailable)");
881
+ }
882
+ await updateConfig(ref);
883
+ await updateSkills(ref);
884
+ console.log(`
885
+ \u2713 vibe-cokit update complete!
886
+ `);
887
+ } catch (err) {
888
+ const msg = err instanceof Error ? err.message : String(err);
889
+ console.error(`
890
+ \u2717 Update failed: ${msg}
891
+ `);
892
+ process.exit(1);
893
+ }
894
+ }
895
+ async function updateConfig(ref) {
896
+ const tmpDir = join3(TEMP_DIR, crypto.randomUUID());
897
+ try {
898
+ log("Checking config version...");
805
899
  const currentSha = await getCurrentVersion();
806
- log("Fetching latest version info...");
900
+ log("Fetching latest config version...");
807
901
  const targetSha = await getRemoteSha(ref);
808
902
  if (currentSha && currentSha === targetSha) {
809
- console.log(`
810
- \u2713 Already up-to-date (${currentSha.slice(0, 8)})
811
- `);
903
+ log(`Config: up-to-date (${currentSha.slice(0, 8)})`);
812
904
  return;
813
905
  }
814
906
  log("Cloning vibe-cokit configuration...");
@@ -819,25 +911,39 @@ vibe-cokit update
819
911
  }
820
912
  log("Updating config folders in ~/.claude/");
821
913
  await copyConfigFolders(tmpDir);
822
- log("Updating version tracking...");
823
914
  const sha = await getCommitSha(tmpDir);
824
915
  await updateSettings(sha);
825
- log("Cleaning up...");
916
+ const from = currentSha ? currentSha.slice(0, 8) : "none";
917
+ log(`Config updated: ${from} \u2192 ${sha.slice(0, 8)}`);
918
+ } finally {
826
919
  await cleanup(tmpDir);
920
+ }
921
+ }
922
+ async function updateSkills(ref) {
923
+ const tmpDir = join3(TEMP_DIR, crypto.randomUUID());
924
+ try {
925
+ log("Checking skills version...");
926
+ const currentSha = await getSkillsVersion();
927
+ log("Fetching latest skills version...");
928
+ const targetSha = await getRemoteSha(ref, SKILLS_REPO);
929
+ if (currentSha && currentSha === targetSha) {
930
+ log(`Skills: up-to-date (${currentSha.slice(0, 8)})`);
931
+ return;
932
+ }
933
+ log("Cloning skills repository...");
934
+ await cloneRepo(tmpDir, SKILLS_REPO);
935
+ if (ref) {
936
+ log(`Checking out ${ref}...`);
937
+ await exec2("git", ["-C", tmpDir, "checkout", ref]);
938
+ }
939
+ log("Updating skills in ~/.claude/skills/");
940
+ await copySkillFolders(tmpDir);
941
+ const sha = await getCommitSha(tmpDir);
942
+ await updateSkillsVersion(sha);
827
943
  const from = currentSha ? currentSha.slice(0, 8) : "none";
828
- console.log(`
829
- \u2713 vibe-cokit updated successfully!`);
830
- console.log(` From: ${from}`);
831
- console.log(` To: ${sha.slice(0, 8)}`);
832
- console.log(` Config: ~/.claude/
833
- `);
834
- } catch (err) {
944
+ log(`Skills updated: ${from} \u2192 ${sha.slice(0, 8)}`);
945
+ } finally {
835
946
  await cleanup(tmpDir);
836
- const msg = err instanceof Error ? err.message : String(err);
837
- console.error(`
838
- \u2717 Update failed: ${msg}
839
- `);
840
- process.exit(1);
841
947
  }
842
948
  }
843
949
 
@@ -875,8 +981,6 @@ vibe-cokit skills
875
981
  log("Updating skills version...");
876
982
  const sha = await getCommitSha(tmpDir);
877
983
  await updateSkillsVersion(sha);
878
- log("Cleaning up...");
879
- await cleanup(tmpDir);
880
984
  const from = currentSha ? currentSha.slice(0, 8) : "none";
881
985
  console.log(`
882
986
  \u2713 Skills installed successfully!`);
@@ -885,18 +989,20 @@ vibe-cokit skills
885
989
  console.log(` Skills: ~/.claude/skills/
886
990
  `);
887
991
  } catch (err) {
888
- await cleanup(tmpDir);
889
992
  const msg = err instanceof Error ? err.message : String(err);
890
993
  console.error(`
891
994
  \u2717 Skills setup failed: ${msg}
892
995
  `);
893
996
  process.exit(1);
997
+ } finally {
998
+ await cleanup(tmpDir);
894
999
  }
895
1000
  }
896
1001
 
897
1002
  // src/commands/help.ts
1003
+ var import__package = __toESM(require_package(), 1);
898
1004
  var HELP_TEXT = `
899
- vibe-cokit v${version} \u2014 A toolkit for interacting with Claude Code
1005
+ vibe-cokit v${import__package.version} \u2014 A toolkit for interacting with Claude Code
900
1006
 
901
1007
  USAGE
902
1008
  vk <command> [options]
@@ -906,8 +1012,9 @@ COMMANDS
906
1012
  Clones config repo, copies agents/commands/hooks/prompts/workflows
907
1013
  to ~/.claude/, adds CLAUDE.md to current directory, runs claude init
908
1014
 
909
- update [ref] Update vibe-cokit config to latest or specific version
910
- Compares local version with remote, skips if already up-to-date
1015
+ update [ref] Update everything: CLI + config + skills
1016
+ Upgrades CLI package via npm, updates config and skills
1017
+ Compares versions with remote, skips if already up-to-date
911
1018
  Aliases: upgrade
912
1019
 
913
1020
  skills [ref] Install or update skills from vibe-cokit skills repo
@@ -923,7 +1030,7 @@ COMMANDS
923
1030
 
924
1031
  EXAMPLES
925
1032
  vk init # Initialize vibe-cokit in current project
926
- vk update # Update config to latest version
1033
+ vk update # Update CLI + config + skills
927
1034
  vk update v1.2.0 # Update to specific tag
928
1035
  vk skills # Install/update all skills
929
1036
  vk skills main # Install skills from specific branch
@@ -949,11 +1056,12 @@ function helpCommand() {
949
1056
  }
950
1057
 
951
1058
  // src/commands/version.ts
1059
+ var import__package2 = __toESM(require_package(), 1);
952
1060
  async function versionCommand() {
953
1061
  const commitSha = await getCurrentVersion();
954
1062
  const skillsSha = await getSkillsVersion();
955
1063
  console.log(`
956
- vibe-cokit v${version}`);
1064
+ vibe-cokit v${import__package2.version}`);
957
1065
  if (commitSha) {
958
1066
  console.log(` Config commit: ${commitSha.slice(0, 10)}`);
959
1067
  } else {
@@ -1060,24 +1168,39 @@ vibe-cokit doctor fix
1060
1168
  }
1061
1169
  let fixed = 0;
1062
1170
  const configMissing = !await dirExists(CLAUDE_DIR) || (await Promise.all(CONFIG_FOLDERS.map((f) => dirExists(join6(CLAUDE_DIR, f))))).some((exists) => !exists) || !await getCurrentVersion();
1063
- if (configMissing) {
1064
- log("Config missing \u2014 installing...");
1171
+ const claudeMdPath = join6(process.cwd(), "CLAUDE.md");
1172
+ const claudeMdMissing = !await fileExists(claudeMdPath);
1173
+ if (configMissing || claudeMdMissing) {
1065
1174
  const tmpDir = join6(TEMP_DIR, crypto.randomUUID());
1066
1175
  try {
1067
1176
  await cloneRepo(tmpDir);
1068
- await copyConfigFolders(tmpDir);
1069
- const sha = await getCommitSha(tmpDir);
1070
- await updateSettings(sha);
1071
- await cleanup(tmpDir);
1072
- log(`Config installed (${sha.slice(0, 8)})`);
1073
- fixed++;
1177
+ if (configMissing) {
1178
+ log("Config missing \u2014 installing...");
1179
+ await copyConfigFolders(tmpDir);
1180
+ const sha = await getCommitSha(tmpDir);
1181
+ await updateSettings(sha);
1182
+ log(`Config installed (${sha.slice(0, 8)})`);
1183
+ fixed++;
1184
+ } else {
1185
+ log("Config: OK");
1186
+ }
1187
+ if (claudeMdMissing) {
1188
+ log("CLAUDE.md missing \u2014 copying...");
1189
+ await copyClaudeMd(tmpDir);
1190
+ log("CLAUDE.md copied to project");
1191
+ fixed++;
1192
+ } else {
1193
+ log("CLAUDE.md: OK");
1194
+ }
1074
1195
  } catch (err) {
1075
- await cleanup(tmpDir);
1076
1196
  const msg = err instanceof Error ? err.message : String(err);
1077
- console.error(` \u2717 Config fix failed: ${msg}`);
1197
+ console.error(` \u2717 Config/CLAUDE.md fix failed: ${msg}`);
1198
+ } finally {
1199
+ await cleanup(tmpDir);
1078
1200
  }
1079
1201
  } else {
1080
1202
  log("Config: OK");
1203
+ log("CLAUDE.md: OK");
1081
1204
  }
1082
1205
  const skillsMissing = !await dirExists(SKILLS_DIR) || !await getSkillsVersion();
1083
1206
  if (skillsMissing) {
@@ -1088,34 +1211,16 @@ vibe-cokit doctor fix
1088
1211
  await copySkillFolders(tmpDir);
1089
1212
  const sha = await getCommitSha(tmpDir);
1090
1213
  await updateSkillsVersion(sha);
1091
- await cleanup(tmpDir);
1092
1214
  log(`Skills installed (${sha.slice(0, 8)})`);
1093
1215
  fixed++;
1094
1216
  } catch (err) {
1095
- await cleanup(tmpDir);
1096
1217
  const msg = err instanceof Error ? err.message : String(err);
1097
1218
  console.error(` \u2717 Skills fix failed: ${msg}`);
1098
- }
1099
- } else {
1100
- log("Skills: OK");
1101
- }
1102
- const claudeMdPath = join6(process.cwd(), "CLAUDE.md");
1103
- if (!await fileExists(claudeMdPath)) {
1104
- log("CLAUDE.md missing \u2014 copying...");
1105
- const tmpDir = join6(TEMP_DIR, crypto.randomUUID());
1106
- try {
1107
- await cloneRepo(tmpDir);
1108
- await copyClaudeMd(tmpDir);
1219
+ } finally {
1109
1220
  await cleanup(tmpDir);
1110
- log("CLAUDE.md copied to project");
1111
- fixed++;
1112
- } catch (err) {
1113
- await cleanup(tmpDir);
1114
- const msg = err instanceof Error ? err.message : String(err);
1115
- console.error(` \u2717 CLAUDE.md fix failed: ${msg}`);
1116
1221
  }
1117
1222
  } else {
1118
- log("CLAUDE.md: OK");
1223
+ log("Skills: OK");
1119
1224
  }
1120
1225
  console.log();
1121
1226
  if (fixed > 0) {
@@ -1133,7 +1238,7 @@ cli.command("", "A toolkit for interacting with Claude Code").action(() => {
1133
1238
  cli.outputHelp();
1134
1239
  });
1135
1240
  cli.command("init", "Initialize vibe-cokit for current project").action(initCommand);
1136
- cli.command("update [ref]", "Update vibe-cokit to latest or specific version").alias("upgrade").action(updateCommand);
1241
+ cli.command("update [ref]", "Update CLI, config, and skills to latest").alias("upgrade").action(updateCommand);
1137
1242
  cli.command("skills [ref]", "Install or update skills from vibe-cokit").action(skillsCommand);
1138
1243
  cli.command("help", "Show detailed usage guide").action(helpCommand);
1139
1244
  cli.command("version", "Show version and installed commit IDs").action(versionCommand);
@@ -1143,5 +1248,5 @@ cli.command("doctor", "Check vibe-cokit setup health").option("--fix", "Auto-fix
1143
1248
  return doctorCommand();
1144
1249
  });
1145
1250
  cli.help();
1146
- cli.version(version);
1251
+ cli.version(import__package3.version);
1147
1252
  cli.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-cokit",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "A toolkit for interacting with Claude Code",
5
5
  "module": "index.ts",
6
6
  "type": "module",