2025-08-22 20:39:46 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
const { spawnSync } = require("child_process");
|
|
|
|
|
const { detectPython, detectPip } = require("./checkEnv");
|
2025-08-23 12:50:20 +02:00
|
|
|
const { checkAndNotify } = require("./checkUpdate");
|
2025-08-22 20:39:46 +02:00
|
|
|
|
|
|
|
|
let pythonCmd = detectPython();
|
|
|
|
|
if (!pythonCmd) {
|
|
|
|
|
console.error("❌ Python 3 is required but not found.");
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const args = process.argv.slice(2);
|
|
|
|
|
|
2025-08-23 12:50:20 +02:00
|
|
|
// Parse command line arguments for update control
|
|
|
|
|
const noUpdateCheck = args.includes('--no-update-check');
|
|
|
|
|
const autoUpdate = args.includes('--auto-update');
|
|
|
|
|
const isQuiet = args.includes('--quiet') || args.includes('-q');
|
|
|
|
|
|
2025-08-22 20:39:46 +02:00
|
|
|
// Special case: update command
|
|
|
|
|
if (args[0] === "update") {
|
|
|
|
|
require("./update");
|
|
|
|
|
process.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-23 12:50:20 +02:00
|
|
|
// Check for updates unless disabled
|
|
|
|
|
if (!noUpdateCheck && !isQuiet) {
|
|
|
|
|
// Run update check asynchronously to avoid blocking
|
|
|
|
|
checkAndNotify({
|
|
|
|
|
autoUpdate: autoUpdate,
|
|
|
|
|
silent: false
|
|
|
|
|
}).then(updated => {
|
|
|
|
|
if (updated) {
|
|
|
|
|
console.log("\n🔄 SuperClaude was updated. Please restart to use the new version.");
|
|
|
|
|
process.exit(0);
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
// Silently ignore update check errors
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-22 20:39:46 +02:00
|
|
|
// Forward everything to Python SuperClaude
|
|
|
|
|
const result = spawnSync(pythonCmd, ["-m", "SuperClaude", ...args], { stdio: "inherit", shell: true });
|
|
|
|
|
process.exit(result.status);
|
|
|
|
|
|