From fd904c8d59eda0880980feb0932c62da7f440491 Mon Sep 17 00:00:00 2001 From: Mithun Gowda B Date: Sat, 16 Aug 2025 09:59:48 +0530 Subject: [PATCH] Create install.js Added installation logic for npm Signed-off-by: Mithun Gowda B --- bin/install.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 bin/install.js diff --git a/bin/install.js b/bin/install.js new file mode 100644 index 0000000..95b1e65 --- /dev/null +++ b/bin/install.js @@ -0,0 +1,31 @@ +#!/usr/bin/env node +const { run, detectPython, detectPip, isSuperClaudeInstalled } = require("./checkEnv"); + +console.log("🔍 Checking environment..."); + +let pythonCmd = detectPython(); +if (!pythonCmd) { + console.error("❌ Python 3 is required but not found."); + process.exit(1); +} +console.log(`✅ Found Python: ${pythonCmd}`); + +let pipCmd = detectPip(); +if (!pipCmd) { + console.error("❌ pip is required but not found."); + process.exit(1); +} +console.log(`✅ Found Pip: ${pipCmd}`); + +// Check installation +if (!isSuperClaudeInstalled(pipCmd)) { + console.log("📦 Installing SuperClaude from PyPI..."); + const result = run(pipCmd, ["install", "SuperClaude"], { stdio: "inherit" }); + if (result.status !== 0) { + console.error("❌ Installation failed."); + process.exit(1); + } + console.log("✅ SuperClaude installed successfully!"); +} else { + console.log("✅ SuperClaude already installed."); + }