@hopla/claude-setup 1.0.1 → 1.0.3

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 (3) hide show
  1. package/README.md +16 -10
  2. package/cli.js +46 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -5,13 +5,27 @@ Hopla team agentic coding system for Claude Code. Installs global rules and comm
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npx @hopla/claude-setup
8
+ npm install -g @hopla/claude-setup
9
+ claude-setup
9
10
  ```
10
11
 
11
12
  To overwrite existing files without prompting:
12
13
 
13
14
  ```bash
14
- npx @hopla/claude-setup --force
15
+ claude-setup --force
16
+ ```
17
+
18
+ ## Update
19
+
20
+ ```bash
21
+ npm install -g @hopla/claude-setup@latest
22
+ claude-setup --force
23
+ ```
24
+
25
+ ## Uninstall
26
+
27
+ ```bash
28
+ claude-setup --uninstall
15
29
  ```
16
30
 
17
31
  ## What gets installed
@@ -31,11 +45,3 @@ npx @hopla/claude-setup --force
31
45
  | `/code-review-fix` | Fix issues found in a code review report |
32
46
  | `/execution-report` | Generate an implementation report for system review |
33
47
  | `/system-review` | Analyze implementation against plan to find process improvements |
34
-
35
- ## Update
36
-
37
- Re-run the install command to update to the latest version:
38
-
39
- ```bash
40
- npx @hopla/claude-setup@latest
41
- ```
package/cli.js CHANGED
@@ -6,11 +6,13 @@ import os from "os";
6
6
  import readline from "readline";
7
7
 
8
8
  const FORCE = process.argv.includes("--force");
9
+ const UNINSTALL = process.argv.includes("--uninstall");
9
10
  const CLAUDE_DIR = path.join(os.homedir(), ".claude");
10
11
  const COMMANDS_DIR = path.join(CLAUDE_DIR, "commands");
11
12
  const FILES_DIR = path.join(import.meta.dirname, "files");
12
13
 
13
14
  const GREEN = "\x1b[32m";
15
+ const RED = "\x1b[31m";
14
16
  const YELLOW = "\x1b[33m";
15
17
  const CYAN = "\x1b[36m";
16
18
  const RESET = "\x1b[0m";
@@ -48,7 +50,47 @@ async function installFile(src, dest, label) {
48
50
  log(` ${GREEN}✓${RESET} ${exists ? "Updated" : "Installed"}: ${label}`);
49
51
  }
50
52
 
51
- async function main() {
53
+ function removeFile(dest, label) {
54
+ if (fs.existsSync(dest)) {
55
+ fs.rmSync(dest);
56
+ log(` ${RED}✕${RESET} Removed: ${label}`);
57
+ } else {
58
+ log(` ${YELLOW}↷${RESET} Not found: ${label}`);
59
+ }
60
+ }
61
+
62
+ async function uninstall() {
63
+ log(`\n${BOLD}@hopla/claude-setup${RESET} — Uninstall\n`);
64
+
65
+ const commandFiles = fs.readdirSync(path.join(FILES_DIR, "commands"));
66
+ const filesToRemove = [
67
+ { dest: path.join(CLAUDE_DIR, "CLAUDE.md"), label: "~/.claude/CLAUDE.md" },
68
+ ...commandFiles.map((file) => ({
69
+ dest: path.join(COMMANDS_DIR, file),
70
+ label: `~/.claude/commands/${file}`,
71
+ })),
72
+ ];
73
+
74
+ log(`The following files will be removed:`);
75
+ for (const { label } of filesToRemove) {
76
+ log(` ${RED}✕${RESET} ${label}`);
77
+ }
78
+
79
+ const ok = await confirm(`\nContinue? (y/N) `);
80
+ if (!ok) {
81
+ log(`\nAborted.\n`);
82
+ return;
83
+ }
84
+
85
+ log("");
86
+ for (const { dest, label } of filesToRemove) {
87
+ removeFile(dest, label);
88
+ }
89
+
90
+ log(`\n${GREEN}${BOLD}Done!${RESET} Files removed.\n`);
91
+ }
92
+
93
+ async function install() {
52
94
  log(`\n${BOLD}@hopla/claude-setup${RESET} — Agentic Coding System\n`);
53
95
 
54
96
  // Create directories if needed
@@ -80,7 +122,8 @@ async function main() {
80
122
  log(`\nRun with ${BOLD}--force${RESET} to overwrite all files without prompting.\n`);
81
123
  }
82
124
 
83
- main().catch((err) => {
84
- console.error("Installation failed:", err.message);
125
+ const run = UNINSTALL ? uninstall : install;
126
+ run().catch((err) => {
127
+ console.error("Failed:", err.message);
85
128
  process.exit(1);
86
129
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hopla/claude-setup",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Hopla team agentic coding system for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {