@claudetools/tools 0.1.2 → 0.2.1
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/dist/cli.js +38 -7
- package/dist/setup.d.ts +1 -0
- package/dist/setup.js +847 -159
- package/dist/watcher.d.ts +3 -0
- package/dist/watcher.js +307 -0
- package/package.json +6 -2
package/dist/cli.js
CHANGED
|
@@ -7,8 +7,9 @@ import { parseArgs } from 'node:util';
|
|
|
7
7
|
import { readFileSync } from 'node:fs';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { dirname, join } from 'node:path';
|
|
10
|
-
import { runSetup } from './setup.js';
|
|
10
|
+
import { runSetup, runUninstall } from './setup.js';
|
|
11
11
|
import { startServer } from './index.js';
|
|
12
|
+
import { startWatcher, stopWatcher, watcherStatus } from './watcher.js';
|
|
12
13
|
// Get version from package.json
|
|
13
14
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
15
|
const __dirname = dirname(__filename);
|
|
@@ -16,13 +17,14 @@ const packagePath = join(__dirname, '..', 'package.json');
|
|
|
16
17
|
const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
17
18
|
const version = packageJson.version;
|
|
18
19
|
// Parse command-line arguments
|
|
19
|
-
const { values } = parseArgs({
|
|
20
|
+
const { values, positionals } = parseArgs({
|
|
20
21
|
options: {
|
|
21
22
|
setup: { type: 'boolean', short: 's' },
|
|
23
|
+
uninstall: { type: 'boolean', short: 'u' },
|
|
22
24
|
version: { type: 'boolean', short: 'v' },
|
|
23
25
|
help: { type: 'boolean', short: 'h' },
|
|
24
26
|
},
|
|
25
|
-
allowPositionals:
|
|
27
|
+
allowPositionals: true,
|
|
26
28
|
});
|
|
27
29
|
// Handle version flag
|
|
28
30
|
if (values.version) {
|
|
@@ -36,13 +38,20 @@ claudetools - Persistent AI memory for Claude Code
|
|
|
36
38
|
|
|
37
39
|
Usage:
|
|
38
40
|
claudetools [options]
|
|
41
|
+
claudetools [command]
|
|
39
42
|
|
|
40
43
|
Options:
|
|
41
|
-
-s, --setup
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
+
-s, --setup Interactive setup wizard
|
|
45
|
+
-u, --uninstall Remove from Claude Code
|
|
46
|
+
-v, --version Show version
|
|
47
|
+
-h, --help Show this help
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
Commands:
|
|
50
|
+
watch Start the file watcher daemon
|
|
51
|
+
watch --stop Stop the watcher daemon
|
|
52
|
+
watch --status Check watcher status
|
|
53
|
+
|
|
54
|
+
Running without options starts the MCP server.
|
|
46
55
|
|
|
47
56
|
Documentation: https://github.com/claudetools/memory
|
|
48
57
|
`);
|
|
@@ -55,6 +64,28 @@ if (values.setup) {
|
|
|
55
64
|
process.exit(1);
|
|
56
65
|
});
|
|
57
66
|
}
|
|
67
|
+
else if (values.uninstall) {
|
|
68
|
+
runUninstall().catch((error) => {
|
|
69
|
+
console.error('Uninstall failed:', error);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else if (positionals[0] === 'watch') {
|
|
74
|
+
// Handle watch command
|
|
75
|
+
const watchArgs = process.argv.slice(3); // Get args after 'watch'
|
|
76
|
+
if (watchArgs.includes('--stop')) {
|
|
77
|
+
stopWatcher();
|
|
78
|
+
}
|
|
79
|
+
else if (watchArgs.includes('--status')) {
|
|
80
|
+
watcherStatus();
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
startWatcher().catch((error) => {
|
|
84
|
+
console.error('Watcher failed:', error);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
58
89
|
else {
|
|
59
90
|
// Start MCP server
|
|
60
91
|
startServer();
|
package/dist/setup.d.ts
CHANGED