@hopla/claude-setup 1.0.1 → 1.0.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.
Files changed (2) hide show
  1. package/cli.js +46 -3
  2. package/package.json +1 -1
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.2",
4
4
  "description": "Hopla team agentic coding system for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {