@alchemy/cli 0.5.1 → 0.5.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.
@@ -3,20 +3,24 @@ if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  getRPCNetworkIds,
5
5
  getSetupMethod
6
- } from "./chunk-5X6YRTPU.js";
6
+ } from "./chunk-FM7GQX6U.js";
7
+ import "./chunk-KDMIWPZH.js";
8
+ import "./chunk-NM25MEJZ.js";
7
9
  import {
8
10
  getUpdateNoticeLines
9
- } from "./chunk-Z7J64GJJ.js";
11
+ } from "./chunk-NSG4ZKZI.js";
10
12
  import {
11
13
  bold,
12
14
  brand,
13
15
  brandedHelp,
14
- configDir,
15
16
  dim,
16
17
  green,
17
- load,
18
18
  setBrandedHelpSuppressed
19
- } from "./chunk-T2XSNZE3.js";
19
+ } from "./chunk-NBDWF4ZQ.js";
20
+ import {
21
+ configDir,
22
+ load
23
+ } from "./chunk-BAAQ7ELR.js";
20
24
  import {
21
25
  bgRgb,
22
26
  isJSONMode,
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env node
2
+ if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
+ import {
4
+ getUpdateNoticeLines
5
+ } from "./chunk-NSG4ZKZI.js";
6
+ import {
7
+ bold,
8
+ brand,
9
+ brandedHelp,
10
+ dim,
11
+ green,
12
+ promptText
13
+ } from "./chunk-NBDWF4ZQ.js";
14
+ import {
15
+ load,
16
+ save
17
+ } from "./chunk-BAAQ7ELR.js";
18
+ import "./chunk-56ZVYB4G.js";
19
+
20
+ // src/commands/onboarding.ts
21
+ async function runOnboarding(_program, latestUpdate = null) {
22
+ process.stdout.write(brandedHelp({ force: true }));
23
+ console.log("");
24
+ console.log(` ${brand("\u25C6")} ${bold("Welcome to Alchemy CLI")}`);
25
+ console.log(` ${dim(" \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")}`);
26
+ console.log(` ${dim(" Let's get you set up with authentication.")}`);
27
+ console.log("");
28
+ if (latestUpdate) {
29
+ for (const line of getUpdateNoticeLines(latestUpdate)) {
30
+ console.log(line);
31
+ }
32
+ console.log("");
33
+ }
34
+ const answer = await promptText({
35
+ message: "Press Enter to open browser and link your Alchemy account",
36
+ cancelMessage: "Skipped onboarding."
37
+ });
38
+ if (answer === null) {
39
+ return false;
40
+ }
41
+ const { performBrowserLogin, AUTH_PORT, getLoginUrl } = await import("./auth-76PDHQ3U.js");
42
+ console.log(` Opening browser to log in...`);
43
+ console.log(` ${dim(getLoginUrl(AUTH_PORT))}`);
44
+ console.log(` ${dim("Waiting for authentication...")}`);
45
+ try {
46
+ const result = await performBrowserLogin();
47
+ const cfg = load();
48
+ save({
49
+ ...cfg,
50
+ auth_token: result.token,
51
+ auth_token_expires_at: result.expiresAt
52
+ });
53
+ console.log(` ${green("\u2713")} Logged in successfully`);
54
+ const { selectAppAfterAuth } = await import("./auth-PYH5WEC3.js");
55
+ await selectAppAfterAuth(result.token);
56
+ return true;
57
+ } catch (err) {
58
+ console.log(` ${dim(`Login failed: ${err instanceof Error ? err.message : String(err)}`)}`);
59
+ return false;
60
+ }
61
+ }
62
+ export {
63
+ runOnboarding
64
+ };
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
+ import {
4
+ adminClientFromFlags,
5
+ clientFromFlags,
6
+ resolveAPIKey,
7
+ resolveAccessKey,
8
+ resolveAppId,
9
+ resolveAuthToken,
10
+ resolveConfiguredNetworkSlugs,
11
+ resolveNetwork,
12
+ resolveWalletKey,
13
+ resolveX402,
14
+ resolveX402Client
15
+ } from "./chunk-NM25MEJZ.js";
16
+ import "./chunk-BAAQ7ELR.js";
17
+ import "./chunk-56ZVYB4G.js";
18
+ export {
19
+ adminClientFromFlags,
20
+ clientFromFlags,
21
+ resolveAPIKey,
22
+ resolveAccessKey,
23
+ resolveAppId,
24
+ resolveAuthToken,
25
+ resolveConfiguredNetworkSlugs,
26
+ resolveNetwork,
27
+ resolveWalletKey,
28
+ resolveX402,
29
+ resolveX402Client
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy/cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Alchemy CLI — interact with blockchain data",
5
5
  "type": "module",
6
6
  "bin": {