@zeroxyz/cli 0.0.3 → 0.0.5
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/index.js +51 -49
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
// src/app.ts
|
|
4
4
|
import { Command as Command8 } from "commander";
|
|
5
5
|
|
|
6
|
+
// package.json
|
|
7
|
+
var package_default = {
|
|
8
|
+
name: "@zeroxyz/cli",
|
|
9
|
+
version: "0.0.5",
|
|
10
|
+
type: "module",
|
|
11
|
+
bin: {
|
|
12
|
+
zero: "dist/index.js",
|
|
13
|
+
zerocli: "dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
files: [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
publishConfig: {
|
|
19
|
+
access: "public"
|
|
20
|
+
},
|
|
21
|
+
scripts: {
|
|
22
|
+
build: "tsup src/index.ts --format esm --out-dir dist --clean",
|
|
23
|
+
prepublishOnly: "pnpm run build",
|
|
24
|
+
dev: "tsx src/index.ts",
|
|
25
|
+
cli: "ZERO_API_URL=http://localhost:1111 tsx src/index.ts",
|
|
26
|
+
"test:integration": "vitest run --project integration",
|
|
27
|
+
"test:unit": "vitest run --project unit",
|
|
28
|
+
test: "pnpm run test:integration",
|
|
29
|
+
typecheck: "tsc"
|
|
30
|
+
},
|
|
31
|
+
dependencies: {
|
|
32
|
+
"@clack/prompts": "^0.11.0",
|
|
33
|
+
"@relayprotocol/relay-sdk": "^5.2.1",
|
|
34
|
+
"@x402/core": "^2.9.0",
|
|
35
|
+
"@x402/evm": "^2.9.0",
|
|
36
|
+
commander: "^13.0.0",
|
|
37
|
+
mppx: "^0.5.9",
|
|
38
|
+
open: "^11.0.0",
|
|
39
|
+
"posthog-node": "^5.29.2",
|
|
40
|
+
viem: "^2.47.10",
|
|
41
|
+
zod: "^4.3.5"
|
|
42
|
+
},
|
|
43
|
+
devDependencies: {
|
|
44
|
+
"@types/node": "^25.0.7",
|
|
45
|
+
tsup: "^8.5.1",
|
|
46
|
+
tsx: "^4.21.0",
|
|
47
|
+
typescript: "^5.9.3",
|
|
48
|
+
vitest: "^4.0.17"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
6
52
|
// src/commands/config-command.ts
|
|
7
53
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
8
54
|
import { homedir } from "os";
|
|
@@ -338,7 +384,9 @@ var searchCommand = (appContext2) => new Command6("search").description("Search
|
|
|
338
384
|
resultCount: result.capabilities.length
|
|
339
385
|
});
|
|
340
386
|
console.log(formatSearchResults(result.capabilities));
|
|
341
|
-
|
|
387
|
+
if (result.capabilities.length > 0) {
|
|
388
|
+
console.error("\n Run `zero get {NUMBER}` to view a capability.\n");
|
|
389
|
+
}
|
|
342
390
|
} catch (err) {
|
|
343
391
|
console.error(err instanceof Error ? err.message : "Search failed");
|
|
344
392
|
process.exitCode = 1;
|
|
@@ -420,7 +468,7 @@ var walletCommand = (appContext2) => {
|
|
|
420
468
|
// src/app.ts
|
|
421
469
|
var createApp = (appContext2) => {
|
|
422
470
|
const { analyticsService } = appContext2.services;
|
|
423
|
-
const program = new Command8().name("zero").description("Zero CLI \u2014 Search engine and payment platform for AI agents").exitOverride().hook("preAction", (_thisCommand, actionCommand) => {
|
|
471
|
+
const program = new Command8().name("zero").description("Zero CLI \u2014 Search engine and payment platform for AI agents").version(package_default.version, "-v, --version").exitOverride().hook("preAction", (_thisCommand, actionCommand) => {
|
|
424
472
|
analyticsService.capture("command_executed", {
|
|
425
473
|
command: actionCommand.name()
|
|
426
474
|
});
|
|
@@ -457,52 +505,6 @@ import { homedir as homedir3 } from "os";
|
|
|
457
505
|
import { join as join4 } from "path";
|
|
458
506
|
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
459
507
|
|
|
460
|
-
// package.json
|
|
461
|
-
var package_default = {
|
|
462
|
-
name: "@zeroxyz/cli",
|
|
463
|
-
version: "0.0.3",
|
|
464
|
-
type: "module",
|
|
465
|
-
bin: {
|
|
466
|
-
zero: "dist/index.js",
|
|
467
|
-
zerocli: "dist/index.js"
|
|
468
|
-
},
|
|
469
|
-
files: [
|
|
470
|
-
"dist"
|
|
471
|
-
],
|
|
472
|
-
publishConfig: {
|
|
473
|
-
access: "public"
|
|
474
|
-
},
|
|
475
|
-
scripts: {
|
|
476
|
-
build: "tsup src/index.ts --format esm --out-dir dist --clean",
|
|
477
|
-
prepublishOnly: "pnpm run build",
|
|
478
|
-
dev: "tsx src/index.ts",
|
|
479
|
-
cli: "ZERO_API_URL=http://localhost:1111 tsx src/index.ts",
|
|
480
|
-
"test:integration": "vitest run --project integration",
|
|
481
|
-
"test:unit": "vitest run --project unit",
|
|
482
|
-
test: "pnpm run test:integration",
|
|
483
|
-
typecheck: "tsc"
|
|
484
|
-
},
|
|
485
|
-
dependencies: {
|
|
486
|
-
"@clack/prompts": "^0.11.0",
|
|
487
|
-
"@relayprotocol/relay-sdk": "^5.2.1",
|
|
488
|
-
"@x402/core": "^2.9.0",
|
|
489
|
-
"@x402/evm": "^2.9.0",
|
|
490
|
-
commander: "^13.0.0",
|
|
491
|
-
mppx: "^0.5.9",
|
|
492
|
-
open: "^11.0.0",
|
|
493
|
-
"posthog-node": "^5.29.2",
|
|
494
|
-
viem: "^2.47.10",
|
|
495
|
-
zod: "^4.3.5"
|
|
496
|
-
},
|
|
497
|
-
devDependencies: {
|
|
498
|
-
"@types/node": "^25.0.7",
|
|
499
|
-
tsup: "^8.5.1",
|
|
500
|
-
tsx: "^4.21.0",
|
|
501
|
-
typescript: "^5.9.3",
|
|
502
|
-
vitest: "^4.0.17"
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
|
|
506
508
|
// src/services/analytics-service.ts
|
|
507
509
|
import { randomUUID } from "crypto";
|
|
508
510
|
import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
@@ -1010,7 +1012,6 @@ var WalletService = class {
|
|
|
1010
1012
|
var CLI_VERSION = package_default.version;
|
|
1011
1013
|
var getServices = (env) => {
|
|
1012
1014
|
let privateKey = env.ZERO_PRIVATE_KEY ? env.ZERO_PRIVATE_KEY : null;
|
|
1013
|
-
const account = privateKey ? privateKeyToAccount2(privateKey) : null;
|
|
1014
1015
|
const zeroDir = join4(homedir3(), ".zero");
|
|
1015
1016
|
const configPath = join4(zeroDir, "config.json");
|
|
1016
1017
|
if (!privateKey) {
|
|
@@ -1024,6 +1025,7 @@ var getServices = (env) => {
|
|
|
1024
1025
|
} catch {
|
|
1025
1026
|
}
|
|
1026
1027
|
}
|
|
1028
|
+
const account = privateKey ? privateKeyToAccount2(privateKey) : null;
|
|
1027
1029
|
let lowBalanceWarning = 1;
|
|
1028
1030
|
try {
|
|
1029
1031
|
if (existsSync5(configPath)) {
|