diff --git a/Guides/installation-guide.md b/Guides/installation-guide.md index 3e0bc2a..e3f1f5b 100644 --- a/Guides/installation-guide.md +++ b/Guides/installation-guide.md @@ -29,6 +29,44 @@ SuperClaude install # That's it! 🎉 ``` +### Option C: From npm (Global, after publishing this won't works for now) +```bash +npm install -g superclaude +superclaude --help +``` +- Requires package to be published on npmjs.org. +- Installs the npm wrapper and sets up SuperClaude via pip. + +### Option D: From npm (Local Project this won't works for now) +```bash +npm install superclaude +npx superclaude --help +``` +- Installs SuperClaude wrapper inside your project. +- Use `npx` to run it locally. +- Also requires publishing to npmjs.org. + +### Option E: From GitHub (Works without npm publish) +```bash +# Global install directly from GitHub +yarn global add github:SuperClaude-Org/SuperClaude_Framework +# or +npm install -g github:SuperClaude-Org/SuperClaude_Framework + +superclaude --help +``` +```bash +# Local project install from GitHub +npm install github:SuperClaude-Org/SuperClaude_Framework +npx superclaude --help +``` +- Works immediately without publishing to npm registry. + +- Runs SuperClaude instantly. +- First run may install Python package via pip. +- Subsequent runs skip reinstallation unless explicitly updated. + +--- **What you just got:** - ✅ 21 intelligent commands that auto-activate specialized capabilities @@ -479,4 +517,4 @@ Thanks for trying SuperClaude! We hope it makes your development workflow smooth --- -*Last updated: August 2025 - Let us know if anything in this guide is wrong or confusing!* \ No newline at end of file +*Last updated: August 2025 - Let us know if anything in this guide is wrong or confusing!* diff --git a/README.md b/README.md index 7e494ca..716c3f5 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,28 @@ git clone https://github.com/SuperClaude-Org/SuperClaude_Framework.git cd SuperClaude_Framework pip install -e . ``` +**Option C: From npm (Global, requires publish this method won't works for now)** +```bash +npm install -g superclaude +superclaude --help +``` + +**Option D: From npm (Local Project, requires publish this method won't works for now)** +```bash +npm install superclaude +npx superclaude --help +``` + +**Option E: From GitHub (Works now, no publish needed)** +```bash +# Global +npm install -g github:SuperClaude-Org/SuperClaude_Framework#SuperClaude_V4_Beta +superclaude --help + +# Local +npm install github:SuperClaude-Org/SuperClaude_Framework#SuperClaude_V4_Beta +npx superclaude --help +``` --- **Missing Python?** Install Python 3.8+ first: @@ -413,4 +435,4 @@ MIT - [See LICENSE file for details](https://opensource.org/licenses/MIT) *v4.0.0: The future of AI-assisted development is here. Experience intelligent, adaptive, and powerful development workflows! 🚀* ---- \ No newline at end of file +--- diff --git a/bin/checkEnv.js b/bin/checkEnv.js new file mode 100644 index 0000000..ab75c06 --- /dev/null +++ b/bin/checkEnv.js @@ -0,0 +1,36 @@ +const { spawnSync } = require("child_process"); + +function run(cmd, args = [], opts = {}) { + return spawnSync(cmd, args, { + stdio: opts.stdio || "pipe", + shell: true + }); +} + +function checkCommand(cmd, args = ["--version"]) { + const result = run(cmd, args); + return result.status === 0; +} + +function detectPython() { + const candidates = ["python3", "python", "py"]; + for (let c of candidates) { + if (checkCommand(c)) return c; + } + return null; +} + +function detectPip() { + const candidates = ["pip3", "pip", "py -m pip"]; + for (let c of candidates) { + if (checkCommand(c.split(" ")[0])) return c; + } + return null; +} + +function isSuperClaudeInstalled(pipCmd) { + const result = run(pipCmd, ["show", "SuperClaude"]); + return result.status === 0; +} + +module.exports = { run, detectPython, detectPip, isSuperClaudeInstalled }; diff --git a/bin/cli.js b/bin/cli.js new file mode 100644 index 0000000..854bd25 --- /dev/null +++ b/bin/cli.js @@ -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); + 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."); + } diff --git a/bin/update.js b/bin/update.js new file mode 100644 index 0000000..e1381c7 --- /dev/null +++ b/bin/update.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node +const { run, detectPip } = require("./checkEnv"); + +let pipCmd = detectPip(); +if (!pipCmd) { + console.error("❌ pip not found, cannot update."); + process.exit(1); +} + +console.log("🔄 Updating SuperClaude from PyPI..."); +const result = run(pipCmd, ["install", "--upgrade", "SuperClaude"], { stdio: "inherit" }); +if (result.status !== 0) { + console.error("❌ Update failed."); + process.exit(1); +} +console.log("✅ SuperClaude updated successfully!"); + diff --git a/package.json b/package.json new file mode 100644 index 0000000..355af42 --- /dev/null +++ b/package.json @@ -0,0 +1,65 @@ +{ + "name": "superclaude", + "version": "4.0.0", + "description": "SuperClaude official npm wrapper for the Python package (PyPI: SuperClaude). Run with npx superclaude anywhere!", + "bin": { + "superclaude": "./bin/cli.js" + }, + "scripts": { + "postinstall": "node ./bin/install.js", + "update": "node ./bin/update.js", + "lint": "eslint . --ext .js,.mjs,.cjs", + "test": "echo \"No tests defined yet\" && exit 0" + }, + "files": [ + "bin/", + "README.md", + "LICENSE" + ], + "author": { + "name": "SuperClaude Org", + "url": "https://github.com/SuperClaude-Org" + }, + + "repository": { + "type": "git", + "url": "git+https://github.com/SuperClaude-Org/SuperClaude_Framework.git" + }, + "bugs": { + "url": "https://github.com/SuperClaude-Org/SuperClaude_Framework/issues" + }, + "homepage": "https://github.com/SuperClaude-Org/SuperClaude_Framework#readme", + "license": "MIT", + "keywords": [ + "superclaude", + "ai", + "cli", + "pypi", + "python", + "wrapper", + "cross-platform", + "automation" + ], + "engines": { + "node": ">=16" + }, + "os": [ + "darwin", + "linux", + "win32" + ], + "cpu": [ + "x64", + "arm64" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/SuperClaude-Org" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "preferGlobal": true, + "type": "commonjs" +} diff --git a/pyproject.toml b/pyproject.toml index aed2150..198c297 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "SuperClaude" -version = "4.0.0b1" +version = "4.0.0" authors = [ {name = "NomenAK", email = "anton.knoery@gmail.com"}, - {name = "Mithun Gowda B"} + {name = "Mithun Gowda B", email = "mithungowda.b7411@gmail.com"} ] description = "SuperClaude Framework Management Hub - AI-enhanced development framework for Claude Code" readme = "README.md" @@ -134,4 +134,4 @@ exclude_lines = [ "if 0:", "if __name__ == .__main__.:" ] -show_missing = true \ No newline at end of file +show_missing = true