@murk-security/cli 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/murk.mjs +10 -3
- package/package.json +1 -1
package/murk.mjs
CHANGED
|
@@ -21,8 +21,8 @@ import os from 'node:os';
|
|
|
21
21
|
import path from 'node:path';
|
|
22
22
|
import { randomBytes } from 'node:crypto';
|
|
23
23
|
import { spawn } from 'node:child_process';
|
|
24
|
-
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
25
|
-
import {
|
|
24
|
+
import { mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
|
|
25
|
+
import { fileURLToPath } from 'node:url';
|
|
26
26
|
|
|
27
27
|
// Default to the hosted MURK service; devs point these at a local control-plane/dashboard.
|
|
28
28
|
const API_URL = (process.env.MURK_API_URL ?? 'https://api.murk.sh').replace(/\/$/, '');
|
|
@@ -313,4 +313,11 @@ function main() {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
// Run the CLI only when executed directly, not when imported (e.g. by the test suite).
|
|
316
|
-
|
|
316
|
+
// Compare realpaths so a bin symlink (node_modules/.bin/murk -> murk.mjs, as npx installs it)
|
|
317
|
+
// still counts as direct execution — a plain href compare misses the symlink and no-ops.
|
|
318
|
+
function isEntrypoint() {
|
|
319
|
+
const arg = process.argv[1];
|
|
320
|
+
if (!arg) return false;
|
|
321
|
+
try { return realpathSync(arg) === realpathSync(fileURLToPath(import.meta.url)); } catch { return false; }
|
|
322
|
+
}
|
|
323
|
+
if (isEntrypoint()) main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@murk-security/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Run MURK's MCP server for your AI agent and scan locally-running apps with MURK's hosted runner over a secure outbound tunnel — no local runner, no model key.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|