keymap-cli 0.1.0 → 0.1.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/dist/cli.js +14 -4
- package/package.json +3 -2
package/dist/cli.js
CHANGED
|
@@ -10679,9 +10679,6 @@ var {
|
|
|
10679
10679
|
Help
|
|
10680
10680
|
} = import_index.default;
|
|
10681
10681
|
|
|
10682
|
-
// src/cli.ts
|
|
10683
|
-
import { basename } from "path";
|
|
10684
|
-
|
|
10685
10682
|
// src/exec.ts
|
|
10686
10683
|
import { execFile } from "child_process";
|
|
10687
10684
|
import { accessSync, constants } from "fs";
|
|
@@ -11835,6 +11832,9 @@ function formatDoctor(rows) {
|
|
|
11835
11832
|
|
|
11836
11833
|
// src/cli.ts
|
|
11837
11834
|
import { readFile as readFile4 } from "fs/promises";
|
|
11835
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
11836
|
+
import { fileURLToPath } from "url";
|
|
11837
|
+
import { basename, dirname as dirname3, join as join4 } from "path";
|
|
11838
11838
|
|
|
11839
11839
|
// src/prompt.ts
|
|
11840
11840
|
import { createInterface } from "readline";
|
|
@@ -11929,8 +11929,18 @@ function parseSinkArg(arg) {
|
|
|
11929
11929
|
}
|
|
11930
11930
|
|
|
11931
11931
|
// src/cli.ts
|
|
11932
|
+
function pkgVersion() {
|
|
11933
|
+
const here = dirname3(fileURLToPath(import.meta.url));
|
|
11934
|
+
for (const rel of ["../package.json", "./package.json"]) {
|
|
11935
|
+
try {
|
|
11936
|
+
return JSON.parse(readFileSync2(join4(here, rel), "utf8")).version;
|
|
11937
|
+
} catch {
|
|
11938
|
+
}
|
|
11939
|
+
}
|
|
11940
|
+
return "0.0.0";
|
|
11941
|
+
}
|
|
11932
11942
|
var ctx = { exec: realExec, cwd: process.cwd() };
|
|
11933
|
-
var program2 = new Command().name("keymap").description("Values-free map of every secret you run, where it lives, and one command to rotate it everywhere.").version(
|
|
11943
|
+
var program2 = new Command().name("keymap").description("Values-free map of every secret you run, where it lives, and one command to rotate it everywhere.").version(pkgVersion());
|
|
11934
11944
|
program2.command("init").description("Discover secret names across sinks and write keymap.yaml (values are hashed in memory, never stored)").option("-p, --project <name>", "project name", basename(process.cwd())).option("-s, --sink <sink...>", `sinks to scan, e.g. local:.env github:owner/repo railway:api/production fly:myapp vercel:myproj/production+preview (supported: ${supportedSinks.join(", ")})`, ["local:.env"]).option("--all", "include config-looking names like PORT and NEXT_PUBLIC_*").option("--force", "overwrite an existing keymap.yaml").action(async (o) => {
|
|
11935
11945
|
const sinks = o.sink.map(parseSinkArg);
|
|
11936
11946
|
const r = await runInit({ project: o.project, sinks, all: o.all, force: o.force }, ctx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keymap-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Values-free map of every secret you run, where it lives, and one command to rotate it everywhere.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nekruz Kasimov",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"build": "tsup",
|
|
41
41
|
"dev": "tsx src/cli.ts",
|
|
42
42
|
"test": "vitest run",
|
|
43
|
-
"typecheck": "tsc --noEmit"
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"prepublishOnly": "npm run build && npm test"
|
|
44
45
|
},
|
|
45
46
|
"engines": {
|
|
46
47
|
"node": ">=20"
|