@layr-labs/ecloud-cli 0.4.3-dev → 0.5.0-dev.2
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.map +1 -1
- package/dist/commands/billing/__tests__/status.test.js +9 -0
- package/dist/commands/billing/__tests__/status.test.js.map +1 -1
- package/dist/commands/billing/__tests__/subscribe.test.js +9 -0
- package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -1
- package/dist/commands/billing/__tests__/top-up.test.js +9 -0
- package/dist/commands/billing/__tests__/top-up.test.js.map +1 -1
- package/dist/commands/billing/cancel.js +9 -0
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +9 -0
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +9 -0
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/billing/top-up.js +9 -0
- 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.map +1 -1
- package/dist/commands/compute/app/deploy.js +71 -18
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +15 -8
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +10 -1
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +15 -8
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +16 -8
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +15 -8
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +27 -11
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +27 -11
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +20 -8
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +110 -21
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +10 -1
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +10 -1
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +10 -1
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +10 -1
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +11 -1
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +10 -1
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/set.js +8 -0
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/undelegate.js +10 -1
- 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/start.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 {
|
|
@@ -245,7 +245,7 @@ function listApps(environment) {
|
|
|
245
245
|
|
|
246
246
|
// src/utils/version.ts
|
|
247
247
|
function getCliVersion() {
|
|
248
|
-
return true ? "0.
|
|
248
|
+
return true ? "0.5.0-dev.2" : "0.0.0";
|
|
249
249
|
}
|
|
250
250
|
function getClientId() {
|
|
251
251
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -275,6 +275,13 @@ function addHexPrefix2(value) {
|
|
|
275
275
|
}
|
|
276
276
|
return `0x${value}`;
|
|
277
277
|
}
|
|
278
|
+
function ensureInteractive(missingFlagHint) {
|
|
279
|
+
if (!process.stdin.isTTY) {
|
|
280
|
+
throw new Error(
|
|
281
|
+
`Cannot prompt in non-interactive mode. Provide ${missingFlagHint} via CLI flags or environment variables.`
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
278
285
|
function getCurrentProjectPath() {
|
|
279
286
|
return process.env.INIT_CWD || process.cwd();
|
|
280
287
|
}
|
|
@@ -352,9 +359,10 @@ async function getOrPromptAppID(appIDOrOptions, environment) {
|
|
|
352
359
|
return addHexPrefix2(foundAppID);
|
|
353
360
|
}
|
|
354
361
|
throw new Error(
|
|
355
|
-
`App name '${options.appID}' not found in environment '${options.environment}'
|
|
362
|
+
`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
363
|
);
|
|
357
364
|
}
|
|
365
|
+
ensureInteractive("app-id argument");
|
|
358
366
|
return getAppIDInteractive(options);
|
|
359
367
|
}
|
|
360
368
|
async function getAppIDInteractive(options) {
|
|
@@ -387,12 +395,9 @@ Select an app to ${action}:
|
|
|
387
395
|
let cachedProfiles = getProfileCache(environment);
|
|
388
396
|
if (!cachedProfiles) {
|
|
389
397
|
try {
|
|
390
|
-
const userApiClient = new UserApiClient2(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
publicClient,
|
|
394
|
-
{ clientId: getClientId() }
|
|
395
|
-
);
|
|
398
|
+
const userApiClient = new UserApiClient2(environmentConfig, walletClient, publicClient, {
|
|
399
|
+
clientId: getClientId()
|
|
400
|
+
});
|
|
396
401
|
const appInfos = await getAppInfosChunked(userApiClient, apps);
|
|
397
402
|
const freshProfiles = {};
|
|
398
403
|
for (const info of appInfos) {
|
|
@@ -584,6 +589,11 @@ async function confirm(prompt) {
|
|
|
584
589
|
return confirmWithDefault(prompt, false);
|
|
585
590
|
}
|
|
586
591
|
async function confirmWithDefault(prompt, defaultValue = false) {
|
|
592
|
+
if (!process.stdin.isTTY) {
|
|
593
|
+
throw new Error(
|
|
594
|
+
`Cannot confirm "${prompt}" in non-interactive mode. Use --force to skip confirmation prompts.`
|
|
595
|
+
);
|
|
596
|
+
}
|
|
587
597
|
return await inquirerConfirm({
|
|
588
598
|
message: prompt,
|
|
589
599
|
default: defaultValue
|
|
@@ -601,6 +611,7 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
601
611
|
if (result) {
|
|
602
612
|
return result.key;
|
|
603
613
|
}
|
|
614
|
+
ensureInteractive("--private-key or ECLOUD_PRIVATE_KEY");
|
|
604
615
|
const key = await password({
|
|
605
616
|
message: "Enter private key:",
|
|
606
617
|
mask: true,
|
|
@@ -627,6 +638,7 @@ async function getEnvironmentInteractive(environment) {
|
|
|
627
638
|
} catch {
|
|
628
639
|
}
|
|
629
640
|
}
|
|
641
|
+
ensureInteractive("--environment or ECLOUD_ENV");
|
|
630
642
|
const availableEnvs = getAvailableEnvironments();
|
|
631
643
|
let defaultEnv;
|
|
632
644
|
const configDefaultEnv = getDefaultEnvironment();
|
|
@@ -852,7 +864,11 @@ var AppLifecycleStart = class _AppLifecycleStart extends Command {
|
|
|
852
864
|
})
|
|
853
865
|
};
|
|
854
866
|
static flags = {
|
|
855
|
-
...commonFlags
|
|
867
|
+
...commonFlags,
|
|
868
|
+
force: Flags2.boolean({
|
|
869
|
+
description: "Skip all confirmation prompts",
|
|
870
|
+
default: false
|
|
871
|
+
})
|
|
856
872
|
};
|
|
857
873
|
async run() {
|
|
858
874
|
return withTelemetry(this, async () => {
|
|
@@ -888,7 +904,7 @@ var AppLifecycleStart = class _AppLifecycleStart extends Command {
|
|
|
888
904
|
if (finalTx.nonce != null) {
|
|
889
905
|
this.log(chalk2.yellow(`Nonce override active \u2014 nonce: ${finalTx.nonce}`));
|
|
890
906
|
}
|
|
891
|
-
if (isMainnet(environmentConfig)) {
|
|
907
|
+
if (isMainnet(environmentConfig) && !flags.force) {
|
|
892
908
|
const confirmed = await confirm(
|
|
893
909
|
`This will cost up to ${finalTx.maxCostEth} ETH. Continue?`
|
|
894
910
|
);
|