envpkt 0.7.0 → 0.7.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.
Files changed (2) hide show
  1. package/dist/cli.js +69 -0
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -2175,6 +2175,10 @@ const runEnvExport = (options) => {
2175
2175
  if (sourceMsg) console.error(sourceMsg);
2176
2176
  for (const warning of boot.warnings) console.error(`${YELLOW}Warning:${RESET} ${warning}`);
2177
2177
  for (const [key, value] of Object.entries(boot.envDefaults)) console.log(`export ${key}='${shellEscape(value)}'`);
2178
+ if (boot.overridden.length > 0) loadConfig(boot.configPath).fold(() => {}, (config) => {
2179
+ const envEntries = config.env ?? {};
2180
+ for (const key of boot.overridden) if (key in envEntries) console.log(`export ${key}='${shellEscape(envEntries[key].value)}'`);
2181
+ });
2178
2182
  for (const [key, value] of Object.entries(boot.secrets)) console.log(`export ${key}='${shellEscape(value)}'`);
2179
2183
  });
2180
2184
  };
@@ -3574,6 +3578,68 @@ const runShellHook = (shell) => {
3574
3578
  }
3575
3579
  };
3576
3580
 
3581
+ //#endregion
3582
+ //#region src/cli/commands/upgrade.ts
3583
+ const getCurrentVersion = () => {
3584
+ try {
3585
+ return execFileSync("npm", [
3586
+ "list",
3587
+ "-g",
3588
+ "envpkt",
3589
+ "--json"
3590
+ ], {
3591
+ encoding: "utf-8",
3592
+ stdio: [
3593
+ "pipe",
3594
+ "pipe",
3595
+ "pipe"
3596
+ ]
3597
+ }).match(/"envpkt":\s*\{\s*"version":\s*"([^"]+)"/)?.[1] ?? "unknown";
3598
+ } catch {
3599
+ return "unknown";
3600
+ }
3601
+ };
3602
+ const runUpgrade = () => {
3603
+ const before = getCurrentVersion();
3604
+ console.log(`${DIM}Current version: ${before}${RESET}`);
3605
+ console.log(`${CYAN}Upgrading envpkt...${RESET}\n`);
3606
+ try {
3607
+ execFileSync("npm", [
3608
+ "install",
3609
+ "-g",
3610
+ "envpkt@latest",
3611
+ "--prefer-online"
3612
+ ], {
3613
+ stdio: "inherit",
3614
+ encoding: "utf-8"
3615
+ });
3616
+ } catch {
3617
+ console.error(`\n${RED}Error:${RESET} npm install failed. Trying with cache clean...`);
3618
+ try {
3619
+ execFileSync("npm", [
3620
+ "cache",
3621
+ "clean",
3622
+ "--force"
3623
+ ], { stdio: "inherit" });
3624
+ execFileSync("npm", [
3625
+ "install",
3626
+ "-g",
3627
+ "envpkt@latest"
3628
+ ], {
3629
+ stdio: "inherit",
3630
+ encoding: "utf-8"
3631
+ });
3632
+ } catch {
3633
+ console.error(`${RED}Error:${RESET} Upgrade failed. Try manually:`);
3634
+ console.error(` ${BOLD}sudo npm install -g envpkt@latest --prefer-online${RESET}`);
3635
+ process.exit(1);
3636
+ }
3637
+ }
3638
+ const after = getCurrentVersion();
3639
+ if (before === after && before !== "unknown") console.log(`\n${GREEN}✓${RESET} Already on latest version ${BOLD}${after}${RESET}`);
3640
+ else console.log(`\n${GREEN}✓${RESET} Upgraded ${YELLOW}${before}${RESET} → ${BOLD}${after}${RESET}`);
3641
+ };
3642
+
3577
3643
  //#endregion
3578
3644
  //#region src/cli/index.ts
3579
3645
  const program = new Command();
@@ -3615,6 +3681,9 @@ program.command("mcp").description("Start the envpkt MCP server (stdio transport
3615
3681
  });
3616
3682
  registerSecretCommands(program);
3617
3683
  registerEnvCommands(program);
3684
+ program.command("upgrade").description("Upgrade envpkt to the latest version (npm install -g envpkt@latest)").action(() => {
3685
+ runUpgrade();
3686
+ });
3618
3687
  program.command("shell-hook").description("Output shell function for ambient credential warnings on cd — combine with env export for full setup").argument("<shell>", "Shell type: zsh | bash").action((shell) => {
3619
3688
  runShellHook(shell);
3620
3689
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envpkt",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Credential lifecycle and fleet management for AI agents",
5
5
  "keywords": [
6
6
  "credentials",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/node": "^24.12.0",
51
- "ts-builds": "^2.5.0",
51
+ "ts-builds": "^2.5.2",
52
52
  "tsdown": "^0.20.3",
53
53
  "tsx": "^4.21.0"
54
54
  },
@@ -70,5 +70,5 @@
70
70
  "schemas"
71
71
  ],
72
72
  "prettier": "ts-builds/prettier",
73
- "packageManager": "pnpm@10.30.3+sha512.c961d1e0a2d8e354ecaa5166b822516668b7f44cb5bd95122d590dd81922f606f5473b6d23ec4a5be05e7fcd18e8488d47d978bbe981872f1145d06e9a740017"
73
+ "packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be"
74
74
  }