Create cli.js

Added cli.js logic for npm implimentation 

Signed-off-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
This commit is contained in:
Mithun Gowda B 2025-08-16 10:01:01 +05:30 committed by GitHub
parent fd904c8d59
commit 3a4dad15de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

22
bin/cli.js Normal file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env node
const { spawnSync } = require("child_process");
const { detectPython, detectPip } = require("./checkEnv");
let pythonCmd = detectPython();
if (!pythonCmd) {
console.error("❌ Python 3 is required but not found.");
process.exit(1);
}
const args = process.argv.slice(2);
// Special case: update command
if (args[0] === "update") {
require("./update");
process.exit(0);
}
// Forward everything to Python SuperClaude
const result = spawnSync(pythonCmd, ["-m", "SuperClaude", ...args], { stdio: "inherit", shell: true });
process.exit(result.status);