get-shit-done-cc 1.0.4 → 1.0.7

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/bin/install.js +99 -17
  2. package/package.json +2 -2
package/bin/install.js CHANGED
@@ -3,10 +3,12 @@
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const os = require('os');
6
+ const readline = require('readline');
6
7
 
7
8
  // Colors
8
9
  const cyan = '\x1b[36m';
9
10
  const green = '\x1b[32m';
11
+ const yellow = '\x1b[33m';
10
12
  const dim = '\x1b[2m';
11
13
  const reset = '\x1b[0m';
12
14
 
@@ -26,28 +28,108 @@ ${cyan} ██████╗ ███████╗██████╗
26
28
  development system for Claude Code by TÂCHES.
27
29
  `;
28
30
 
31
+ // Parse args
32
+ const args = process.argv.slice(2);
33
+ const hasGlobal = args.includes('--global') || args.includes('-g');
34
+ const hasLocal = args.includes('--local') || args.includes('-l');
35
+
29
36
  console.log(banner);
30
37
 
31
- // Paths
32
- const src = path.join(__dirname, '..');
33
- const claudeDir = path.join(os.homedir(), '.claude');
34
- const commandsDir = path.join(claudeDir, 'commands');
38
+ /**
39
+ * Recursively copy directory, replacing paths in .md files
40
+ */
41
+ function copyWithPathReplacement(srcDir, destDir, pathPrefix) {
42
+ fs.mkdirSync(destDir, { recursive: true });
43
+
44
+ const entries = fs.readdirSync(srcDir, { withFileTypes: true });
45
+
46
+ for (const entry of entries) {
47
+ const srcPath = path.join(srcDir, entry.name);
48
+ const destPath = path.join(destDir, entry.name);
49
+
50
+ if (entry.isDirectory()) {
51
+ copyWithPathReplacement(srcPath, destPath, pathPrefix);
52
+ } else if (entry.name.endsWith('.md')) {
53
+ // Replace ~/.claude/ with the appropriate prefix in markdown files
54
+ let content = fs.readFileSync(srcPath, 'utf8');
55
+ content = content.replace(/~\/\.claude\//g, pathPrefix);
56
+ fs.writeFileSync(destPath, content);
57
+ } else {
58
+ fs.copyFileSync(srcPath, destPath);
59
+ }
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Install to the specified directory
65
+ */
66
+ function install(isGlobal) {
67
+ const src = path.join(__dirname, '..');
68
+ const claudeDir = isGlobal
69
+ ? path.join(os.homedir(), '.claude')
70
+ : path.join(process.cwd(), '.claude');
71
+
72
+ const locationLabel = isGlobal
73
+ ? claudeDir.replace(os.homedir(), '~')
74
+ : claudeDir.replace(process.cwd(), '.');
75
+
76
+ // Path prefix for file references
77
+ const pathPrefix = isGlobal ? '~/.claude/' : './.claude/';
35
78
 
36
- // Create directories
37
- fs.mkdirSync(commandsDir, { recursive: true });
79
+ console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
38
80
 
39
- // Copy commands/gsd
40
- const gsdSrc = path.join(src, 'commands', 'gsd');
41
- const gsdDest = path.join(commandsDir, 'gsd');
42
- fs.cpSync(gsdSrc, gsdDest, { recursive: true });
43
- console.log(` ${green}✓${reset} Installed commands/gsd`);
81
+ // Create commands directory
82
+ const commandsDir = path.join(claudeDir, 'commands');
83
+ fs.mkdirSync(commandsDir, { recursive: true });
44
84
 
45
- // Copy get-shit-done
46
- const skillSrc = path.join(src, 'get-shit-done');
47
- const skillDest = path.join(claudeDir, 'get-shit-done');
48
- fs.cpSync(skillSrc, skillDest, { recursive: true });
49
- console.log(` ${green}✓${reset} Installed get-shit-done`);
85
+ // Copy commands/gsd with path replacement
86
+ const gsdSrc = path.join(src, 'commands', 'gsd');
87
+ const gsdDest = path.join(commandsDir, 'gsd');
88
+ copyWithPathReplacement(gsdSrc, gsdDest, pathPrefix);
89
+ console.log(` ${green}✓${reset} Installed commands/gsd`);
50
90
 
51
- console.log(`
91
+ // Copy get-shit-done skill with path replacement
92
+ const skillSrc = path.join(src, 'get-shit-done');
93
+ const skillDest = path.join(claudeDir, 'get-shit-done');
94
+ copyWithPathReplacement(skillSrc, skillDest, pathPrefix);
95
+ console.log(` ${green}✓${reset} Installed get-shit-done`);
96
+
97
+ console.log(`
52
98
  ${green}Done!${reset} Run ${cyan}/gsd:help${reset} to get started.
53
99
  `);
100
+ }
101
+
102
+ /**
103
+ * Prompt for install location
104
+ */
105
+ function promptLocation() {
106
+ const rl = readline.createInterface({
107
+ input: process.stdin,
108
+ output: process.stdout
109
+ });
110
+
111
+ console.log(` ${yellow}Where would you like to install?${reset}
112
+
113
+ ${cyan}1${reset}) Global ${dim}(~/.claude)${reset} - available in all projects
114
+ ${cyan}2${reset}) Local ${dim}(./.claude)${reset} - this project only
115
+ `);
116
+
117
+ rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
118
+ rl.close();
119
+ const choice = answer.trim() || '1';
120
+ const isGlobal = choice !== '2';
121
+ install(isGlobal);
122
+ });
123
+ }
124
+
125
+ // Main
126
+ if (hasGlobal && hasLocal) {
127
+ console.error(` ${yellow}Cannot specify both --global and --local${reset}`);
128
+ process.exit(1);
129
+ } else if (hasGlobal) {
130
+ install(true);
131
+ } else if (hasLocal) {
132
+ install(false);
133
+ } else {
134
+ promptLocation();
135
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "get-shit-done-cc",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.",
5
5
  "bin": {
6
- "get-shit-done-cc": "./bin/install.js"
6
+ "get-shit-done-cc": "bin/install.js"
7
7
  },
8
8
  "files": [
9
9
  "bin",