MCPcopy Create free account
hub / github.com/ConsortiumAI/Consortium / main

Function main

packages/consortium-cli/src/index.ts:14–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12import { logger } from './ui/logger';
13
14async function main() {
15 const args = process.argv.slice(2);
16
17 // Parse simple flags
18 let model: string | undefined;
19 let permissionMode: string | undefined;
20
21 for (let i = 0; i < args.length; i++) {
22 if (args[i] === '--model' && i + 1 < args.length) {
23 model = args[++i];
24 } else if (args[i] === '--permission-mode' && i + 1 < args.length) {
25 permissionMode = args[++i];
26 } else if (args[i] === '--help' || args[i] === '-h') {
27 console.log(`
28consortium-cli - Encrypted Remote AI Coding Relay
29
30Usage: consortium-cli [options]
31
32Options:
33 --model <model> Claude model to use
34 --permission-mode <mode> Permission mode (default, acceptEdits, bypassPermissions, plan)
35 --help, -h Show this help message
36
37Environment:
38 CONSORTIUM_SERVER_URL Server URL (default: https://api.consortium.dev)
39 CONSORTIUM_HOME_DIR Data directory (default: ~/.consortium)
40 CONSORTIUM_CLAUDE_PATH Path to Claude Code executable
41 DEBUG Enable debug logging
42`);
43 process.exit(0);
44 }
45 }
46
47 try {
48 // Authenticate
49 const { credentials, machineId } = await authAndSetupMachineIfNeeded();
50
51 // Build options
52 const options: StartOptions = {
53 model,
54 permissionMode: permissionMode as any,
55 };
56
57 // Run Claude in relay mode
58 await runClaude(credentials, machineId, options);
59 } catch (error) {
60 logger.debug('[MAIN] Fatal error:', error);
61 console.error('Fatal error:', error instanceof Error ? error.message : error);
62 process.exit(1);
63 }
64}
65
66main();

Callers 1

index.tsFile · 0.70

Calls 4

runClaudeFunction · 0.90
debugMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected