+49
-1
@@ -7,2 +7,3 @@ #!/usr/bin/env node | ||
| const pkg = require(path.join(__dirname, "..", "package.json")); | ||
| const binaryOverride = process.env.SETTLEKIT_CLI_BINARY; | ||
@@ -21,5 +22,13 @@ const binaryName = process.platform === "win32" ? "settle.exe" : "settle"; | ||
| maybeWarnForStalePackage(); | ||
| const env = { | ||
| ...process.env, | ||
| SETTLEKIT_NPM_PACKAGE_VERSION: process.env.SETTLEKIT_NPM_PACKAGE_VERSION || pkg.version, | ||
| SETTLEKIT_NPM_PACKAGE_ROOT: process.env.SETTLEKIT_NPM_PACKAGE_ROOT || path.join(__dirname, ".."), | ||
| }; | ||
| const result = spawnSync(binaryPath, process.argv.slice(2), { | ||
| stdio: "inherit", | ||
| env: process.env, | ||
| env, | ||
| }); | ||
@@ -33,1 +42,40 @@ | ||
| process.exit(result.status ?? 0); | ||
| function maybeWarnForStalePackage() { | ||
| if (process.env.SETTLEKIT_SKIP_VERSION_CHECK === "1") { | ||
| return; | ||
| } | ||
| const command = process.argv[2] || ""; | ||
| const shouldCheck = new Set(["deploy", "recipes", "quickstart", "doctor", "version", "--version", "-v"]); | ||
| if (!shouldCheck.has(command)) { | ||
| return; | ||
| } | ||
| const npm = process.platform === "win32" ? "npm.cmd" : "npm"; | ||
| const result = spawnSync(npm, ["view", "settlekit", "version", "--silent"], { | ||
| encoding: "utf8", | ||
| timeout: 2500, | ||
| stdio: ["ignore", "pipe", "ignore"], | ||
| }); | ||
| if (result.error || result.status !== 0) { | ||
| return; | ||
| } | ||
| const latest = String(result.stdout || "").trim().split(/\s+/)[0]; | ||
| if (!latest || compareVersions(pkg.version, latest) >= 0) { | ||
| return; | ||
| } | ||
| console.error(`settle: warning: npm package settlekit@${pkg.version} is older than latest ${latest}.`); | ||
| console.error("settle: for agent/bootstrap flows, run `npm install settlekit@latest` and use `./node_modules/.bin/settle`."); | ||
| } | ||
| function compareVersions(left, right) { | ||
| const a = String(left || "").split(".").map((part) => parseInt(part, 10) || 0); | ||
| const b = String(right || "").split(".").map((part) => parseInt(part, 10) || 0); | ||
| const n = Math.max(a.length, b.length); | ||
| for (let i = 0; i < n; i++) { | ||
| const diff = (a[i] || 0) - (b[i] || 0); | ||
| if (diff !== 0) { | ||
| return diff; | ||
| } | ||
| } | ||
| return 0; | ||
| } |
+1
-1
| { | ||
| "name": "settlekit", | ||
| "version": "0.1.28", | ||
| "version": "0.1.29", | ||
| "description": "SettleKit CLI", | ||
@@ -5,0 +5,0 @@ "license": "UNLICENSED", |
+19
-6
@@ -7,4 +7,15 @@ # SettleKit CLI | ||
| For AI agents, clean terminals, and project-specific deploys, prefer a project-local latest install. This avoids stale global `settle` binaries: | ||
| ```bash | ||
| npm install settlekit@latest | ||
| ./node_modules/.bin/settle doctor --require-latest | ||
| ./node_modules/.bin/settle recipes | ||
| ``` | ||
| Global install is also supported for interactive use: | ||
| ```bash | ||
| npm install -g settlekit | ||
| settle doctor | ||
| ``` | ||
@@ -23,4 +34,4 @@ | ||
| ```bash | ||
| npm install settlekit | ||
| npx settlekit help | ||
| npm install settlekit@latest | ||
| ./node_modules/.bin/settle help | ||
| ``` | ||
@@ -56,5 +67,7 @@ | ||
| ```bash | ||
| settle recipes | ||
| settle search "build app with login database api command" | ||
| settle services show app-project-backends --json | ||
| npm install settlekit@latest | ||
| ./node_modules/.bin/settle doctor --require-latest | ||
| ./node_modules/.bin/settle recipes | ||
| ./node_modules/.bin/settle search "build app with login database api command" | ||
| ./node_modules/.bin/settle services show app-project-backends --json | ||
| ``` | ||
@@ -141,3 +154,3 @@ | ||
| ```bash | ||
| settle deploy ./my-next-app --name my-next-app --full-stack --wait --json | ||
| ./node_modules/.bin/settle deploy ./my-next-app --name my-next-app --full-stack --wait --json | ||
| ``` | ||
@@ -144,0 +157,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
63157488
8.8%307
16.73%178
7.88%23
21.05%