create-claude-code-visualizer 0.1.1 → 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 +21 -47
- 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()) {
|
|
@@ -176,10 +177,11 @@ async function main() {
|
|
|
176
177
|
);
|
|
177
178
|
log(`Commands: added ${addedCommands} new`);
|
|
178
179
|
|
|
179
|
-
// Skills
|
|
180
|
+
// Skills (skip gws-* skills — those are installed with Google Workspace setup)
|
|
180
181
|
const addedSkills = copyDirAdditive(
|
|
181
182
|
path.join(srcClaude, "skills"),
|
|
182
|
-
path.join(dstClaude, "skills")
|
|
183
|
+
path.join(dstClaude, "skills"),
|
|
184
|
+
"gws-"
|
|
183
185
|
);
|
|
184
186
|
log(`Skills: added ${addedSkills} new`);
|
|
185
187
|
|
|
@@ -289,47 +291,21 @@ PROJECT_ROOT=${projectRoot}
|
|
|
289
291
|
|
|
290
292
|
if (setupGws) {
|
|
291
293
|
console.log("");
|
|
292
|
-
info("Installing Google Workspace CLI...");
|
|
293
|
-
run("npm install @anthropic-ai/claude-code-google-workspace", { cwd: projectRoot });
|
|
294
|
-
|
|
295
|
-
// Check if gws auth is needed
|
|
296
|
-
const hasAuth = runCapture("npx gws auth status");
|
|
297
|
-
if (!hasAuth) {
|
|
298
|
-
console.log("");
|
|
299
|
-
const { gwsAuth } = await prompts({
|
|
300
|
-
type: "select",
|
|
301
|
-
name: "gwsAuth",
|
|
302
|
-
message: "Google Workspace authentication",
|
|
303
|
-
choices: [
|
|
304
|
-
{ title: "Full setup (creates GCP project + OAuth)", value: "setup" },
|
|
305
|
-
{ title: "Login only (you already have OAuth configured)", value: "login" },
|
|
306
|
-
{ title: "Skip for now", value: "skip" },
|
|
307
|
-
],
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
if (gwsAuth === "setup") {
|
|
311
|
-
run("npx gws auth setup --login", { cwd: projectRoot });
|
|
312
|
-
} else if (gwsAuth === "login") {
|
|
313
|
-
run("npx gws auth login", { cwd: projectRoot });
|
|
314
|
-
} else {
|
|
315
|
-
info("Skipping auth. Run later: npx gws auth setup --login");
|
|
316
|
-
}
|
|
317
|
-
} else {
|
|
318
|
-
log("Already authenticated with Google Workspace");
|
|
319
|
-
}
|
|
320
294
|
|
|
321
|
-
// Install GWS skills
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
+
}
|
|
332
307
|
}
|
|
308
|
+
log(`GWS Skills: added ${addedGws} new`);
|
|
333
309
|
|
|
334
310
|
// Add gws permission to settings
|
|
335
311
|
const settingsPath = path.join(dstClaude, "settings.local.json");
|
|
@@ -367,11 +343,9 @@ PROJECT_ROOT=${projectRoot}
|
|
|
367
343
|
console.log("");
|
|
368
344
|
|
|
369
345
|
if (!setupGws) {
|
|
370
|
-
info("To add Google Workspace later:");
|
|
371
|
-
console.log(`
|
|
372
|
-
console.log("
|
|
373
|
-
console.log(" npx gws auth setup --login");
|
|
374
|
-
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)");
|
|
375
349
|
console.log("");
|
|
376
350
|
}
|
|
377
351
|
}
|