create-claude-code-visualizer 0.1.0 → 0.1.2
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/index.js +23 -60
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -43,10 +43,11 @@ function copyIfNotExists(src, dest) {
|
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
function copyDirAdditive(src, dest) {
|
|
46
|
+
function copyDirAdditive(src, dest, skipPrefix) {
|
|
47
47
|
fs.mkdirSync(dest, { recursive: true });
|
|
48
48
|
let added = 0;
|
|
49
49
|
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
50
|
+
if (skipPrefix && entry.name.startsWith(skipPrefix)) continue;
|
|
50
51
|
const srcPath = path.join(src, entry.name);
|
|
51
52
|
const destPath = path.join(dest, entry.name);
|
|
52
53
|
if (entry.isDirectory()) {
|
|
@@ -99,19 +100,8 @@ async function main() {
|
|
|
99
100
|
console.log(`${BLUE}╚══════════════════════════════════════════════════╝${NC}`);
|
|
100
101
|
console.log("");
|
|
101
102
|
|
|
102
|
-
// Determine project directory from CLI arg
|
|
103
|
-
let projectDir = process.argv[2];
|
|
104
|
-
|
|
105
|
-
if (!projectDir) {
|
|
106
|
-
const res = await prompts({
|
|
107
|
-
type: "text",
|
|
108
|
-
name: "dir",
|
|
109
|
-
message: "Project directory",
|
|
110
|
-
initial: "my-claude-visualizer",
|
|
111
|
-
});
|
|
112
|
-
if (!res.dir) process.exit(0);
|
|
113
|
-
projectDir = res.dir;
|
|
114
|
-
}
|
|
103
|
+
// Determine project directory from CLI arg, default to current directory
|
|
104
|
+
let projectDir = process.argv[2] || ".";
|
|
115
105
|
|
|
116
106
|
const projectRoot = path.resolve(projectDir);
|
|
117
107
|
const isExisting = fs.existsSync(projectRoot) && fs.existsSync(path.join(projectRoot, ".claude"));
|
|
@@ -187,10 +177,11 @@ async function main() {
|
|
|
187
177
|
);
|
|
188
178
|
log(`Commands: added ${addedCommands} new`);
|
|
189
179
|
|
|
190
|
-
// Skills
|
|
180
|
+
// Skills (skip gws-* skills — those are installed with Google Workspace setup)
|
|
191
181
|
const addedSkills = copyDirAdditive(
|
|
192
182
|
path.join(srcClaude, "skills"),
|
|
193
|
-
path.join(dstClaude, "skills")
|
|
183
|
+
path.join(dstClaude, "skills"),
|
|
184
|
+
"gws-"
|
|
194
185
|
);
|
|
195
186
|
log(`Skills: added ${addedSkills} new`);
|
|
196
187
|
|
|
@@ -300,47 +291,21 @@ PROJECT_ROOT=${projectRoot}
|
|
|
300
291
|
|
|
301
292
|
if (setupGws) {
|
|
302
293
|
console.log("");
|
|
303
|
-
info("Installing Google Workspace CLI...");
|
|
304
|
-
run("npm install @anthropic-ai/claude-code-google-workspace", { cwd: projectRoot });
|
|
305
|
-
|
|
306
|
-
// Check if gws auth is needed
|
|
307
|
-
const hasAuth = runCapture("npx gws auth status");
|
|
308
|
-
if (!hasAuth) {
|
|
309
|
-
console.log("");
|
|
310
|
-
const { gwsAuth } = await prompts({
|
|
311
|
-
type: "select",
|
|
312
|
-
name: "gwsAuth",
|
|
313
|
-
message: "Google Workspace authentication",
|
|
314
|
-
choices: [
|
|
315
|
-
{ title: "Full setup (creates GCP project + OAuth)", value: "setup" },
|
|
316
|
-
{ title: "Login only (you already have OAuth configured)", value: "login" },
|
|
317
|
-
{ title: "Skip for now", value: "skip" },
|
|
318
|
-
],
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
if (gwsAuth === "setup") {
|
|
322
|
-
run("npx gws auth setup --login", { cwd: projectRoot });
|
|
323
|
-
} else if (gwsAuth === "login") {
|
|
324
|
-
run("npx gws auth login", { cwd: projectRoot });
|
|
325
|
-
} else {
|
|
326
|
-
info("Skipping auth. Run later: npx gws auth setup --login");
|
|
327
|
-
}
|
|
328
|
-
} else {
|
|
329
|
-
log("Already authenticated with Google Workspace");
|
|
330
|
-
}
|
|
331
294
|
|
|
332
|
-
// Install GWS skills
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
295
|
+
// Install GWS skills from bundled templates
|
|
296
|
+
info("Installing Google Workspace skills...");
|
|
297
|
+
const gwsSkillsSrc = path.join(srcClaude, "skills");
|
|
298
|
+
const gwsSkillsDst = path.join(dstClaude, "skills");
|
|
299
|
+
let addedGws = 0;
|
|
300
|
+
for (const entry of fs.readdirSync(gwsSkillsSrc, { withFileTypes: true })) {
|
|
301
|
+
if (!entry.name.startsWith("gws-") || !entry.isDirectory()) continue;
|
|
302
|
+
const destPath = path.join(gwsSkillsDst, entry.name);
|
|
303
|
+
if (!fs.existsSync(destPath)) {
|
|
304
|
+
copyDir(path.join(gwsSkillsSrc, entry.name), destPath);
|
|
305
|
+
addedGws++;
|
|
306
|
+
}
|
|
343
307
|
}
|
|
308
|
+
log(`GWS Skills: added ${addedGws} new`);
|
|
344
309
|
|
|
345
310
|
// Add gws permission to settings
|
|
346
311
|
const settingsPath = path.join(dstClaude, "settings.local.json");
|
|
@@ -378,11 +343,9 @@ PROJECT_ROOT=${projectRoot}
|
|
|
378
343
|
console.log("");
|
|
379
344
|
|
|
380
345
|
if (!setupGws) {
|
|
381
|
-
info("To add Google Workspace later:");
|
|
382
|
-
console.log(`
|
|
383
|
-
console.log("
|
|
384
|
-
console.log(" npx gws auth setup --login");
|
|
385
|
-
console.log(" npx skills add https://github.com/googleworkspace/cli");
|
|
346
|
+
info("To add Google Workspace later, re-run:");
|
|
347
|
+
console.log(` npx create-claude-code-visualizer ${projectDir === "." ? "" : projectDir}`);
|
|
348
|
+
console.log(" (and choose Yes for Google Workspace)");
|
|
386
349
|
console.log("");
|
|
387
350
|
}
|
|
388
351
|
}
|