@alchemy/cli 0.5.0 → 0.5.1
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.
|
@@ -12,7 +12,7 @@ import { execFileSync } from "child_process";
|
|
|
12
12
|
import { readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
13
13
|
import { dirname } from "path";
|
|
14
14
|
var CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
15
|
-
var UPDATE_INSTALL_COMMAND = "npm i -g @alchemy/cli";
|
|
15
|
+
var UPDATE_INSTALL_COMMAND = "npm i -g @alchemy/cli@latest";
|
|
16
16
|
function cachePath() {
|
|
17
17
|
return configPath().replace(/config\.json$/, ".update-check");
|
|
18
18
|
}
|
|
@@ -53,7 +53,7 @@ function semverLT(a, b) {
|
|
|
53
53
|
return false;
|
|
54
54
|
}
|
|
55
55
|
function currentVersion() {
|
|
56
|
-
return true ? "0.5.
|
|
56
|
+
return true ? "0.5.1" : "0.0.0";
|
|
57
57
|
}
|
|
58
58
|
function toUpdateStatus(latestVersion, checkedAt) {
|
|
59
59
|
const current = currentVersion();
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getAvailableUpdate,
|
|
26
26
|
getUpdateStatus,
|
|
27
27
|
printUpdateNotice
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-Z7J64GJJ.js";
|
|
29
29
|
import {
|
|
30
30
|
adminClientFromFlags,
|
|
31
31
|
bold,
|
|
@@ -2738,7 +2738,7 @@ function resetUpdateNoticeState() {
|
|
|
2738
2738
|
}
|
|
2739
2739
|
program.name("alchemy").description(
|
|
2740
2740
|
"The Alchemy CLI lets you query blockchain data, call JSON-RPC methods, and manage your Alchemy configuration."
|
|
2741
|
-
).version("0.5.
|
|
2741
|
+
).version("0.5.1", "-v, --version", "display CLI version").option("--api-key <key>", "Alchemy API key (env: ALCHEMY_API_KEY)").option("--access-key <key>", "Alchemy access key (env: ALCHEMY_ACCESS_KEY)").option(
|
|
2742
2742
|
"-n, --network <network>",
|
|
2743
2743
|
"Target network (default: eth-mainnet) (env: ALCHEMY_NETWORK)"
|
|
2744
2744
|
).option("--x402", "Use x402 wallet-based gateway auth").option("--wallet-key-file <path>", "Path to wallet private key file for x402").option("--json", "Force JSON output (auto-enabled when piped)").option("-q, --quiet", "Suppress non-essential output").option("--verbose", "Enable verbose output").option("--no-color", "Disable color output").option("--reveal", "Show secrets in plain text").option("--timeout <ms>", "Request timeout in milliseconds (default: none)", parseInt).option("--debug", "Enable debug diagnostics").option("--no-interactive", "Disable REPL and prompt-driven interactions").addHelpCommand(false).allowExcessArguments(true).exitOverride((err) => {
|
|
@@ -2918,7 +2918,7 @@ ${styledLine}`;
|
|
|
2918
2918
|
if (isInteractiveAllowed(program)) {
|
|
2919
2919
|
let latestForInteractiveStartup = null;
|
|
2920
2920
|
if (shouldRunOnboarding(program, cfg)) {
|
|
2921
|
-
const { runOnboarding } = await import("./onboarding-
|
|
2921
|
+
const { runOnboarding } = await import("./onboarding-CWCVWSUG.js");
|
|
2922
2922
|
const latest = getAvailableUpdateOnce();
|
|
2923
2923
|
const completed = await runOnboarding(program, latest);
|
|
2924
2924
|
updateShownDuringInteractiveStartup = Boolean(latest);
|
|
@@ -2930,7 +2930,7 @@ ${styledLine}`;
|
|
|
2930
2930
|
latestForInteractiveStartup = getAvailableUpdateOnce();
|
|
2931
2931
|
updateShownDuringInteractiveStartup = Boolean(latestForInteractiveStartup);
|
|
2932
2932
|
}
|
|
2933
|
-
const { startREPL } = await import("./interactive-
|
|
2933
|
+
const { startREPL } = await import("./interactive-G4ON47AR.js");
|
|
2934
2934
|
program.exitOverride();
|
|
2935
2935
|
program.configureOutput({
|
|
2936
2936
|
writeErr: () => {
|
package/package.json
CHANGED
package/scripts/postinstall.cjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const { unlinkSync } = require("node:fs");
|
|
4
|
+
const { join } = require("node:path");
|
|
5
|
+
|
|
3
6
|
function isGlobalInstall() {
|
|
4
7
|
return process.env.npm_config_global === "true";
|
|
5
8
|
}
|
|
@@ -8,8 +11,21 @@ function isCI() {
|
|
|
8
11
|
return process.env.CI === "true";
|
|
9
12
|
}
|
|
10
13
|
|
|
14
|
+
function clearUpdateCache() {
|
|
15
|
+
const home = process.env.HOME || require("node:os").homedir();
|
|
16
|
+
const configHome = process.env.XDG_CONFIG_HOME || join(home, ".config");
|
|
17
|
+
const cachePath = process.env.ALCHEMY_CONFIG
|
|
18
|
+
? process.env.ALCHEMY_CONFIG.replace(/config\.json$/, ".update-check")
|
|
19
|
+
: join(configHome, "alchemy", ".update-check");
|
|
20
|
+
try {
|
|
21
|
+
unlinkSync(cachePath);
|
|
22
|
+
} catch {
|
|
23
|
+
// Cache file may not exist yet — that's fine.
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
11
27
|
if (isGlobalInstall() && !isCI()) {
|
|
12
|
-
|
|
28
|
+
clearUpdateCache();
|
|
13
29
|
console.log("");
|
|
14
30
|
console.log("◆ Alchemy CLI installed");
|
|
15
31
|
console.log(" Run `alchemy` to get started.");
|