@alchemy/cli 0.7.1 → 0.7.2-alpha.21

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.
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
+ import {
4
+ registerAuth,
5
+ selectAppAfterAuth
6
+ } from "./chunk-LQXLZLCY.js";
7
+ import "./chunk-INVT5BV6.js";
8
+ import "./chunk-RE5HSYJJ.js";
9
+ import "./chunk-5LCA2B6S.js";
10
+ import "./chunk-DGKUBK7G.js";
11
+ import "./chunk-BAZ4NGOD.js";
12
+ import "./chunk-KLPWJFWP.js";
13
+ export {
14
+ registerAuth,
15
+ selectAppAfterAuth
16
+ };
@@ -11,8 +11,8 @@ import {
11
11
  prepareLogin,
12
12
  revokeToken,
13
13
  waitForCallback
14
- } from "./chunk-HSKKIATB.js";
15
- import "./chunk-QEDAULQ2.js";
14
+ } from "./chunk-INVT5BV6.js";
15
+ import "./chunk-KLPWJFWP.js";
16
16
  export {
17
17
  AUTH_PORT,
18
18
  DEFAULT_EXPIRES_IN_SECONDS,
@@ -4,7 +4,7 @@ import {
4
4
  configDir,
5
5
  load,
6
6
  save
7
- } from "./chunk-7WD3YLRK.js";
7
+ } from "./chunk-BAZ4NGOD.js";
8
8
  import {
9
9
  CLIError,
10
10
  ErrorCode,
@@ -29,7 +29,7 @@ import {
29
29
  parseBaseURLOverride,
30
30
  redactSensitiveText,
31
31
  verbose
32
- } from "./chunk-QEDAULQ2.js";
32
+ } from "./chunk-KLPWJFWP.js";
33
33
 
34
34
  // src/lib/resolve.ts
35
35
  import { readFileSync as readFileSync2 } from "fs";
@@ -2,7 +2,7 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  isRevealMode
5
- } from "./chunk-QEDAULQ2.js";
5
+ } from "./chunk-KLPWJFWP.js";
6
6
 
7
7
  // src/lib/secrets.ts
8
8
  function maskSecret(value) {
@@ -5,7 +5,7 @@ import {
5
5
  isJSONMode,
6
6
  quiet,
7
7
  rgb
8
- } from "./chunk-QEDAULQ2.js";
8
+ } from "./chunk-KLPWJFWP.js";
9
9
 
10
10
  // src/lib/terminal-ui.ts
11
11
  import * as readline from "readline";
@@ -2,10 +2,10 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  isInteractiveAllowed
5
- } from "./chunk-HYCRHNPX.js";
5
+ } from "./chunk-RE5HSYJJ.js";
6
6
  import {
7
7
  resolveAuthToken
8
- } from "./chunk-TOEVZMIP.js";
8
+ } from "./chunk-5LCA2B6S.js";
9
9
 
10
10
  // src/lib/onboarding.ts
11
11
  function hasAPIKey(cfg) {
@@ -2,10 +2,10 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  configPath
5
- } from "./chunk-7WD3YLRK.js";
5
+ } from "./chunk-BAZ4NGOD.js";
6
6
  import {
7
7
  esc
8
- } from "./chunk-QEDAULQ2.js";
8
+ } from "./chunk-KLPWJFWP.js";
9
9
 
10
10
  // src/lib/update-check.ts
11
11
  import { execFileSync } from "child_process";
@@ -53,7 +53,7 @@ function semverLT(a, b) {
53
53
  return false;
54
54
  }
55
55
  function currentVersion() {
56
- return true ? "0.7.1" : "0.0.0";
56
+ return true ? "0.7.2-alpha.21" : "0.0.0";
57
57
  }
58
58
  function toUpdateStatus(latestVersion, checkedAt) {
59
59
  const current = currentVersion();
@@ -2,7 +2,7 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  getBaseDomain
5
- } from "./chunk-QEDAULQ2.js";
5
+ } from "./chunk-KLPWJFWP.js";
6
6
 
7
7
  // src/lib/auth.ts
8
8
  import { createHash, randomBytes } from "crypto";
@@ -517,6 +517,9 @@ var replMode = false;
517
517
  function setReplMode(enabled) {
518
518
  replMode = enabled;
519
519
  }
