@envsave/cli 1.0.39 → 1.0.41

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.
Files changed (2) hide show
  1. package/dist/cli.js +90 -14
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -259,6 +259,7 @@ __export(exports_vault, {
259
259
  showSecret: () => showSecret,
260
260
  setSecret: () => setSecret,
261
261
  searchKeys: () => searchKeys,
262
+ revealKeysByPattern: () => revealKeysByPattern,
262
263
  revealKey: () => revealKey,
263
264
  listKeys: () => listKeys,
264
265
  initVault: () => initVault,
@@ -573,6 +574,22 @@ function revealKey(cleanName, password) {
573
574
  const opaque = computeOpaqueName(vault.hmacSeed, cleanName, sshKeyContent);
574
575
  return opaque in vault.secrets ? opaque : undefined;
575
576
  }
577
+ function revealKeysByPattern(patterns, password) {
578
+ const vault = readMainVault(password);
579
+ const sshKeyContent = loadSshKey(vault);
580
+ writeSessionCache(vault.secrets, vault.registry);
581
+ return patterns.map((pattern) => {
582
+ const lower = pattern.toLowerCase();
583
+ const matchingNames = vault.registry.filter((k) => k.toLowerCase().includes(lower));
584
+ return {
585
+ pattern,
586
+ matches: matchingNames.map((name) => ({
587
+ name,
588
+ opaque: computeOpaqueName(vault.hmacSeed, name, sshKeyContent)
589
+ }))
590
+ };
591
+ });
592
+ }
576
593
  function getSecretFromCache(opaqueKey) {
577
594
  checkRateLimit();
578
595
  const cache = readSessionCache();
@@ -857,6 +874,57 @@ import { spawnSync } from "node:child_process";
857
874
  import { createHash } from "node:crypto";
858
875
  import { join as join4 } from "node:path";
859
876
  import { homedir as homedir3 } from "node:os";
877
+ // package.json
878
+ var package_default = {
879
+ name: "@envsave/cli",
880
+ version: "1.0.41",
881
+ description: "Local secret vault for LLM-safe environments — encrypted secrets that agents can't bulk-discover",
882
+ type: "module",
883
+ main: "dist/index.js",
884
+ types: "dist/index.d.ts",
885
+ bin: {
886
+ envsave: "dist/cli.js"
887
+ },
888
+ files: [
889
+ "dist",
890
+ "python"
891
+ ],
892
+ scripts: {
893
+ prebuild: `bun -e "const p=require('./package.json');const v=p.version.split('.');v[2]=+v[2]+1;p.version=v.join('.');require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')"`,
894
+ build: "bun build src/cli.ts --outdir dist --target node --format esm && bun build src/index.ts --outdir dist --target node --format esm --outfile dist/index.js",
895
+ dev: "bun run src/cli.ts",
896
+ webapp: "bun run webapp/server.ts",
897
+ "lint:claude": "claude -p 'you are a linter. please look at the changes vs. main and report any issues related to typos. report the filename and line number on one line, and a description of the issue on the second line. do not return any other text.'"
898
+ },
899
+ devDependencies: {
900
+ "@types/bun": "latest",
901
+ "@types/node": "^25.5.0"
902
+ },
903
+ peerDependencies: {
904
+ typescript: "^5"
905
+ },
906
+ keywords: [
907
+ "vault",
908
+ "secrets",
909
+ "encryption",
910
+ "llm",
911
+ "security",
912
+ "env"
913
+ ],
914
+ license: "MIT",
915
+ repository: {
916
+ type: "git",
917
+ url: "git+https://github.com/jcsancho/envsave.git"
918
+ },
919
+ homepage: "https://api.envsave.com",
920
+ author: "Jose C Sancho",
921
+ dependencies: {
922
+ "@clerk/backend": "^3.2.1",
923
+ "@supabase/supabase-js": "^2.99.2"
924
+ }
925
+ };
926
+
927
+ // src/cli.ts
860
928
  var args = process.argv.slice(2);
861
929
  var command = args[0];
862
930
  function checkEnvFiles() {
@@ -893,7 +961,7 @@ Usage:
893
961
  envsave set <key> <value> Add/update a secret (outputs opaque key)
894
962
  envsave get <opaque_key> Retrieve a value (no password needed)
895
963
  envsave show <key> Show real value by key name (password required)
896
- envsave reveal <key> [key2] [key3]... Show opaque key name(s) (password required)
964
+ envsave reveal <keyword> [keyword2]... Show opaque key(s) for any name matching keyword (password required)
897
965
  envsave delete <key> Remove a secret (password required)
898
966
  envsave search <keyword> Search keys matching keyword (no password)
899
967
  envsave scan [dir] Scan project for env variable usage
@@ -981,6 +1049,10 @@ async function main() {
981
1049
  checkEnvFiles();
982
1050
  return;
983
1051
  }
1052
+ if (command === "--version" || command === "-v" || command === "version") {
1053
+ console.log(package_default.version);
1054
+ return;
1055
+ }
984
1056
  switch (command) {
985
1057
  case "activate": {
986
1058
  const token = args[1];
@@ -1052,27 +1124,31 @@ Use 'envsave reveal <KEY>' to get the opaque key for each secret.`);
1052
1124
  break;
1053
1125
  }
1054
1126
  case "reveal": {
1055
- const keys = args.slice(1);
1056
- if (keys.length === 0) {
1057
- console.error("Usage: envsave reveal <key> [key2] [key3]...");
1127
+ const patterns = args.slice(1);
1128
+ if (patterns.length === 0) {
1129
+ console.error("Usage: envsave reveal <keyword> [keyword2]...");
1058
1130
  process.exit(1);
1059
1131
  }
1060
1132
  const password = await requirePassword();
1061
- let notFound = 0;
1062
- for (const key of keys) {
1063
- const opaque = revealKey(key, password);
1064
- if (opaque) {
1133
+ const results = revealKeysByPattern(patterns, password);
1134
+ let totalMatches = 0;
1135
+ let notFoundPatterns = 0;
1136
+ for (const { pattern, matches } of results) {
1137
+ if (matches.length === 0) {
1138
+ console.error(`No keys matching '${pattern}'.`);
1139
+ notFoundPatterns++;
1140
+ continue;
1141
+ }
1142
+ for (const { name, opaque } of matches) {
1065
1143
  console.log(`
1066
- ${key} → ${opaque}`);
1144
+ ${name} → ${opaque}`);
1067
1145
  console.log(` envsave.get("${opaque}")`);
1068
- } else {
1069
- console.error(`Secret '${key}' not found.`);
1070
- notFound++;
1146
+ totalMatches++;
1071
1147
  }
1072
1148
  }
1073
- if (keys.length > 1 && notFound === 0)
1149
+ if (totalMatches > 0)
1074
1150
  console.log();
1075
- if (notFound > 0 && notFound === keys.length)
1151
+ if (notFoundPatterns === patterns.length)
1076
1152
  process.exit(1);
1077
1153
  break;
1078
1154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envsave/cli",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Local secret vault for LLM-safe environments — encrypted secrets that agents can't bulk-discover",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",