vibe-cokit 1.2.0 → 1.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.
- package/dist/cli.js +240 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -894,6 +894,239 @@ vibe-cokit skills
|
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
+
// src/commands/help.ts
|
|
898
|
+
var HELP_TEXT = `
|
|
899
|
+
vibe-cokit v${version} \u2014 A toolkit for interacting with Claude Code
|
|
900
|
+
|
|
901
|
+
USAGE
|
|
902
|
+
vk <command> [options]
|
|
903
|
+
|
|
904
|
+
COMMANDS
|
|
905
|
+
init Set up vibe-cokit for the current project
|
|
906
|
+
Clones config repo, copies agents/commands/hooks/prompts/workflows
|
|
907
|
+
to ~/.claude/, adds CLAUDE.md to current directory, runs claude init
|
|
908
|
+
|
|
909
|
+
update [ref] Update vibe-cokit config to latest or specific version
|
|
910
|
+
Compares local version with remote, skips if already up-to-date
|
|
911
|
+
Aliases: upgrade
|
|
912
|
+
|
|
913
|
+
skills [ref] Install or update skills from vibe-cokit skills repo
|
|
914
|
+
Copies skill folders to ~/.claude/skills/
|
|
915
|
+
Tracks version separately via skillsVersion in settings.json
|
|
916
|
+
|
|
917
|
+
help Show this detailed usage guide
|
|
918
|
+
|
|
919
|
+
version Show version and installed commit IDs
|
|
920
|
+
|
|
921
|
+
doctor Check vibe-cokit setup health
|
|
922
|
+
doctor --fix Auto-fix missing config, skills, or CLAUDE.md
|
|
923
|
+
|
|
924
|
+
EXAMPLES
|
|
925
|
+
vk init # Initialize vibe-cokit in current project
|
|
926
|
+
vk update # Update config to latest version
|
|
927
|
+
vk update v1.2.0 # Update to specific tag
|
|
928
|
+
vk skills # Install/update all skills
|
|
929
|
+
vk skills main # Install skills from specific branch
|
|
930
|
+
vk version # Show version and commit IDs
|
|
931
|
+
vk doctor # Health check setup
|
|
932
|
+
vk doctor --fix # Auto-fix setup issues
|
|
933
|
+
|
|
934
|
+
OPTIONS
|
|
935
|
+
-h, --help Show brief help
|
|
936
|
+
-v, --version Show version number
|
|
937
|
+
|
|
938
|
+
PREREQUISITES
|
|
939
|
+
gh GitHub CLI (https://cli.github.com)
|
|
940
|
+
git Git version control
|
|
941
|
+
|
|
942
|
+
FILES
|
|
943
|
+
~/.claude/ Config directory (agents, commands, hooks, prompts, workflows)
|
|
944
|
+
~/.claude/skills/ Skills directory
|
|
945
|
+
./CLAUDE.md Project-level Claude config (created by init)
|
|
946
|
+
`;
|
|
947
|
+
function helpCommand() {
|
|
948
|
+
console.log(HELP_TEXT);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// src/commands/version.ts
|
|
952
|
+
async function versionCommand() {
|
|
953
|
+
const commitSha = await getCurrentVersion();
|
|
954
|
+
const skillsSha = await getSkillsVersion();
|
|
955
|
+
console.log(`
|
|
956
|
+
vibe-cokit v${version}`);
|
|
957
|
+
if (commitSha) {
|
|
958
|
+
console.log(` Config commit: ${commitSha.slice(0, 10)}`);
|
|
959
|
+
} else {
|
|
960
|
+
console.log(` Config commit: not installed`);
|
|
961
|
+
}
|
|
962
|
+
if (skillsSha) {
|
|
963
|
+
console.log(` Skills commit: ${skillsSha.slice(0, 10)}`);
|
|
964
|
+
} else {
|
|
965
|
+
console.log(` Skills commit: not installed`);
|
|
966
|
+
}
|
|
967
|
+
console.log();
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// src/commands/doctor.ts
|
|
971
|
+
import { execFile as execFile4 } from "child_process";
|
|
972
|
+
import { promisify as promisify4 } from "util";
|
|
973
|
+
import { join as join5 } from "path";
|
|
974
|
+
var exec4 = promisify4(execFile4);
|
|
975
|
+
async function checkBin(name) {
|
|
976
|
+
try {
|
|
977
|
+
const { stdout } = await exec4(name, ["--version"]);
|
|
978
|
+
return stdout.trim().split(`
|
|
979
|
+
`)[0] ?? null;
|
|
980
|
+
} catch {
|
|
981
|
+
return null;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
async function doctorCommand() {
|
|
985
|
+
console.log(`
|
|
986
|
+
vibe-cokit doctor
|
|
987
|
+
`);
|
|
988
|
+
let issues = 0;
|
|
989
|
+
const tools = ["gh", "git", "claude"];
|
|
990
|
+
for (const tool of tools) {
|
|
991
|
+
const ver = await checkBin(tool);
|
|
992
|
+
if (ver) {
|
|
993
|
+
console.log(` \u2713 ${tool}: ${ver}`);
|
|
994
|
+
} else {
|
|
995
|
+
console.log(` \u2717 ${tool}: not found`);
|
|
996
|
+
issues++;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
console.log();
|
|
1000
|
+
if (await dirExists(CLAUDE_DIR)) {
|
|
1001
|
+
console.log(` \u2713 ~/.claude/ exists`);
|
|
1002
|
+
} else {
|
|
1003
|
+
console.log(` \u2717 ~/.claude/ not found \u2014 run \`vk init\``);
|
|
1004
|
+
issues++;
|
|
1005
|
+
}
|
|
1006
|
+
for (const folder of CONFIG_FOLDERS) {
|
|
1007
|
+
const path = join5(CLAUDE_DIR, folder);
|
|
1008
|
+
if (await dirExists(path)) {
|
|
1009
|
+
console.log(` \u2713 ~/.claude/${folder}/`);
|
|
1010
|
+
} else {
|
|
1011
|
+
console.log(` \u2717 ~/.claude/${folder}/ missing`);
|
|
1012
|
+
issues++;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
if (await dirExists(SKILLS_DIR)) {
|
|
1016
|
+
console.log(` \u2713 ~/.claude/skills/`);
|
|
1017
|
+
} else {
|
|
1018
|
+
console.log(` \u2717 ~/.claude/skills/ missing \u2014 run \`vk skills\``);
|
|
1019
|
+
issues++;
|
|
1020
|
+
}
|
|
1021
|
+
const settingsPath = join5(CLAUDE_DIR, "settings.json");
|
|
1022
|
+
if (await fileExists(settingsPath)) {
|
|
1023
|
+
console.log(` \u2713 ~/.claude/settings.json`);
|
|
1024
|
+
} else {
|
|
1025
|
+
console.log(` \u2717 ~/.claude/settings.json missing`);
|
|
1026
|
+
issues++;
|
|
1027
|
+
}
|
|
1028
|
+
console.log();
|
|
1029
|
+
const configVersion = await getCurrentVersion();
|
|
1030
|
+
const skillsVersion = await getSkillsVersion();
|
|
1031
|
+
console.log(` Config version: ${configVersion ? configVersion.slice(0, 10) : "not installed"}`);
|
|
1032
|
+
console.log(` Skills version: ${skillsVersion ? skillsVersion.slice(0, 10) : "not installed"}`);
|
|
1033
|
+
const claudeMdExists = await fileExists(join5(process.cwd(), "CLAUDE.md"));
|
|
1034
|
+
console.log(` Project CLAUDE.md: ${claudeMdExists ? "found" : "not found"}`);
|
|
1035
|
+
console.log();
|
|
1036
|
+
if (issues === 0) {
|
|
1037
|
+
console.log(` \u2713 All checks passed!
|
|
1038
|
+
`);
|
|
1039
|
+
} else {
|
|
1040
|
+
console.log(` \u26A0 ${issues} issue${issues > 1 ? "s" : ""} found
|
|
1041
|
+
`);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
// src/commands/doctor-fix.ts
|
|
1046
|
+
import { join as join6 } from "path";
|
|
1047
|
+
async function doctorFixCommand() {
|
|
1048
|
+
console.log(`
|
|
1049
|
+
vibe-cokit doctor fix
|
|
1050
|
+
`);
|
|
1051
|
+
try {
|
|
1052
|
+
log("Verifying prerequisites...");
|
|
1053
|
+
await verifyPrerequisites();
|
|
1054
|
+
} catch (err) {
|
|
1055
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1056
|
+
console.error(`
|
|
1057
|
+
\u2717 Cannot fix: ${msg}
|
|
1058
|
+
`);
|
|
1059
|
+
process.exit(1);
|
|
1060
|
+
}
|
|
1061
|
+
let fixed = 0;
|
|
1062
|
+
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...");
|
|
1065
|
+
const tmpDir = join6(TEMP_DIR, crypto.randomUUID());
|
|
1066
|
+
try {
|
|
1067
|
+
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++;
|
|
1074
|
+
} catch (err) {
|
|
1075
|
+
await cleanup(tmpDir);
|
|
1076
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1077
|
+
console.error(` \u2717 Config fix failed: ${msg}`);
|
|
1078
|
+
}
|
|
1079
|
+
} else {
|
|
1080
|
+
log("Config: OK");
|
|
1081
|
+
}
|
|
1082
|
+
const skillsMissing = !await dirExists(SKILLS_DIR) || !await getSkillsVersion();
|
|
1083
|
+
if (skillsMissing) {
|
|
1084
|
+
log("Skills missing \u2014 installing...");
|
|
1085
|
+
const tmpDir = join6(TEMP_DIR, crypto.randomUUID());
|
|
1086
|
+
try {
|
|
1087
|
+
await cloneRepo(tmpDir, SKILLS_REPO);
|
|
1088
|
+
await copySkillFolders(tmpDir);
|
|
1089
|
+
const sha = await getCommitSha(tmpDir);
|
|
1090
|
+
await updateSkillsVersion(sha);
|
|
1091
|
+
await cleanup(tmpDir);
|
|
1092
|
+
log(`Skills installed (${sha.slice(0, 8)})`);
|
|
1093
|
+
fixed++;
|
|
1094
|
+
} catch (err) {
|
|
1095
|
+
await cleanup(tmpDir);
|
|
1096
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1097
|
+
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);
|
|
1109
|
+
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
|
+
}
|
|
1117
|
+
} else {
|
|
1118
|
+
log("CLAUDE.md: OK");
|
|
1119
|
+
}
|
|
1120
|
+
console.log();
|
|
1121
|
+
if (fixed > 0) {
|
|
1122
|
+
console.log(` \u2713 Fixed ${fixed} issue${fixed > 1 ? "s" : ""}!
|
|
1123
|
+
`);
|
|
1124
|
+
} else {
|
|
1125
|
+
console.log(` \u2713 Nothing to fix \u2014 all good!
|
|
1126
|
+
`);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
|
|
897
1130
|
// src/cli.ts
|
|
898
1131
|
var cli = dist_default("vibe-cokit");
|
|
899
1132
|
cli.command("", "A toolkit for interacting with Claude Code").action(() => {
|
|
@@ -902,6 +1135,13 @@ cli.command("", "A toolkit for interacting with Claude Code").action(() => {
|
|
|
902
1135
|
cli.command("init", "Initialize vibe-cokit for current project").action(initCommand);
|
|
903
1136
|
cli.command("update [ref]", "Update vibe-cokit to latest or specific version").alias("upgrade").action(updateCommand);
|
|
904
1137
|
cli.command("skills [ref]", "Install or update skills from vibe-cokit").action(skillsCommand);
|
|
1138
|
+
cli.command("help", "Show detailed usage guide").action(helpCommand);
|
|
1139
|
+
cli.command("version", "Show version and installed commit IDs").action(versionCommand);
|
|
1140
|
+
cli.command("doctor", "Check vibe-cokit setup health").option("--fix", "Auto-fix missing config, skills, or CLAUDE.md").action((options) => {
|
|
1141
|
+
if (options.fix)
|
|
1142
|
+
return doctorFixCommand();
|
|
1143
|
+
return doctorCommand();
|
|
1144
|
+
});
|
|
905
1145
|
cli.help();
|
|
906
1146
|
cli.version(version);
|
|
907
1147
|
cli.parse();
|