520
+ function isReplMode() {
521
+ return replMode;
522
+ }
520
523
  function exitWithError(err) {
521
524
  const cliErr = err instanceof CLIError ? err : new CLIError(
522
525
  ErrorCode.INTERNAL_ERROR,
@@ -573,5 +576,6 @@ export {
573
576
  errAdminAPI,
574
577
  errSetupRequired,
575
578
  setReplMode,
579
+ isReplMode,
576
580
  exitWithError
577
581
  };
@@ -4,14 +4,14 @@ import {
4
4
  completeLogin,
5
5
  prepareLogin,
6
6
  revokeToken
7
- } from "./chunk-HSKKIATB.js";
7
+ } from "./chunk-INVT5BV6.js";
8
8
  import {
9
9
  isInteractiveAllowed
10
- } from "./chunk-HYCRHNPX.js";
10
+ } from "./chunk-RE5HSYJJ.js";
11
11
  import {
12
12
  AdminClient,
13
13
  resolveAuthToken
14
- } from "./chunk-TOEVZMIP.js";
14
+ } from "./chunk-5LCA2B6S.js";
15
15
  import {
16
16
  bold,
17
17
  brand,
@@ -20,13 +20,13 @@ import {
20
20
  promptAutocomplete,
21
21
  promptText,
22
22
  withSpinner
23
- } from "./chunk-5IFXLC2S.js";
23
+ } from "./chunk-DGKUBK7G.js";
24
24
  import {
25
25
  configPath,
26
26
  load,
27
27
  maskIf,
28
28
  save
29
- } from "./chunk-7WD3YLRK.js";
29
+ } from "./chunk-BAZ4NGOD.js";
30
30
  import {
31
31
  CLIError,
32
32
  ErrorCode,
@@ -34,7 +34,7 @@ import {
34
34
  exitWithError,
35
35
  isJSONMode,
36
36
  printHuman
37
- } from "./chunk-QEDAULQ2.js";
37
+ } from "./chunk-KLPWJFWP.js";
38
38
 
39
39
  // src/commands/auth.ts
40
40
  function registerAuth(program) {
@@ -2,7 +2,7 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  isJSONMode
5
- } from "./chunk-QEDAULQ2.js";
5
+ } from "./chunk-KLPWJFWP.js";
6
6
 
7
7
  // src/lib/interaction.ts
8
8
  import { stdin, stdout } from "process";
@@ -24,8 +24,9 @@ import {
24
24
  errSolanaWalletKeyRequired,
25
25
  errWalletKeyRequired,
26
26
  exitWithError,
27
+ isReplMode,
27
28
  setReplMode
28
- } from "./chunk-QEDAULQ2.js";
29
+ } from "./chunk-KLPWJFWP.js";
29
30
  export {
30
31
  CLIError,
31
32
  EXIT_CODES,
@@ -50,5 +51,6 @@ export {
50
51
  errSolanaWalletKeyRequired,
51
52
  errWalletKeyRequired,
52
53
  exitWithError,
54
+ isReplMode,
53
55
  setReplMode
54
56
  };
package/dist/index.js CHANGED
@@ -2,18 +2,18 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  registerAuth
5
- } from "./chunk-SYP6KKP6.js";
5
+ } from "./chunk-LQXLZLCY.js";
6
6
  import {
7
7
  openBrowser
8
- } from "./chunk-HSKKIATB.js";
8
+ } from "./chunk-INVT5BV6.js";
9
9
  import {
10
10
  getSetupStatus,
11
11
  isSetupComplete,
12
12
  shouldRunOnboarding
13
- } from "./chunk-V4IK4CJN.js";
13
+ } from "./chunk-EZ2ZD7YO.js";
14
14
  import {
15
15
  isInteractiveAllowed
16
- } from "./chunk-HYCRHNPX.js";
16
+ } from "./chunk-RE5HSYJJ.js";
17
17
  import {
18
18
  adminClientFromFlags,
19
19
  clearSession,
@@ -41,12 +41,12 @@ import {
41
41
  resolveX402Client,
42
42
  saveSession,
43
43
  updateSession
44
- } from "./chunk-TOEVZMIP.js";
44
+ } from "./chunk-5LCA2B6S.js";
45
45
  import {
46
46
  getAvailableUpdate,
47
47
  getUpdateStatus,
48
48
  printUpdateNotice
49
- } from "./chunk-RS3DSL3X.js";
49
+ } from "./chunk-I5KTBL75.js";
50
50
  import {
51
51
  bold,
52
52
  brand,
@@ -70,7 +70,7 @@ import {
70
70
  weiToEth,
71
71
  withSpinner,
72
72
  yellow
73
- } from "./chunk-5IFXLC2S.js";
73
+ } from "./chunk-DGKUBK7G.js";
74
74
  import {
75
75
  KEY_MAP,
76
76
  configDir,
@@ -81,7 +81,7 @@ import {
81
81
  save,
82
82
  toMap,
83
83
  validKeys
84
- } from "./chunk-7WD3YLRK.js";
84
+ } from "./chunk-BAZ4NGOD.js";
85
85
  import {
86
86
  CLIError,
87
87
  EXIT_CODES,
@@ -108,6 +108,7 @@ import {
108
108
  identity,
109
109
  isJSONMode,
110
110
  isLocalhost,
111
+ isReplMode,
111
112
  noColor,
112
113
  parseBaseURLOverride,
113
114
  printHuman,
@@ -116,7 +117,7 @@ import {
116
117
  setFlags,
117
118
  setNoColor,
118
119
  verbose
119
- } from "./chunk-QEDAULQ2.js";
120
+ } from "./chunk-KLPWJFWP.js";
120
121
 
121
122
  // src/index.ts
122
123
  import { Command, Help } from "commander";
@@ -623,7 +624,7 @@ function registerConfig(program2) {
623
624
  printJSON(toMap(cfg));
624
625
  return;
625
626
  }
626
- const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-R4JZZCCF.js");
627
+ const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-ZCR3YCHJ.js");
627
628
  const validToken = resolveAuthToken2(cfg);
628
629
  const authStatus = cfg.auth_token ? validToken ? `${green("\u2713")} authenticated${cfg.auth_token_expires_at ? ` ${dim(`(expires ${cfg.auth_token_expires_at})`)}` : ""}` : `${yellow("\u25C6")} expired${cfg.auth_token_expires_at ? ` ${dim(`(${cfg.auth_token_expires_at})`)}` : ""}` : dim("(not set) \u2014 run 'alchemy auth' to log in");
629
630
  const pairs = [
@@ -6634,7 +6635,7 @@ Examples:
6634
6635
  signer: parseSignerOpt(opts.signer)
6635
6636
  });
