forked from Leuconoe/ClaudeCodeMultiAccounts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.cjs
More file actions
45 lines (40 loc) · 1.21 KB
/
Copy pathcli.cjs
File metadata and controls
45 lines (40 loc) · 1.21 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
#!/usr/bin/env node
const path = require('path');
const command = process.argv[2] || 'help';
const args = process.argv.slice(3);
function run(modulePath, forwardedArgs) {
process.argv = [process.argv[0], modulePath, ...forwardedArgs];
require(modulePath);
}
function showHelp() {
console.log('Claude Code Multi-Account Switcher');
console.log('');
console.log('Usage:');
console.log(' claude-code-multi-accounts install');
console.log(' claude-code-multi-accounts uninstall');
console.log(' claude-code-multi-accounts switch [selector]');
console.log(' claude-code-multi-accounts sync');
}
switch (command) {
case 'install':
run(path.join(__dirname, 'install.cjs'), args);
break;
case 'uninstall':
run(path.join(__dirname, 'uninstall.cjs'), args);
break;
case 'switch':
run(path.join(__dirname, 'cc-switch.cjs'), ['--usage-command', 'cc-switch', ...args]);
break;
case 'sync':
run(path.join(__dirname, 'cc-switch.cjs'), ['sync', ...args]);
break;
case 'help':
case '--help':
case '-h':
showHelp();
break;
default:
console.error(`Unknown command: ${command}`);
console.error('Run with `help` to see supported commands.');
process.exitCode = 1;
}