mydata-cli
Advanced tools
+21
-2
@@ -8,3 +8,15 @@ #!/usr/bin/env node | ||
| import readmeCommand from "../commands/readme.js"; | ||
| import { readFileSync } from "fs"; | ||
| import path from "path"; | ||
| import { fileURLToPath } from "url"; | ||
| // Setup __dirname in ES module | ||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = path.dirname(__filename); | ||
| // Read version from package.json | ||
| const pkg = JSON.parse( | ||
| readFileSync(path.join(__dirname, "../package.json"), "utf-8") | ||
| ); | ||
| const program = new Command(); | ||
@@ -15,4 +27,12 @@ | ||
| .description("CLI to access Mydata Manager API") | ||
| .version("1.0.0"); | ||
| .version(pkg.version, "-v, --version", "Display CLI version"); // ✅ add -v alias | ||
| // Custom `version` command | ||
| program | ||
| .command("version") | ||
| .description("Show CLI version") | ||
| .action(() => { | ||
| console.log(`mycli version ${pkg.version}`); | ||
| }); | ||
| program.addCommand(loginCommand); | ||
@@ -24,3 +44,2 @@ program.addCommand(projectCommand); | ||
| program.parse(process.argv); |
+1
-1
| { | ||
| "name": "mydata-cli", | ||
| "version": "1.0.13", | ||
| "version": "1.0.14", | ||
| "description": "A CLI tool for interacting with MyData API and managing data. Supports login, data retrieval, and more. Built with Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
30107
2.04%816
2.13%11
10%