6636
6637
  } catch (err) {
6637
- const { exitWithError: exitWithError2 } = await import("./errors-3CNFGAXT.js");
6638
+ const { exitWithError: exitWithError2 } = await import("./errors-J6HNGXVA.js");
6638
6639
  exitWithError2(err);
6639
6640
  }
6640
6641
  });
@@ -7988,7 +7989,7 @@ function resetUpdateNoticeState() {
7988
7989
  }
7989
7990
  program.name("alchemy").description(
7990
7991
  "The Alchemy CLI lets you query blockchain data, call JSON-RPC methods, and manage your Alchemy configuration."
7991
- ).version("0.7.1", "-v, --version", "display CLI version").option("--api-key <key>", "Alchemy API key (env: ALCHEMY_API_KEY)").option(
7992
+ ).version("0.7.2-alpha.21", "-v, --version", "display CLI version").option("--api-key <key>", "Alchemy API key (env: ALCHEMY_API_KEY)").option(
7992
7993
  "-n, --network <network>",
7993
7994
  "Target network (default: eth-mainnet) (env: ALCHEMY_NETWORK)"
7994
7995
  ).option("--x402", "Use x402 wallet-based gateway auth").option(
@@ -8175,11 +8176,11 @@ ${styledLine}`;
8175
8176
  "wallet"
8176
8177
  ];
8177
8178
  if (!skipAppPrompt.includes(cmdName) && isInteractiveAllowed(program) && !opts.apiKey && !process.env.ALCHEMY_API_KEY) {
8178
- const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-R4JZZCCF.js");
8179
+ const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-ZCR3YCHJ.js");
8179
8180
  const authToken = resolveAuthToken2(cfg);
8180
8181
  const hasApiKey = Boolean(cfg.api_key?.trim() || cfg.app?.apiKey);
8181
8182
  if (authToken && !hasApiKey) {
8182
- const { selectAppAfterAuth } = await import("./auth-BNT5Z5GZ.js");
8183
+ const { selectAppAfterAuth } = await import("./auth-7QNYRHIK.js");
8183
8184
  console.log("");
8184
8185
  console.log(` No app selected. Please select an app to continue.`);
8185
8186
  await selectAppAfterAuth(authToken);
@@ -8194,6 +8195,9 @@ ${styledLine}`;
8194
8195
  }
8195
8196
  }
8196
8197
  resetUpdateNoticeState();
