@layr-labs/ecloud-cli 0.4.1 → 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.
Files changed (40) hide show
  1. package/VERSION +2 -2
  2. package/dist/commands/compute/app/deploy.js +58 -4
  3. package/dist/commands/compute/app/deploy.js.map +1 -1
  4. package/dist/commands/compute/app/info.js +1 -1
  5. package/dist/commands/compute/app/info.js.map +1 -1
  6. package/dist/commands/compute/app/list.js +1 -1
  7. package/dist/commands/compute/app/list.js.map +1 -1
  8. package/dist/commands/compute/app/logs.js +1 -1
  9. package/dist/commands/compute/app/logs.js.map +1 -1
  10. package/dist/commands/compute/app/profile/set.js +1 -1
  11. package/dist/commands/compute/app/profile/set.js.map +1 -1
  12. package/dist/commands/compute/app/releases.js +1 -1
  13. package/dist/commands/compute/app/releases.js.map +1 -1
  14. package/dist/commands/compute/app/start.js +1 -1
  15. package/dist/commands/compute/app/start.js.map +1 -1
  16. package/dist/commands/compute/app/stop.js +1 -1
  17. package/dist/commands/compute/app/stop.js.map +1 -1
  18. package/dist/commands/compute/app/terminate.js +1 -1
  19. package/dist/commands/compute/app/terminate.js.map +1 -1
  20. package/dist/commands/compute/app/upgrade.js +58 -4
  21. package/dist/commands/compute/app/upgrade.js.map +1 -1
  22. package/dist/commands/compute/build/info.js +1 -1
  23. package/dist/commands/compute/build/info.js.map +1 -1
  24. package/dist/commands/compute/build/list.js +1 -1
  25. package/dist/commands/compute/build/list.js.map +1 -1
  26. package/dist/commands/compute/build/logs.js +1 -1
  27. package/dist/commands/compute/build/logs.js.map +1 -1
  28. package/dist/commands/compute/build/status.js +1 -1
  29. package/dist/commands/compute/build/status.js.map +1 -1
  30. package/dist/commands/compute/build/submit.js +1 -1
  31. package/dist/commands/compute/build/submit.js.map +1 -1
  32. package/dist/commands/compute/build/verify.js +1 -1
  33. package/dist/commands/compute/build/verify.js.map +1 -1
  34. package/dist/commands/compute/undelegate.js +1 -1
  35. package/dist/commands/compute/undelegate.js.map +1 -1
  36. package/dist/hooks/init/__tests__/version-check.test.js +1 -1
  37. package/dist/hooks/init/__tests__/version-check.test.js.map +1 -1
  38. package/dist/hooks/init/version-check.js +1 -1
  39. package/dist/hooks/init/version-check.js.map +1 -1
  40. package/package.json +2 -2
@@ -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" : "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,