@alchemy/cli 0.7.2 → 0.7.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/dist/auth-F2IXC6CM.js +16 -0
- package/dist/{auth-TA3SL4BL.js → auth-GD7BJOMK.js} +2 -2
- package/dist/{chunk-KLPWJFWP.js → chunk-2BALTY22.js} +2 -19
- package/dist/{chunk-DGKUBK7G.js → chunk-5IL2PMZ6.js} +1 -1
- package/dist/{chunk-RE5HSYJJ.js → chunk-64A5W4M2.js} +1 -1
- package/dist/{chunk-INVT5BV6.js → chunk-C5HNQOLB.js} +1 -1
- package/dist/{chunk-MB6REYQL.js → chunk-FD6YLNTB.js} +3 -3
- package/dist/{chunk-BAZ4NGOD.js → chunk-JUCUKTP3.js} +1 -1
- package/dist/{chunk-5LCA2B6S.js → chunk-K6V3R7SH.js} +514 -509
- package/dist/chunk-R4W44A6E.js +134 -0
- package/dist/{chunk-LQXLZLCY.js → chunk-XSN4XA5Z.js} +6 -6
- package/dist/{errors-J6HNGXVA.js → errors-E2P6WHTX.js} +1 -1
- package/dist/index.js +391 -81
- package/dist/{interactive-JNTFVCUJ.js → interactive-BNIJYEOV.js} +13 -10
- package/dist/{onboarding-WN3IMTGS.js → onboarding-TTUVIXM4.js} +6 -6
- package/dist/{resolve-ZCR3YCHJ.js → resolve-WXT5ZCUK.js} +3 -3
- package/package.json +18 -24
- package/scripts/postinstall.cjs +2 -0
- package/dist/auth-7QNYRHIK.js +0 -16
- package/dist/chunk-EZ2ZD7YO.js +0 -64
|
@@ -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-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-R4W44A6E.js";
|
|
6
|
+
import "./chunk-64A5W4M2.js";
|
|
7
7
|
import {
|
|
8
8
|
getRPCNetworkIds
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K6V3R7SH.js";
|
|
10
10
|
import {
|
|
11
11
|
getUpdateNoticeLines
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FD6YLNTB.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-
|
|
20
|
+
} from "./chunk-5IL2PMZ6.js";
|
|
21
21
|
import {
|
|
22
22
|
configDir,
|
|
23
23
|
load
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JUCUKTP3.js";
|
|
25
25
|
import {
|
|
26
26
|
bgRgb,
|
|
27
27
|
isJSONMode,
|
|
28
28
|
noColor,
|
|
29
29
|
rgb,
|
|
30
30
|
setReplMode
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-2BALTY22.js";
|
|
32
32
|
|
|
33
33
|
// src/commands/interactive.ts
|
|
34
34
|
import * as readline from "readline";
|
|
@@ -98,8 +98,10 @@ var COMMAND_NAMES = [
|
|
|
98
98
|
"config reset",
|
|
99
99
|
"help",
|
|
100
100
|
"update-check",
|
|
101
|
-
"network",
|
|
102
|
-
"network list",
|
|
101
|
+
"evm network",
|
|
102
|
+
"evm network list",
|
|
103
|
+
"solana network",
|
|
104
|
+
"solana network list",
|
|
103
105
|
"rpc",
|
|
104
106
|
"tx",
|
|
105
107
|
"receipt",
|
|
@@ -236,7 +238,8 @@ async function startREPL(program, latestUpdate = null) {
|
|
|
236
238
|
console.log(` ${brand("\u25C6")} ${bold("Quick commands")}`);
|
|
237
239
|
console.log(` ${dim("- rpc eth_chainId")}`);
|
|
238
240
|
console.log(` ${dim("- config list")}`);
|
|
239
|
-
console.log(` ${dim("- network list")}`);
|
|
241
|
+
console.log(` ${dim("- evm network list")}`);
|
|
242
|
+
console.log(` ${dim("- solana network list")}`);
|
|
240
243
|
console.log(` ${dim("- help")}`);
|
|
241
244
|
console.log("");
|
|
242
245
|
console.log(` ${dim("Press TAB for autocomplete. Type 'exit' or 'quit' to leave.")}`);
|
|
@@ -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-
|
|
5
|
+
} from "./chunk-FD6YLNTB.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-
|
|
13
|
+
} from "./chunk-5IL2PMZ6.js";
|
|
14
14
|
import {
|
|
15
15
|
load,
|
|
16
16
|
save
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-JUCUKTP3.js";
|
|
18
|
+
import "./chunk-2BALTY22.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-
|
|
41
|
+
const { performBrowserLogin, AUTH_PORT, getLoginUrl } = await import("./auth-GD7BJOMK.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-
|
|
54
|
+
const { selectAppAfterAuth } = await import("./auth-F2IXC6CM.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-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-K6V3R7SH.js";
|
|
26
|
+
import "./chunk-JUCUKTP3.js";
|
|
27
|
+
import "./chunk-2BALTY22.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.
|
|
3
|
+
"version": "0.7.3",
|
|
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
|
-
"
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
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
|
+
}
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -97,5 +97,7 @@ if (isGlobalInstall() && !isCI()) {
|
|
|
97
97
|
console.log("");
|
|
98
98
|
console.log("◆ Alchemy CLI installed");
|
|
99
99
|
console.log(" Run `alchemy` to get started.");
|
|
100
|
+
console.log(" Run `alchemy install mcp` to connect Alchemy MCP to an agent.");
|
|
101
|
+
console.log(" Run `alchemy install skills` to install Alchemy agent skills.");
|
|
100
102
|
console.log("");
|
|
101
103
|
}
|
package/dist/auth-7QNYRHIK.js
DELETED
|
@@ -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-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
|
-
};
|
package/dist/chunk-EZ2ZD7YO.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
|
-
import {
|
|
4
|
-
isInteractiveAllowed
|
|
5
|
-
} from "./chunk-RE5HSYJJ.js";
|
|
6
|
-
import {
|
|
7
|
-
resolveAuthToken
|
|
8
|
-
} from "./chunk-5LCA2B6S.js";
|
|
9
|
-
|
|
10
|
-
// src/lib/onboarding.ts
|
|
11
|
-
function hasAPIKey(cfg) {
|
|
12
|
-
return Boolean(cfg.api_key?.trim());
|
|
13
|
-
}
|
|
14
|
-
function hasAccessKeyAndApp(cfg) {
|
|
15
|
-
return Boolean(cfg.access_key?.trim() && cfg.app?.id && cfg.app.apiKey);
|
|
16
|
-
}
|
|
17
|
-
function hasX402Wallet(cfg) {
|
|
18
|
-
return cfg.x402 === true && Boolean(cfg.wallet_key_file?.trim());
|
|
19
|
-
}
|
|
20
|
-
function hasAuthToken(cfg) {
|
|
21
|
-
return resolveAuthToken(cfg) !== void 0;
|
|
22
|
-
}
|
|
23
|
-
function getSetupMethod(cfg) {
|
|
24
|
-
if (hasAPIKey(cfg)) return "api_key";
|
|
25
|
-
if (hasAccessKeyAndApp(cfg)) return "access_key_app";
|
|
26
|
-
if (hasX402Wallet(cfg)) return "x402_wallet";
|
|
27
|
-
if (hasAuthToken(cfg)) return "auth_token";
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
function isSetupComplete(cfg) {
|
|
31
|
-
return getSetupMethod(cfg) !== null;
|
|
32
|
-
}
|
|
33
|
-
function getSetupStatus(cfg) {
|
|
34
|
-
const satisfiedBy = getSetupMethod(cfg);
|
|
35
|
-
if (satisfiedBy) {
|
|
36
|
-
return {
|
|
37
|
-
complete: true,
|
|
38
|
-
satisfiedBy,
|
|
39
|
-
missing: [],
|
|
40
|
-
nextCommands: []
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
complete: false,
|
|
45
|
-
satisfiedBy: null,
|
|
46
|
-
missing: ["Provide one auth path: alchemy auth OR api-key OR ALCHEMY_ACCESS_KEY+app OR SIWx wallet"],
|
|
47
|
-
nextCommands: [
|
|
48
|
-
"alchemy auth",
|
|
49
|
-
"alchemy config set app",
|
|
50
|
-
"alchemy config set access-key <key> && alchemy config set app <app-id>",
|
|
51
|
-
"alchemy wallet connect --mode local --chain evm && alchemy config set x402 true"
|
|
52
|
-
]
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function shouldRunOnboarding(program, cfg) {
|
|
56
|
-
return isInteractiveAllowed(program) && !isSetupComplete(cfg);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
getSetupMethod,
|
|
61
|
-
isSetupComplete,
|
|
62
|
-
getSetupStatus,
|
|
63
|
-
shouldRunOnboarding
|
|
64
|
-
};
|