8198
+ if (!isReplMode()) {
8199
+ process.exit(0);
8200
+ }
8197
8201
  }).action(async (_opts, cmd) => {
8198
8202
  const excessArgs = cmd.args;
8199
8203
  if (excessArgs.length > 0) {
@@ -8210,7 +8214,7 @@ ${styledLine}`;
8210
8214
  if (isInteractiveAllowed(program)) {
8211
8215
  let latestForInteractiveStartup = null;
8212
8216
  if (shouldRunOnboarding(program, cfg)) {
8213
- const { runOnboarding } = await import("./onboarding-S6HKWOEA.js");
8217
+ const { runOnboarding } = await import("./onboarding-Y6HXW4CX.js");
8214
8218
  const latest = getAvailableUpdateOnce();
8215
8219
  const completed = await runOnboarding(program, latest);
8216
8220
  updateShownDuringInteractiveStartup = Boolean(latest);
@@ -8224,7 +8228,7 @@ ${styledLine}`;
8224
8228
  latestForInteractiveStartup
8225
8229
  );
8226
8230
  }
8227
- const { startREPL } = await import("./interactive-N33RCX33.js");
8231
+ const { startREPL } = await import("./interactive-OFBUWRE4.js");
8228
8232
  program.exitOverride();
8229
8233
  program.configureOutput({
8230
8234
  writeErr: () => {
@@ -2,14 +2,14 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  getSetupMethod
5
- } from "./chunk-V4IK4CJN.js";
6
- import "./chunk-HYCRHNPX.js";
5
+ } from "./chunk-EZ2ZD7YO.js";
6
+ import "./chunk-RE5HSYJJ.js";
7
7
  import {
8
8
  getRPCNetworkIds
9
- } from "./chunk-TOEVZMIP.js";
9
+ } from "./chunk-5LCA2B6S.js";
10
10
  import {
11
11
  getUpdateNoticeLines
12
- } from "./chunk-RS3DSL3X.js";
12
+ } from "./chunk-I5KTBL75.js";
13
13
  import {
14
14
  bold,
15
15
  brand,
@@ -17,18 +17,18 @@ import {
17
17
  dim,
18
18
  green,
19
19
  setBrandedHelpSuppressed
20
- } from "./chunk-5IFXLC2S.js";
20
+ } from "./chunk-DGKUBK7G.js";
21
21
  import {
22
22
  configDir,
23
23
  load
24
- } from "./chunk-7WD3YLRK.js";
24
+ } from "./chunk-BAZ4NGOD.js";
25
25
  import {
26
26
  bgRgb,
27
27
  isJSONMode,
28
28
  noColor,
29
29
  rgb,
30
30
  setReplMode
31
- } from "./chunk-QEDAULQ2.js";
31
+ } from "./chunk-KLPWJFWP.js";
32
32
 
33
33
  // src/commands/interactive.ts
34
34
  import * as readline from "readline";
@@ -2,7 +2,7 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  getUpdateNoticeLines
5
- } from "./chunk-RS3DSL3X.js";
5
+ } from "./chunk-I5KTBL75.js";
6
6
  import {
7
7
  bold,
8
8
  brand,
@@ -10,12 +10,12 @@ import {
10
10
  dim,
11
11
  green,
12
12
  promptText
13
- } from "./chunk-5IFXLC2S.js";
13
+ } from "./chunk-DGKUBK7G.js";
14
14
  import {
15
15
  load,
16
16
  save
17
- } from "./chunk-7WD3YLRK.js";
18
- import "./chunk-QEDAULQ2.js";
17
+ } from "./chunk-BAZ4NGOD.js";
18
+ import "./chunk-KLPWJFWP.js";
19
19
 
20
20
  // src/commands/onboarding.ts
