@layr-labs/ecloud-cli 0.3.4 → 0.4.0-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.
- package/VERSION +2 -2
- package/dist/commands/auth/whoami.js +1 -0
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/cancel.js +8 -7
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +20 -19
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +13 -12
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/compute/app/create.js +1 -0
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +50 -21
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +32 -31
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +31 -30
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +2 -1
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +6 -5
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +18 -17
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +6 -5
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +6 -5
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +6 -5
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +51 -22
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +16 -15
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +13 -12
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +4 -3
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +9 -8
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +16 -15
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +10 -9
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/set.js +1 -0
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/undelegate.js +6 -5
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/package.json +2 -2
|
@@ -15,6 +15,7 @@ import { getBuildType as getBuildType2 } from "@layr-labs/ecloud-sdk";
|
|
|
15
15
|
|
|
16
16
|
// src/utils/prompts.ts
|
|
17
17
|
import { input, select, password, confirm as inquirerConfirm } from "@inquirer/prompts";
|
|
18
|
+
import chalk from "chalk";
|
|
18
19
|
import fs3 from "fs";
|
|
19
20
|
import path3 from "path";
|
|
20
21
|
import os3 from "os";
|
|
@@ -219,7 +220,7 @@ function listApps(environment) {
|
|
|
219
220
|
|
|
220
221
|
// src/utils/version.ts
|
|
221
222
|
function getCliVersion() {
|
|
222
|
-
return true ? "0.
|
|
223
|
+
return true ? "0.4.0-dev" : "0.0.0";
|
|
223
224
|
}
|
|
224
225
|
function getClientId() {
|
|
225
226
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -659,7 +660,7 @@ async function validateCommonFlags(flags, options) {
|
|
|
659
660
|
}
|
|
660
661
|
|
|
661
662
|
// src/utils/format.ts
|
|
662
|
-
import
|
|
663
|
+
import chalk2 from "chalk";
|
|
663
664
|
function formatBytes(bytes) {
|
|
664
665
|
if (bytes === 0) return "0 B";
|
|
665
666
|
const k = 1024;
|
|
@@ -671,38 +672,38 @@ function formatStatus(status) {
|
|
|
671
672
|
switch (status.toLowerCase()) {
|
|
672
673
|
case "running":
|
|
673
674
|
case "started":
|
|
674
|
-
return
|
|
675
|
+
return chalk2.green(status);
|
|
675
676
|
case "stopped":
|
|
676
|
-
return
|
|
677
|
+
return chalk2.yellow(status);
|
|
677
678
|
case "terminated":
|
|
678
|
-
return
|
|
679
|
+
return chalk2.red(status);
|
|
679
680
|
case "suspended":
|
|
680
|
-
return
|
|
681
|
+
return chalk2.red(status);
|
|
681
682
|
case "deploying":
|
|
682
683
|
case "upgrading":
|
|
683
684
|
case "resuming":
|
|
684
685
|
case "stopping":
|
|
685
|
-
return
|
|
686
|
+
return chalk2.cyan(status);
|
|
686
687
|
case "failed":
|
|
687
|
-
return
|
|
688
|
+
return chalk2.red(status);
|
|
688
689
|
default:
|
|
689
|
-
return
|
|
690
|
+
return chalk2.gray(status);
|
|
690
691
|
}
|
|
691
692
|
}
|
|
692
693
|
function formatAppDisplay2(options) {
|
|
693
694
|
const { appInfo, appName, status, releaseTimestamp, showProfileDetails = false } = options;
|
|
694
695
|
const displayName = appName || appInfo.profile?.name;
|
|
695
|
-
const name = displayName ?
|
|
696
|
-
const id =
|
|
697
|
-
const releaseTime = releaseTimestamp ?
|
|
696
|
+
const name = displayName ? chalk2.cyan(displayName) : chalk2.gray("(unnamed)");
|
|
697
|
+
const id = chalk2.gray(appInfo.address);
|
|
698
|
+
const releaseTime = releaseTimestamp ? chalk2.gray(new Date(releaseTimestamp * 1e3).toISOString().replace("T", " ").slice(0, 19)) : chalk2.gray("-");
|
|
698
699
|
const statusStr = status || appInfo.status;
|
|
699
700
|
const formattedStatus = formatStatus(statusStr);
|
|
700
|
-
const instance = appInfo.machineType && appInfo.machineType !== "No instance assigned" ?
|
|
701
|
-
const ip = appInfo.ip && appInfo.ip !== "No IP assigned" ?
|
|
701
|
+
const instance = appInfo.machineType && appInfo.machineType !== "No instance assigned" ? chalk2.gray(appInfo.machineType) : chalk2.gray("-");
|
|
702
|
+
const ip = appInfo.ip && appInfo.ip !== "No IP assigned" ? chalk2.white(appInfo.ip) : chalk2.gray("No IP assigned");
|
|
702
703
|
const metrics = appInfo.metrics;
|
|
703
|
-
const cpu = metrics?.cpu_utilization_percent !== void 0 ?
|
|
704
|
-
const memory = metrics?.memory_utilization_percent !== void 0 ?
|
|
705
|
-
const memoryUsage = metrics?.memory_used_bytes !== void 0 && metrics?.memory_total_bytes !== void 0 ?
|
|
704
|
+
const cpu = metrics?.cpu_utilization_percent !== void 0 ? chalk2.white(`${metrics.cpu_utilization_percent.toFixed(1)}%`) : chalk2.gray("-");
|
|
705
|
+
const memory = metrics?.memory_utilization_percent !== void 0 ? chalk2.white(`${metrics.memory_utilization_percent.toFixed(1)}%`) : chalk2.gray("-");
|
|
706
|
+
const memoryUsage = metrics?.memory_used_bytes !== void 0 && metrics?.memory_total_bytes !== void 0 ? chalk2.gray(
|
|
706
707
|
`(${formatBytes(metrics.memory_used_bytes)} / ${formatBytes(metrics.memory_total_bytes)})`
|
|
707
708
|
) : "";
|
|
708
709
|
const evmAddresses = (appInfo.evmAddresses || []).map((addr) => ({
|
|
@@ -753,33 +754,33 @@ function printAppDisplay(display, log, indent = " ", options = {}) {
|
|
|
753
754
|
for (let i = 0; i < addrs.length; i++) {
|
|
754
755
|
const addr = addrs[i];
|
|
755
756
|
const label = i === 0 ? "EVM Address:" : " ";
|
|
756
|
-
log(`${indent}${label} ${
|
|
757
|
+
log(`${indent}${label} ${chalk2.gray(`${addr.address} (path: ${addr.path})`)}`);
|
|
757
758
|
}
|
|
758
759
|
} else {
|
|
759
|
-
log(`${indent}EVM Address: ${
|
|
760
|
+
log(`${indent}EVM Address: ${chalk2.gray("-")}`);
|
|
760
761
|
}
|
|
761
762
|
if (display.solanaAddresses.length > 0) {
|
|
762
763
|
const addrs = singleAddress ? display.solanaAddresses.slice(0, 1) : display.solanaAddresses;
|
|
763
764
|
for (let i = 0; i < addrs.length; i++) {
|
|
764
765
|
const addr = addrs[i];
|
|
765
766
|
const label = i === 0 ? "Solana Address:" : " ";
|
|
766
|
-
log(`${indent}${label} ${
|
|
767
|
+
log(`${indent}${label} ${chalk2.gray(`${addr.address} (path: ${addr.path})`)}`);
|
|
767
768
|
}
|
|
768
769
|
} else {
|
|
769
|
-
log(`${indent}Solana Address: ${
|
|
770
|
+
log(`${indent}Solana Address: ${chalk2.gray("-")}`);
|
|
770
771
|
}
|
|
771
772
|
if (showProfile && display.profile) {
|
|
772
773
|
log(
|
|
773
|
-
|
|
774
|
+
chalk2.gray(`${indent}\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`)
|
|
774
775
|
);
|
|
775
776
|
if (display.profile.website) {
|
|
776
|
-
log(`${indent}Website: ${
|
|
777
|
+
log(`${indent}Website: ${chalk2.gray(display.profile.website)}`);
|
|
777
778
|
}
|
|
778
779
|
if (display.profile.description) {
|
|
779
|
-
log(`${indent}Description: ${
|
|
780
|
+
log(`${indent}Description: ${chalk2.gray(display.profile.description)}`);
|
|
780
781
|
}
|
|
781
782
|
if (display.profile.xURL) {
|
|
782
|
-
log(`${indent}X (Twitter): ${
|
|
783
|
+
log(`${indent}X (Twitter): ${chalk2.gray(display.profile.xURL)}`);
|
|
783
784
|
}
|
|
784
785
|
}
|
|
785
786
|
}
|
|
@@ -796,7 +797,7 @@ function getDashboardUrl(environment, appAddress) {
|
|
|
796
797
|
}
|
|
797
798
|
|
|
798
799
|
// src/commands/compute/app/info.ts
|
|
799
|
-
import
|
|
800
|
+
import chalk3 from "chalk";
|
|
800
801
|
var AppInfo2 = class _AppInfo extends Command {
|
|
801
802
|
static description = "Show detailed information for a specific app";
|
|
802
803
|
static args = {
|
|
@@ -888,9 +889,9 @@ var AppInfo2 = class _AppInfo extends Command {
|
|
|
888
889
|
const appResponse = await userApiClient.getApp(appID);
|
|
889
890
|
const latestRelease = appResponse.releases?.[0];
|
|
890
891
|
if (latestRelease?.build?.provenanceSignature) {
|
|
891
|
-
verifiabilityStatus =
|
|
892
|
+
verifiabilityStatus = chalk3.green("Verifiable \u2713");
|
|
892
893
|
} else {
|
|
893
|
-
verifiabilityStatus =
|
|
894
|
+
verifiabilityStatus = chalk3.yellow(
|
|
894
895
|
"(dev image, not built verifiably, we strongly recommend verifiable builds for production)"
|
|
895
896
|
);
|
|
896
897
|
}
|
|
@@ -907,7 +908,7 @@ var AppInfo2 = class _AppInfo extends Command {
|
|
|
907
908
|
});
|
|
908
909
|
console.log();
|
|
909
910
|
const appName = appInfo.profile?.name;
|
|
910
|
-
const nameDisplay = appName ?
|
|
911
|
+
const nameDisplay = appName ? chalk3.cyan.bold(appName) : chalk3.gray("(unnamed)");
|
|
911
912
|
this.log(`App: ${nameDisplay}`);
|
|
912
913
|
printAppDisplay(display, this.log.bind(this), " ", {
|
|
913
914
|
singleAddress: false,
|
|
@@ -917,7 +918,7 @@ var AppInfo2 = class _AppInfo extends Command {
|
|
|
917
918
|
this.log(` Build: ${verifiabilityStatus}`);
|
|
918
919
|
}
|
|
919
920
|
const dashboardUrl = getDashboardUrl(environmentConfig.name, appID);
|
|
920
|
-
this.log(` Dashboard: ${
|
|
921
|
+
this.log(` Dashboard: ${chalk3.blue.underline(dashboardUrl)}`);
|
|
921
922
|
console.log();
|
|
922
923
|
}
|
|
923
924
|
async watchMode(appID, userApiClient, publicClient, environmentConfig, addressCount) {
|
|
@@ -945,7 +946,7 @@ var AppInfo2 = class _AppInfo extends Command {
|
|
|
945
946
|
};
|
|
946
947
|
async function showCountdown(seconds) {
|
|
947
948
|
for (let i = seconds; i >= 0; i--) {
|
|
948
|
-
process.stdout.write(
|
|
949
|
+
process.stdout.write(chalk3.gray(`\rRefreshing in ${i}...`));
|
|
949
950
|
if (i > 0) {
|
|
950
951
|
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
951
952
|
}
|