@layr-labs/ecloud-cli 0.4.3 → 0.5.0-dev.3
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/login.js +84 -54
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/migrate.js +66 -30
- package/dist/commands/auth/migrate.js.map +1 -1
- package/dist/commands/auth/whoami.js +0 -1
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/__tests__/status.test.js +11 -9
- package/dist/commands/billing/__tests__/status.test.js.map +1 -1
- package/dist/commands/billing/__tests__/subscribe.test.js +11 -9
- package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -1
- package/dist/commands/billing/__tests__/top-up.test.js +11 -9
- package/dist/commands/billing/__tests__/top-up.test.js.map +1 -1
- package/dist/commands/billing/cancel.js +11 -9
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +11 -9
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +11 -9
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/billing/top-up.js +11 -9
- package/dist/commands/billing/top-up.js.map +1 -1
- package/dist/commands/compute/app/configure/tls.js +138 -50
- package/dist/commands/compute/app/configure/tls.js.map +1 -1
- package/dist/commands/compute/app/create.js +0 -1
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +76 -29
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +17 -17
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +12 -10
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +17 -17
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +18 -17
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +17 -17
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +29 -20
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +29 -20
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +22 -17
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +115 -32
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +12 -10
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +12 -10
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +12 -10
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +12 -10
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +13 -10
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +12 -10
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/set.js +12 -11
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/undelegate.js +12 -10
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/dist/hooks/init/__tests__/version-check.test.js +1 -1
- package/dist/hooks/init/__tests__/version-check.test.js.map +1 -1
- package/dist/hooks/init/version-check.js +1 -1
- package/dist/hooks/init/version-check.js.map +1 -1
- package/package.json +26 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/commands/compute/app/stop.ts
|
|
4
|
-
import { Command, Args } from "@oclif/core";
|
|
4
|
+
import { Command, Args, Flags as Flags2 } from "@oclif/core";
|
|
5
5
|
|
|
6
6
|
// src/client.ts
|
|
7
7
|
import {
|
|
@@ -27,7 +27,6 @@ import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
|
27
27
|
import {
|
|
28
28
|
getEnvironmentConfig as getEnvironmentConfig2,
|
|
29
29
|
getAvailableEnvironments,
|
|
30
|
-
isEnvironmentAvailable,
|
|
31
30
|
getAllAppsByDeveloper as getAllAppsByDeveloper2,
|
|
32
31
|
getCategoryDescriptions,
|
|
33
32
|
fetchTemplateCatalog,
|
|
@@ -245,7 +244,7 @@ function listApps(environment) {
|
|
|
245
244
|
|
|
246
245
|
// src/utils/version.ts
|
|
247
246
|
function getCliVersion() {
|
|
248
|
-
return true ? "0.
|
|
247
|
+
return true ? "0.5.0-dev.3" : "0.0.0";
|
|
249
248
|
}
|
|
250
249
|
function getClientId() {
|
|
251
250
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -275,6 +274,13 @@ function addHexPrefix2(value) {
|
|
|
275
274
|
}
|
|
276
275
|
return `0x${value}`;
|
|
277
276
|
}
|
|
277
|
+
function ensureInteractive(missingFlagHint) {
|
|
278
|
+
if (!process.stdin.isTTY) {
|
|
279
|
+
throw new Error(
|
|
280
|
+
`Cannot prompt in non-interactive mode. Provide ${missingFlagHint} via CLI flags or environment variables.`
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
278
284
|
function getCurrentProjectPath() {
|
|
279
285
|
return process.env.INIT_CWD || process.cwd();
|
|
280
286
|
}
|
|
@@ -352,9 +358,10 @@ async function getOrPromptAppID(appIDOrOptions, environment) {
|
|
|
352
358
|
return addHexPrefix2(foundAppID);
|
|
353
359
|
}
|
|
354
360
|
throw new Error(
|
|
355
|
-
`App name '${options.appID}' not found in environment '${options.environment}'
|
|
361
|
+
`App name '${options.appID}' not found in environment '${options.environment}'. Name lookup uses a local cache that may be stale. Try using the app ID (0x...) directly, or run 'ecloud compute app list' to refresh the cache.`
|
|
356
362
|
);
|
|
357
363
|
}
|
|
364
|
+
ensureInteractive("app-id argument");
|
|
358
365
|
return getAppIDInteractive(options);
|
|
359
366
|
}
|
|
360
367
|
async function getAppIDInteractive(options) {
|
|
@@ -387,12 +394,9 @@ Select an app to ${action}:
|
|
|
387
394
|
let cachedProfiles = getProfileCache(environment);
|
|
388
395
|
if (!cachedProfiles) {
|
|
389
396
|
try {
|
|
390
|
-
const userApiClient = new UserApiClient2(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
publicClient,
|
|
394
|
-
{ clientId: getClientId() }
|
|
395
|
-
);
|
|
397
|
+
const userApiClient = new UserApiClient2(environmentConfig, walletClient, publicClient, {
|
|
398
|
+
clientId: getClientId()
|
|
399
|
+
});
|
|
396
400
|
const appInfos = await getAppInfosChunked(userApiClient, apps);
|
|
397
401
|
const freshProfiles = {};
|
|
398
402
|
for (const info of appInfos) {
|
|
@@ -584,6 +588,11 @@ async function confirm(prompt) {
|
|
|
584
588
|
return confirmWithDefault(prompt, false);
|
|
585
589
|
}
|
|
586
590
|
async function confirmWithDefault(prompt, defaultValue = false) {
|
|
591
|
+
if (!process.stdin.isTTY) {
|
|
592
|
+
throw new Error(
|
|
593
|
+
`Cannot confirm "${prompt}" in non-interactive mode. Use --force to skip confirmation prompts.`
|
|
594
|
+
);
|
|
595
|
+
}
|
|
587
596
|
return await inquirerConfirm({
|
|
588
597
|
message: prompt,
|
|
589
598
|
default: defaultValue
|
|
@@ -601,6 +610,7 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
601
610
|
if (result) {
|
|
602
611
|
return result.key;
|
|
603
612
|
}
|
|
613
|
+
ensureInteractive("--private-key or ECLOUD_PRIVATE_KEY");
|
|
604
614
|
const key = await password({
|
|
605
615
|
message: "Enter private key:",
|
|
606
616
|
mask: true,
|
|
@@ -618,15 +628,10 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
618
628
|
}
|
|
619
629
|
async function getEnvironmentInteractive(environment) {
|
|
620
630
|
if (environment) {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
if (!isEnvironmentAvailable(environment)) {
|
|
624
|
-
throw new Error(`Environment ${environment} is not available in this build`);
|
|
625
|
-
}
|
|
626
|
-
return environment;
|
|
627
|
-
} catch {
|
|
628
|
-
}
|
|
631
|
+
getEnvironmentConfig2(environment);
|
|
632
|
+
return environment;
|
|
629
633
|
}
|
|
634
|
+
ensureInteractive("--environment or ECLOUD_ENV");
|
|
630
635
|
const availableEnvs = getAvailableEnvironments();
|
|
631
636
|
let defaultEnv;
|
|
632
637
|
const configDefaultEnv = getDefaultEnvironment();
|
|
@@ -852,7 +857,11 @@ var AppLifecycleStop = class _AppLifecycleStop extends Command {
|
|
|
852
857
|
})
|
|
853
858
|
};
|
|
854
859
|
static flags = {
|
|
855
|
-
...commonFlags
|
|
860
|
+
...commonFlags,
|
|
861
|
+
force: Flags2.boolean({
|
|
862
|
+
description: "Skip all confirmation prompts",
|
|
863
|
+
default: false
|
|
864
|
+
})
|
|
856
865
|
};
|
|
857
866
|
async run() {
|
|
858
867
|
return withTelemetry(this, async () => {
|
|
@@ -888,7 +897,7 @@ var AppLifecycleStop = class _AppLifecycleStop extends Command {
|
|
|
888
897
|
if (finalTx.nonce != null) {
|
|
889
898
|
this.log(chalk2.yellow(`Nonce override active \u2014 nonce: ${finalTx.nonce}`));
|
|
890
899
|
}
|
|
891
|
-
if (isMainnet(environmentConfig)) {
|
|
900
|
+
if (isMainnet(environmentConfig) && !flags.force) {
|
|
892
901
|
const confirmed = await confirm(
|
|
893
902
|
`This will cost up to ${finalTx.maxCostEth} ETH. Continue?`
|
|
894
903
|
);
|