21
21
  async function runOnboarding(_program, latestUpdate = null) {
@@ -38,7 +38,7 @@ async function runOnboarding(_program, latestUpdate = null) {
38
38
  if (answer === null) {
39
39
  return false;
40
40
  }
41
- const { performBrowserLogin, AUTH_PORT, getLoginUrl } = await import("./auth-JGON2JU6.js");
41
+ const { performBrowserLogin, AUTH_PORT, getLoginUrl } = await import("./auth-TA3SL4BL.js");
42
42
  console.log(` Opening browser to log in...`);
43
43
  console.log(` ${dim(getLoginUrl(AUTH_PORT))}`);
44
44
  console.log(` ${dim("Waiting for authentication...")}`);
@@ -51,7 +51,7 @@ async function runOnboarding(_program, latestUpdate = null) {
51
51
  auth_token_expires_at: result.expiresAt
52
52
  });
53
53
  console.log(` ${green("\u2713")} Logged in successfully`);
54
- const { selectAppAfterAuth } = await import("./auth-BNT5Z5GZ.js");
54
+ const { selectAppAfterAuth } = await import("./auth-7QNYRHIK.js");
55
55
  await selectAppAfterAuth(result.token);
56
56
  return true;
57
57
  } catch (err) {
@@ -22,9 +22,9 @@ import {
22
22
  resolveWalletSession,
23
23
  resolveX402,
24
24
  resolveX402Client
25
- } from "./chunk-TOEVZMIP.js";
26
- import "./chunk-7WD3YLRK.js";
27
- import "./chunk-QEDAULQ2.js";
25
+ } from "./chunk-5LCA2B6S.js";
26
+ import "./chunk-BAZ4NGOD.js";
27
+ import "./chunk-KLPWJFWP.js";
28
28
  export {
29
29
  adminClientFromFlags,
30
30
  clientFromFlags,
package/package.json CHANGED
@@ -1,28 +1,11 @@
1
1
  {
2
2
  "name": "@alchemy/cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.2-alpha.21",
4
4
  "description": "Alchemy CLI — interact with blockchain data",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "alchemy": "./dist/index.js"
8
8
  },
9
- "scripts": {
10
- "build": "tsup",
11
- "dev": "tsup --watch",
12
- "live:check": "node --env-file-if-exists=.env.local --import=tsx scripts/live-check.ts",
13
- "postinstall": "node ./scripts/postinstall.cjs",
14
- "sync:skills": "node scripts/sync-skills.mjs",
15
- "update:skills": "npx skills update && pnpm sync:skills",
16
- "test": "vitest run",
17
- "test:coverage": "vitest run --coverage",
18
- "test:e2e": "pnpm build && vitest run --config vitest.e2e.config.ts",
19
- "test:live": "pnpm build && node --env-file-if-exists=.env.local ./node_modules/vitest/vitest.mjs run --config vitest.live.config.ts",
20
- "test:watch": "vitest",
21
- "lint": "tsc --noEmit",
22
- "changeset": "changeset",
23
- "version-packages": "changeset version",
24
- "release": "pnpm build && changeset publish"
25
- },
26
9
  "keywords": [
27
10
  "alchemy",
28
11
  "blockchain",
@@ -64,10 +47,21 @@
64
47
  "typescript": "^5.9.3",
65
48
  "vitest": "^4.0.18"
66
49
  },
67
- "packageManager": "pnpm@10.18.2+sha512.9fb969fa749b3ade6035e0f109f0b8a60b5d08a1a87fdf72e337da90dcc93336e2280ca4e44f2358a649b83c17959e9993e777c2080879f3801e6f0d999ad3dd",
68
- "pnpm": {
69
- "overrides": {
70
- "typebox": "1.0.81"
71
- }
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "dev": "tsup --watch",
53
+ "live:check": "node --env-file-if-exists=.env.local --import=tsx scripts/live-check.ts",
54
+ "postinstall": "node ./scripts/postinstall.cjs",
55
+ "sync:skills": "node scripts/sync-skills.mjs",
56
+ "update:skills": "npx skills update && pnpm sync:skills",
57
+ "test": "vitest run",
58
+ "test:coverage": "vitest run --coverage",
59
+ "test:e2e": "pnpm build && vitest run --config vitest.e2e.config.ts",
60
+ "test:live": "pnpm build && node --env-file-if-exists=.env.local ./node_modules/vitest/vitest.mjs run --config vitest.live.config.ts",
61
+ "test:watch": "vitest",
62
+ "lint": "tsc --noEmit",
63
+ "changeset": "changeset",
64
+ "version-packages": "changeset version",
65
+ "release": "pnpm build && changeset publish"
72
66
  }
73
- }
67
+ }
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
- import {
4
- registerAuth,
5
- selectAppAfterAuth
6
- } from "./chunk-SYP6KKP6.js";
7
- import "./chunk-HSKKIATB.js";
8
- import "./chunk-HYCRHNPX.js";
9
- import "./chunk-TOEVZMIP.js";
10
- import "./chunk-5IFXLC2S.js";
11
- import "./chunk-7WD3YLRK.js";
12
- import "./chunk-QEDAULQ2.js";
13
- export {
14
- registerAuth,
15
- selectAppAfterAuth
16
- };