@suronai/cli 0.1.14 → 0.1.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suronai/cli",
3
- "version": "0.1.14",
3
+ "version": "0.1.17",
4
4
  "description": "CLI for Suron — suron login, init, whoami, rotate",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -11,7 +11,7 @@ const program = new Command();
11
11
  program
12
12
  .name("suron")
13
13
  .description("Secrets delivery with Telegram approval")
14
- .version("0.1.11");
14
+ .version("0.1.16");
15
15
 
16
16
  program.addCommand(loginCommand);
17
17
  program.addCommand(initCommand);
@@ -39,7 +39,10 @@ export function saveConfig(values) {
39
39
 
40
40
  /** @returns {string | null} */
41
41
  export function getApiUrl() {
42
- return process.env.SURON_API_URL?.replace(/\/$/, "") ?? readConfig().apiUrl ?? null;
42
+ // Strip trailing slash from both sources so callers always get a clean URL.
43
+ const fromEnv = process.env.SURON_API_URL?.replace(/\/$/, "");
44
+ const fromConfig = readConfig().apiUrl?.replace(/\/$/, "");
45
+ return fromEnv ?? fromConfig ?? null;
43
46
  }
44
47
 
45
48
  /** @returns {string} */
@@ -13,12 +13,13 @@ export function encryptDotenv(cwd) {
13
13
  if (!existsSync(join(cwd, ".env"))) {
14
14
  throw new Error(`.env not found in ${cwd}`);
15
15
  }
16
- // Strip DOTENV_PRIVATE_KEY from the child environment.
17
- // If dotenvx sees an existing key it reuses that keypair and skips
18
- // writing .env.keys, which breaks readPrivateKey() immediately after.
16
+ // Strip all dotenvx keypair vars from the child environment.
17
+ // If dotenvx sees DOTENV_PRIVATE_KEY *or* DOTENV_PUBLIC_KEY already set
18
+ // it reuses that keypair and skips writing .env.keys entirely, which
19
+ // breaks readPrivateKey() immediately after.
19
20
  const env = { ...process.env };
20
21
  for (const k of Object.keys(env)) {
21
- if (k.startsWith("DOTENV_PRIVATE_KEY")) delete env[k];
22
+ if (k.startsWith("DOTENV_PRIVATE_KEY") || k.startsWith("DOTENV_PUBLIC_KEY")) delete env[k];
22
23
  }
23
24
 
24
25
  try {