@alchemy/cli 0.5.1 → 0.6.0

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,25 @@ 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-T5Z2GJUX.js";
7
+ import "./chunk-KDMIWPZH.js";
8
+ import "./chunk-ATX65U7J.js";
9
+ import "./chunk-JQRGILIS.js";
7
10
  import {
8
11
  getUpdateNoticeLines
9
- } from "./chunk-Z7J64GJJ.js";
12
+ } from "./chunk-3W4ICF67.js";
10
13
  import {
11
14
  bold,
12
15
  brand,
13
16
  brandedHelp,
14
- configDir,
15
17
  dim,
16
18
  green,
17
- load,
18
19
  setBrandedHelpSuppressed
19
- } from "./chunk-T2XSNZE3.js";
20
+ } from "./chunk-NBDWF4ZQ.js";
21
+ import {
22
+ configDir,
23
+ load
24
+ } from "./chunk-BAAQ7ELR.js";
20
25
  import {
21
26
  bgRgb,
22
27
  isJSONMode,
@@ -123,7 +128,7 @@ function formatSetupMethodLabel() {
123
128
  if (method === "api_key") return "API key";
124
129
  if (method === "access_key_app") return "Access key + app";
125
130
  if (method === "x402_wallet") return "SIWx wallet";
126
- if (method === "auth_token") return "Auth token";
131
+ if (method === "auth_token") return "Browser login + app";
127
132
  return "Not configured";
128
133
  }
129
134
  function replHistoryPath() {
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
+ import {
4
+ getUpdateNoticeLines
5
+ } from "./chunk-3W4ICF67.js";
6
+ import {
7
+ bold,
8
+ brand,
9
+ brandedHelp,
10
+ dim,
11
+ green,
12
+ promptText
13
+ } from "./chunk-NBDWF4ZQ.js";
14
+ import "./chunk-BAAQ7ELR.js";
15
+ import "./chunk-56ZVYB4G.js";
16
+
17
+ // src/commands/onboarding.ts
18
+ async function runOnboarding(_program, latestUpdate = null) {
19
+ process.stdout.write(brandedHelp({ force: true }));
20
+ console.log("");
21
+ console.log(` ${brand("\u25C6")} ${bold("Welcome to Alchemy CLI")}`);
22
+ 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")}`);
23
+ console.log(` ${dim(" Let's get you set up with authentication.")}`);
24
+ console.log("");
25
+ if (latestUpdate) {
26
+ for (const line of getUpdateNoticeLines(latestUpdate)) {
27
+ console.log(line);
28
+ }
29
+ console.log("");
30
+ }
31
+ const answer = await promptText({
32
+ message: "Press Enter to open browser and link your Alchemy account",
33
+ cancelMessage: "Skipped onboarding."
34
+ });
35
+ if (answer === null) {
36
+ return false;
37
+ }
38
+ const { performBrowserLogin, prepareBrowserLogin } = await import("./auth-S4DTOWW3.js");
39
+ const prepared = prepareBrowserLogin();
40
+ console.log(` Opening browser to log in...`);
41
+ console.log(` ${dim(prepared.authorizeUrl)}`);
42
+ console.log(` ${dim("Waiting for authentication...")}`);
43
+ try {
44
+ const result = await performBrowserLogin(prepared);
45
+ const { saveCredentials } = await import("./credential-storage-T6FFW7DG.js");
46
+ await saveCredentials({
47
+ auth_token: result.token,
48
+ auth_token_expires_at: result.expiresAt
49
+ });
50
+ console.log(` ${green("\u2713")} Logged in successfully`);
51
+ const { selectAppAfterAuth } = await import("./auth-QB3BA7AN.js");
52
+ await selectAppAfterAuth(result.token);
53
+ return true;
54
+ } catch (err) {
55
+ console.log(` ${dim(`Login failed: ${err instanceof Error ? err.message : String(err)}`)}`);
56
+ return false;
57
+ }
58
+ }
59
+ export {
60
+ runOnboarding
61
+ };
@@ -0,0 +1,31 @@
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-ATX65U7J.js";
16
+ import "./chunk-JQRGILIS.js";
17
+ import "./chunk-BAAQ7ELR.js";
18
+ import "./chunk-56ZVYB4G.js";
19
+ export {
20
+ adminClientFromFlags,
21
+ clientFromFlags,
22
+ resolveAPIKey,
23
+ resolveAccessKey,
24
+ resolveAppId,
25
+ resolveAuthToken,
26
+ resolveConfiguredNetworkSlugs,
27
+ resolveNetwork,
28
+ resolveWalletKey,
29
+ resolveX402,
30
+ resolveX402Client
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy/cli",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Alchemy CLI — interact with blockchain data",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,6 +33,7 @@
33
33
  "@noble/hashes": "^2.0.1",
34
34
  "cli-table3": "^0.6.5",
35
35
  "commander": "^14.0.3",
36
+ "cross-keychain": "^1.1.0",
36
37
  "zod": "^4.3.6"
37
38
  },
38
39
  "devDependencies": {