@layr-labs/ecloud-cli 0.4.1-dev → 0.4.2-dev

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.
@@ -220,7 +220,7 @@ function listApps(environment) {
220
220
 
221
221
  // src/utils/version.ts
222
222
  function getCliVersion() {
223
- return true ? "0.4.1-dev" : "0.0.0";
223
+ return true ? "0.4.2-dev" : "0.0.0";
224
224
  }
225
225
  function getClientId() {
226
226
  return `ecloud-cli/v${getCliVersion()}`;
@@ -199,7 +199,7 @@ function getAppName(environment, appID) {
199
199
 
200
200
  // src/utils/version.ts
201
201
  function getCliVersion() {
202
- return true ? "0.4.1-dev" : "0.0.0";
202
+ return true ? "0.4.2-dev" : "0.0.0";
203
203
  }
204
204
  function getClientId() {
205
205
  return `ecloud-cli/v${getCliVersion()}`;
@@ -246,7 +246,7 @@ function listApps(environment) {
246
246
 
247
247
  // src/utils/version.ts
248
248
  function getCliVersion() {
249
- return true ? "0.4.1-dev" : "0.0.0";
249
+ return true ? "0.4.2-dev" : "0.0.0";
250
250
  }
251
251
  function getClientId() {
252
252
  return `ecloud-cli/v${getCliVersion()}`;
@@ -286,7 +286,7 @@ function listApps(environment) {
286
286
 
287
287
  // src/utils/version.ts
288
288
  function getCliVersion() {
289
- return true ? "0.4.1-dev" : "0.0.0";
289
+ return true ? "0.4.2-dev" : "0.0.0";
290
290
  }
291
291
  function getClientId() {
292
292
  return `ecloud-cli/v${getCliVersion()}`;
@@ -237,7 +237,7 @@ function listApps(environment) {
237
237
 
238
238
  // src/utils/version.ts
239
239
  function getCliVersion() {
240
- return true ? "0.4.1-dev" : "0.0.0";
240
+ return true ? "0.4.2-dev" : "0.0.0";
241
241
  }
242
242
  function getClientId() {
243
243
  return `ecloud-cli/v${getCliVersion()}`;
@@ -245,7 +245,7 @@ function listApps(environment) {
245
245
 
246
246
  // src/utils/version.ts
247
247
  function getCliVersion() {
248
- return true ? "0.4.1-dev" : "0.0.0";
248
+ return true ? "0.4.2-dev" : "0.0.0";
249
249
  }
250
250
  function getClientId() {
251
251
  return `ecloud-cli/v${getCliVersion()}`;
@@ -245,7 +245,7 @@ function listApps(environment) {
245
245
 
246
246
  // src/utils/version.ts
247
247
  function getCliVersion() {
248
- return true ? "0.4.1-dev" : "0.0.0";
248
+ return true ? "0.4.2-dev" : "0.0.0";
249
249
  }
250
250
  function getClientId() {
251
251
  return `ecloud-cli/v${getCliVersion()}`;
@@ -245,7 +245,7 @@ function listApps(environment) {
245
245
 
246
246
  // src/utils/version.ts
247
247
  function getCliVersion() {
248
- return true ? "0.4.1-dev" : "0.0.0";
248
+ return true ? "0.4.2-dev" : "0.0.0";
249
249
  }
250
250
  function getClientId() {
251
251
  return `ecloud-cli/v${getCliVersion()}`;
@@ -312,7 +312,7 @@ function listApps(environment) {
312
312
 
313
313
  // src/utils/version.ts
314
314
  function getCliVersion() {
315
- return true ? "0.4.1-dev" : "0.0.0";
315
+ return true ? "0.4.2-dev" : "0.0.0";
316
316
  }
317
317
  function getClientId() {
318
318
  return `ecloud-cli/v${getCliVersion()}`;
@@ -1427,9 +1427,9 @@ function formatSourceLink(repoUrl, gitRef) {
1427
1427
  const url = new URL(normalizedRepo);
1428
1428
  const host = url.host.toLowerCase();
1429
1429
  if (host === "github.com") {
1430
- const path4 = url.pathname.replace(/\/+$/, "");
1431
- if (path4.split("/").filter(Boolean).length >= 2) {
1432
- return `https://github.com${path4}/tree/${gitRef}`;
1430
+ const path5 = url.pathname.replace(/\/+$/, "");
1431
+ if (path5.split("/").filter(Boolean).length >= 2) {
1432
+ return `https://github.com${path5}/tree/${gitRef}`;
1433
1433
  }
1434
1434
  }
1435
1435
  } catch {
@@ -1598,6 +1598,52 @@ function isTlsEnabledFromEnvFile(envFilePath) {
1598
1598
  return isTlsEnabledFromDomain(match[1]);
1599
1599
  }
1600
1600
 
1601
+ // src/utils/env.ts
1602
+ import * as fs5 from "fs";
1603
+ import * as os4 from "os";
1604
+ import * as path4 from "path";
1605
+ function parseInlineEnvVar(envVar) {
1606
+ const eqIndex = envVar.indexOf("=");
1607
+ if (eqIndex === -1) {
1608
+ throw new Error(`Invalid --env format: "${envVar}". Expected KEY=VALUE`);
1609
+ }
1610
+ const key = envVar.substring(0, eqIndex).trim();
1611
+ if (!key) {
1612
+ throw new Error(`Invalid --env format: "${envVar}". Key cannot be empty`);
1613
+ }
1614
+ const value = envVar.substring(eqIndex + 1);
1615
+ return [key, value];
1616
+ }
1617
+ function mergeInlineEnvVars(envFilePath, inlineEnvVars) {
1618
+ if (!inlineEnvVars || inlineEnvVars.length === 0) {
1619
+ return envFilePath;
1620
+ }
1621
+ const inlineEntries = inlineEnvVars.map(parseInlineEnvVar);
1622
+ let existingLines = [];
1623
+ if (envFilePath && fs5.existsSync(envFilePath)) {
1624
+ existingLines = fs5.readFileSync(envFilePath, "utf-8").split("\n");
1625
+ }
1626
+ const inlineKeys = new Set(inlineEntries.map(([key]) => key));
1627
+ const filteredLines = existingLines.filter((line) => {
1628
+ const trimmed = line.trim();
1629
+ if (!trimmed || trimmed.startsWith("#")) {
1630
+ return true;
1631
+ }
1632
+ const eqIndex = trimmed.indexOf("=");
1633
+ if (eqIndex === -1) {
1634
+ return true;
1635
+ }
1636
+ const key = trimmed.substring(0, eqIndex).trim();
1637
+ return !inlineKeys.has(key);
1638
+ });
1639
+ const inlineLines = inlineEntries.map(([key, value]) => `${key}=${value}`);
1640
+ const merged = [...filteredLines, ...inlineLines].join("\n");
1641
+ const tmpDir = fs5.mkdtempSync(path4.join(os4.tmpdir(), "ecloud-env-"));
1642
+ const tmpFile = path4.join(tmpDir, ".env");
1643
+ fs5.writeFileSync(tmpFile, merged);
1644
+ return tmpFile;
1645
+ }
1646
+
1601
1647
  // src/commands/compute/app/upgrade.ts
1602
1648
  var AppUpgrade = class _AppUpgrade extends Command {
1603
1649
  static description = "Upgrade existing deployment";
@@ -1625,6 +1671,11 @@ var AppUpgrade = class _AppUpgrade extends Command {
1625
1671
  default: ".env",
1626
1672
  env: "ECLOUD_ENVFILE_PATH"
1627
1673
  }),
1674
+ env: Flags2.string({
1675
+ required: false,
1676
+ description: "Inline environment variable in KEY=VALUE format (can be specified multiple times)",
1677
+ multiple: true
1678
+ }),
1628
1679
  "log-visibility": Flags2.string({
1629
1680
  required: false,
1630
1681
  description: "Log visibility setting: public, private, or off",
@@ -1809,6 +1860,9 @@ var AppUpgrade = class _AppUpgrade extends Command {
1809
1860
  const buildFromDockerfile = dockerfilePath !== "";
1810
1861
  const imageRef = verifiableImageUrl ? verifiableImageUrl : await getImageReferenceInteractive(flags["image-ref"], buildFromDockerfile);
1811
1862
  envFilePath = envFilePath ?? await getEnvFileInteractive(flags["env-file"]);
1863
+ if (flags.env && flags.env.length > 0) {
1864
+ envFilePath = mergeInlineEnvVars(envFilePath, flags.env);
1865
+ }
1812
1866
  const { publicClient, walletClient, address } = createViemClients({
1813
1867
  privateKey,
1814
1868
  rpcUrl,