@risuko/cli
Advanced tools
+64
-1
| #!/usr/bin/env node | ||
| console.log("hello world (bootstrap placeholder for @risuko/cli)"); | ||
| const { execFileSync } = require("node:child_process"); | ||
| const { join } = require("node:path"); | ||
| const { platform, arch } = process; | ||
| const platformArchMap = { | ||
| darwin: { | ||
| arm64: ["@risuko/cli-darwin-arm64", "risuko"], | ||
| x64: ["@risuko/cli-darwin-x64", "risuko"], | ||
| }, | ||
| linux: { | ||
| arm64: ["@risuko/cli-linux-arm64-gnu", "risuko"], | ||
| x64: ["@risuko/cli-linux-x64-gnu", "risuko"], | ||
| }, | ||
| win32: { | ||
| arm64: ["@risuko/cli-win32-arm64-msvc", "risuko.exe"], | ||
| x64: ["@risuko/cli-win32-x64-msvc", "risuko.exe"], | ||
| }, | ||
| }; | ||
| function getBinaryPath() { | ||
| const platformPackages = platformArchMap[platform]; | ||
| if (!platformPackages) { | ||
| throw new Error(`Unsupported platform: ${platform}`); | ||
| } | ||
| const entry = platformPackages[arch]; | ||
| if (!entry) { | ||
| throw new Error(`Unsupported architecture: ${platform}-${arch}`); | ||
| } | ||
| const [packageName, binaryName] = entry; | ||
| try { | ||
| const packageDir = require.resolve(`${packageName}/package.json`); | ||
| return join(packageDir, "..", binaryName); | ||
| } catch { | ||
| // Fallback: try local npm/<platform-arch>/ directory (development) | ||
| const localPath = join(__dirname, "npm", `${platform}-${arch}`, binaryName); | ||
| if (require("node:fs").existsSync(localPath)) { | ||
| return localPath; | ||
| } | ||
| throw new Error( | ||
| `Failed to find binary for ${platform}-${arch}.\n` + | ||
| `Package ${packageName} is not installed.\n` + | ||
| `Run: npm install ${packageName}`, | ||
| ); | ||
| } | ||
| } | ||
| try { | ||
| const binaryPath = getBinaryPath(); | ||
| execFileSync(binaryPath, process.argv.slice(2), { | ||
| stdio: "inherit", | ||
| env: process.env, | ||
| }); | ||
| } catch (error) { | ||
| if (error.status !== undefined) { | ||
| process.exit(error.status); | ||
| } | ||
| console.error(error.message); | ||
| process.exit(1); | ||
| } |
+7
-7
| { | ||
| "name": "@risuko/cli", | ||
| "version": "0.0.0-bootstrap.0", | ||
| "version": "0.1.4", | ||
| "description": "Risuko download engine CLI — multi-protocol downloads (HTTP, BitTorrent, ED2K, M3U8, FTP/SFTP)", | ||
@@ -27,8 +27,8 @@ "license": "MIT", | ||
| "optionalDependencies": { | ||
| "@risuko/cli-darwin-arm64": "0.0.0-bootstrap.0", | ||
| "@risuko/cli-darwin-x64": "0.0.0-bootstrap.0", | ||
| "@risuko/cli-linux-x64-gnu": "0.0.0-bootstrap.0", | ||
| "@risuko/cli-linux-arm64-gnu": "0.0.0-bootstrap.0", | ||
| "@risuko/cli-win32-x64-msvc": "0.0.0-bootstrap.0", | ||
| "@risuko/cli-win32-arm64-msvc": "0.0.0-bootstrap.0" | ||
| "@risuko/cli-darwin-arm64": "0.1.4", | ||
| "@risuko/cli-darwin-x64": "0.1.4", | ||
| "@risuko/cli-linux-x64-gnu": "0.1.4", | ||
| "@risuko/cli-linux-arm64-gnu": "0.1.4", | ||
| "@risuko/cli-win32-x64-msvc": "0.1.4", | ||
| "@risuko/cli-win32-arm64-msvc": "0.1.4" | ||
| }, | ||
@@ -35,0 +35,0 @@ "engines": { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2488
152.33%57
2750%0
-100%2
Infinity%