UNPKG

consortium

Version:

Remote control and session sharing CLI for AI coding agents

46 lines (39 loc) 1.68 kB
#!/usr/bin/env node import { execFileSync } from 'child_process'; import { fileURLToPath } from 'url'; import { join, dirname } from 'path'; import { homedir } from 'os'; // Check if we're already running with the flags const hasNoWarnings = process.execArgv.includes('--no-warnings'); const hasNoDeprecation = process.execArgv.includes('--no-deprecation'); if (!hasNoWarnings || !hasNoDeprecation) { // Re-execute with the flags const __filename = fileURLToPath(import.meta.url); const scriptPath = join(dirname(__filename), '../dist/index.mjs'); // Set development environment variables process.env.CONSORTIUM_HOME_DIR = join(homedir(), '.consortium-dev'); process.env.CONSORTIUM_VARIANT = 'dev'; process.env.CONSORTIUM_SERVER_URL = process.env.CONSORTIUM_SERVER_URL || 'http://localhost:3005'; process.env.CONSORTIUM_WEBAPP_URL = process.env.CONSORTIUM_WEBAPP_URL || 'http://localhost:8081'; try { execFileSync( process.execPath, ['--no-warnings', '--no-deprecation', scriptPath, ...process.argv.slice(2)], { stdio: 'inherit', env: process.env } ); } catch (error) { // Exit with the same code as the subprocess process.exit(error.status || 1); } } else { // Already have the flags, import normally // Set development environment variables process.env.CONSORTIUM_HOME_DIR = join(homedir(), '.consortium-dev'); process.env.CONSORTIUM_VARIANT = 'dev'; process.env.CONSORTIUM_SERVER_URL = process.env.CONSORTIUM_SERVER_URL || 'http://localhost:3005'; process.env.CONSORTIUM_WEBAPP_URL = process.env.CONSORTIUM_WEBAPP_URL || 'http://localhost:8081'; await import('../dist/index.mjs'); }