davenov-cc 1.0.1 ā 1.0.4
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/README.md +11 -1
- package/bin/cli.js +8 -2
- package/install.js +86 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,17 @@ npx davenov-cc@latest
|
|
|
47
47
|
|
|
48
48
|
The `@latest` tag ensures you get the newest version.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
## Uninstalling
|
|
51
|
+
|
|
52
|
+
To remove all davenov-cc customizations from `~/.claude/`:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx davenov-cc --uninstall
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This only removes files installed by this package - your other customizations remain untouched.
|
|
59
|
+
|
|
60
|
+
## Behavior with existing files
|
|
51
61
|
|
|
52
62
|
- **Merges directories** - Existing directories are preserved, not deleted
|
|
53
63
|
- **Overwrites matching files** - Files with the same path get overwritten
|
package/bin/cli.js
CHANGED
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const { spawn } = require('child_process');
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// Pass through arguments to install.js
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
|
|
9
|
+
// Default to --auto-override for install (unless --uninstall)
|
|
10
|
+
const isUninstall = args.includes('--uninstall');
|
|
11
|
+
const scriptArgs = isUninstall ? args : ['--auto-override', ...args];
|
|
12
|
+
|
|
7
13
|
const installScript = path.join(__dirname, '..', 'install.js');
|
|
8
14
|
|
|
9
|
-
const child = spawn(process.execPath, [installScript,
|
|
15
|
+
const child = spawn(process.execPath, [installScript, ...scriptArgs], {
|
|
10
16
|
stdio: 'inherit',
|
|
11
17
|
cwd: path.join(__dirname, '..')
|
|
12
18
|
});
|
package/install.js
CHANGED
|
@@ -11,10 +11,22 @@ const SOURCE_DIR = __dirname;
|
|
|
11
11
|
// Parse command line arguments
|
|
12
12
|
const args = process.argv.slice(2);
|
|
13
13
|
const AUTO_OVERRIDE = args.includes("--auto-override");
|
|
14
|
+
const UNINSTALL = args.includes("--uninstall");
|
|
14
15
|
|
|
15
|
-
// Directories to install
|
|
16
|
+
// Directories to install/uninstall
|
|
16
17
|
const CUSTOMIZATION_DIRS = ["commands", "skills"];
|
|
17
18
|
|
|
19
|
+
// Files/folders installed by this package (for uninstall)
|
|
20
|
+
const INSTALLED_ITEMS = {
|
|
21
|
+
commands: ["davenov:cc:interview.md", "davenov:cc:rule.md", "davenov:cc:update.md"],
|
|
22
|
+
skills: [
|
|
23
|
+
"davenov:cc:expert-convex-nextjs",
|
|
24
|
+
"davenov:cc:expert-evolu-nextjs",
|
|
25
|
+
"davenov:cc:expert-nextjs-16",
|
|
26
|
+
"davenov:cc:expert-build-nostr"
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
|
|
18
30
|
function createReadlineInterface() {
|
|
19
31
|
return readline.createInterface({
|
|
20
32
|
input: process.stdin,
|
|
@@ -62,7 +74,80 @@ function countFiles(dir) {
|
|
|
62
74
|
return count;
|
|
63
75
|
}
|
|
64
76
|
|
|
77
|
+
function removeRecursive(target) {
|
|
78
|
+
if (!fs.existsSync(target)) return false;
|
|
79
|
+
|
|
80
|
+
const stats = fs.statSync(target);
|
|
81
|
+
if (stats.isDirectory()) {
|
|
82
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
83
|
+
} else {
|
|
84
|
+
fs.unlinkSync(target);
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async function uninstall(rl) {
|
|
90
|
+
console.log("\nšļø Claude Code Customizations Uninstaller\n");
|
|
91
|
+
console.log(`Target: ${CLAUDE_DIR}\n`);
|
|
92
|
+
|
|
93
|
+
// Check what's installed
|
|
94
|
+
const installed = [];
|
|
95
|
+
for (const [dir, items] of Object.entries(INSTALLED_ITEMS)) {
|
|
96
|
+
for (const item of items) {
|
|
97
|
+
const fullPath = path.join(CLAUDE_DIR, dir, item);
|
|
98
|
+
if (fs.existsSync(fullPath)) {
|
|
99
|
+
installed.push({ dir, item, fullPath });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (installed.length === 0) {
|
|
105
|
+
console.log("No davenov-cc customizations found to uninstall.");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
console.log("Found installed customizations:");
|
|
110
|
+
for (const { dir, item } of installed) {
|
|
111
|
+
console.log(` - ${dir}/${item}`);
|
|
112
|
+
}
|
|
113
|
+
console.log();
|
|
114
|
+
|
|
115
|
+
if (!AUTO_OVERRIDE) {
|
|
116
|
+
const answer = await prompt(
|
|
117
|
+
rl,
|
|
118
|
+
"Do you want to remove these customizations? (y/N): "
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
if (answer.toLowerCase() !== "y") {
|
|
122
|
+
console.log("\nUninstall cancelled.");
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
console.log("Auto-override enabled, proceeding...");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
console.log("\nRemoving...\n");
|
|
130
|
+
|
|
131
|
+
let removed = 0;
|
|
132
|
+
for (const { dir, item, fullPath } of installed) {
|
|
133
|
+
if (removeRecursive(fullPath)) {
|
|
134
|
+
console.log(` ā ${dir}/${item}`);
|
|
135
|
+
removed++;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
console.log(`\nā
Uninstall complete! Removed ${removed} item(s).\n`);
|
|
140
|
+
}
|
|
141
|
+
|
|
65
142
|
async function main() {
|
|
143
|
+
const rl = createReadlineInterface();
|
|
144
|
+
|
|
145
|
+
if (UNINSTALL) {
|
|
146
|
+
await uninstall(rl);
|
|
147
|
+
rl.close();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
66
151
|
console.log("\nš¦ Claude Code Customizations Installer\n");
|
|
67
152
|
console.log(`Source: ${SOURCE_DIR}`);
|
|
68
153
|
console.log(`Target: ${CLAUDE_DIR}\n`);
|
|
@@ -90,8 +175,6 @@ async function main() {
|
|
|
90
175
|
fs.existsSync(path.join(CLAUDE_DIR, dir))
|
|
91
176
|
);
|
|
92
177
|
|
|
93
|
-
const rl = createReadlineInterface();
|
|
94
|
-
|
|
95
178
|
if (existing.length > 0) {
|
|
96
179
|
console.log("ā ļø The following directories already exist:");
|
|
97
180
|
for (const dir of existing) {
|