-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·95 lines (88 loc) · 3.1 KB
/
cli.js
File metadata and controls
executable file
·95 lines (88 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env node
const path = require('path');
const { enable, disable } = require('./hooks/flag');
function showHelp() {
console.log(`fasterizy — direct prose for agent planning and docs
Usage:
npx fasterizy install Interactive multi-agent install
npx fasterizy install --agents opencode,openclaw,cursor
npx fasterizy update Refresh npx-skills installs from GitHub; print plugin update hints
npx fasterizy start Enable runtime flag in the Claude config dir
npx fasterizy stop Disable runtime flag
npx fasterizy status Flag state, version, detected installs
npx fasterizy promote-to-plugin Install fasterizy as native Claude Code plugin (visible in /plugin)
npx fasterizy uninstall-hooks Remove Claude Code hook entries (use after promote-to-plugin)
`);
}
async function main() {
const cmd = process.argv[2];
const args = process.argv.slice(3);
switch (cmd) {
case 'install':
await require('./cli/install')(args);
break;
case 'update':
require('./cli/update')();
break;
case 'start':
enable();
console.log('fasterizy: ON');
break;
case 'stop':
disable();
console.log('fasterizy: OFF');
break;
case 'status':
require('./cli/status')();
break;
case 'promote-to-plugin': {
const { installAsClaudePlugin } = require('./cli/install-plugin');
const r = installAsClaudePlugin();
console.log('fasterizy installed as a native Claude Code plugin.');
console.log(' marketplace:', r.marketplacePath);
console.log(' installPath:', r.installPath);
console.log(' version: ', r.shortSha, '(', r.fullSha, ')');
if (r.strippedHooksFromSettings) {
console.log(' stripped fasterizy hook entries from settings.json');
}
if (r.removedHookFiles.length) {
console.log(' removed old hook files:');
for (const f of r.removedHookFiles) console.log(' ' + f);
}
console.log('Restart Claude Code. fasterizy will appear in /plugin and load via the plugin path.');
break;
}
case 'uninstall-hooks': {
const { uninstallClaudeCodeHooks } = require('./cli/install-hooks');
const r = uninstallClaudeCodeHooks();
if (r.removedFiles.length) {
console.log('Removed hook files:');
for (const f of r.removedFiles) console.log(' ' + f);
} else {
console.log('No fasterizy hook files found in ~/.claude/hooks/.');
}
if (r.settingsChanged) {
console.log('Stripped fasterizy entries from settings.json.');
if (r.backup) console.log(' backup:', r.backup);
} else {
console.log('No fasterizy entries in settings.json.');
}
console.log('Restart Claude Code for changes to take effect.');
break;
}
case '-h':
case '--help':
case undefined:
showHelp();
process.exit(cmd === undefined ? 1 : 0);
break;
default:
console.error('Unknown command:', cmd);
showHelp();
process.exit(1);
}
}
main().catch((e) => {
console.error(e);
process.exit(1);
});