@tokenomist-ai/tokenomist-cli 0.1.0 → 0.1.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.
- package/README.md +50 -33
- package/dist/index.js +144 -78
- package/dist/index.js.map +1 -1
- package/dist/update-check.js +3 -3
- package/dist/update-check.js.map +1 -1
- package/package.json +3 -3
- package/scripts/postinstall.js +6 -19
- package/skills/tokenomist-allocation-breakdown/SKILL.md +8 -8
- package/skills/tokenomist-burn-buyback/SKILL.md +54 -14
- package/skills/tokenomist-emission-report/SKILL.md +41 -13
- package/skills/tokenomist-fundraising-lookup/SKILL.md +44 -17
- package/skills/tokenomist-token-overview/SKILL.md +28 -12
- package/skills/tokenomist-unlock-analysis/SKILL.md +59 -16
package/dist/index.js
CHANGED
|
@@ -376,7 +376,7 @@ function resolveConfig(opts) {
|
|
|
376
376
|
const baseUrl = opts.baseUrl || process.env.TOKENOMIST_BASE_URL || file.baseUrl || "https://api.tokenomist.ai";
|
|
377
377
|
if (!apiKey) {
|
|
378
378
|
console.error(
|
|
379
|
-
'Error: API key is required. Run "
|
|
379
|
+
'Error: API key is required. Run "tok auth login" or provide via --api-key / TOKENOMIST_API_KEY env var.'
|
|
380
380
|
);
|
|
381
381
|
process.exit(1);
|
|
382
382
|
}
|
|
@@ -411,14 +411,18 @@ tokenCommand.command("list").description("List all tokens with summary data").op
|
|
|
411
411
|
});
|
|
412
412
|
output(data, columns, globalOpts.output || "table");
|
|
413
413
|
});
|
|
414
|
-
tokenCommand.command("search <query>").description("Search for tokens by name, symbol, or
|
|
414
|
+
tokenCommand.command("search <query>").description("Search for tokens by name, symbol, or ID").action(async (query, _opts, cmd) => {
|
|
415
415
|
const globalOpts = cmd.optsWithGlobals();
|
|
416
416
|
const config = resolveConfig(globalOpts);
|
|
417
417
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
418
418
|
noCache: config.noCache
|
|
419
419
|
});
|
|
420
420
|
const data = await searchTokens(client, query);
|
|
421
|
-
output(
|
|
421
|
+
output(
|
|
422
|
+
data,
|
|
423
|
+
searchColumns,
|
|
424
|
+
globalOpts.output || "table"
|
|
425
|
+
);
|
|
422
426
|
});
|
|
423
427
|
|
|
424
428
|
// src/commands/unlock.ts
|
|
@@ -434,9 +438,9 @@ async function listUpcomingUnlockEvents(client, params) {
|
|
|
434
438
|
params
|
|
435
439
|
);
|
|
436
440
|
}
|
|
437
|
-
async function getUnlockEvents(client,
|
|
441
|
+
async function getUnlockEvents(client, tokenId, params) {
|
|
438
442
|
return client.get(
|
|
439
|
-
`/v5/unlock/events/${encodeURIComponent(
|
|
443
|
+
`/v5/unlock/events/${encodeURIComponent(tokenId)}`,
|
|
440
444
|
params
|
|
441
445
|
);
|
|
442
446
|
}
|
|
@@ -536,14 +540,14 @@ addUpcomingFilterOptions(
|
|
|
536
540
|
);
|
|
537
541
|
});
|
|
538
542
|
addPaginationOptions(
|
|
539
|
-
unlockCommand.command("events <
|
|
540
|
-
).action(async (
|
|
543
|
+
unlockCommand.command("events <tokenId>").description("Get unlock events for a specific token").option("--start <date>", "Start date (YYYY-MM-DD)").option("--end <date>", "End date (YYYY-MM-DD)").option("--standard-allocation <names>", "Filter by allocation (comma-separated)")
|
|
544
|
+
).action(async (tokenId, opts, cmd) => {
|
|
541
545
|
const globalOpts = cmd.optsWithGlobals();
|
|
542
546
|
const config = resolveConfig(globalOpts);
|
|
543
547
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
544
548
|
noCache: config.noCache
|
|
545
549
|
});
|
|
546
|
-
const data = await getUnlockEvents(client,
|
|
550
|
+
const data = await getUnlockEvents(client, tokenId, {
|
|
547
551
|
start: opts.start,
|
|
548
552
|
end: opts.end,
|
|
549
553
|
standardAllocation: opts.standardAllocation,
|
|
@@ -556,11 +560,7 @@ addPaginationOptions(
|
|
|
556
560
|
cliffValue: d.cliffUnlocks.cliffValue,
|
|
557
561
|
valueToMarketCap: d.cliffUnlocks.valueToMarketCap
|
|
558
562
|
}));
|
|
559
|
-
output(
|
|
560
|
-
rows,
|
|
561
|
-
eventsColumns,
|
|
562
|
-
globalOpts.output || "table"
|
|
563
|
-
);
|
|
563
|
+
output(rows, eventsColumns, globalOpts.output || "table");
|
|
564
564
|
});
|
|
565
565
|
|
|
566
566
|
// src/commands/investor.ts
|
|
@@ -646,9 +646,9 @@ investorCommand.command("detail <investorId>").description("Get investor detail
|
|
|
646
646
|
import { Command as Command4 } from "commander";
|
|
647
647
|
|
|
648
648
|
// src/api/fundraising.ts
|
|
649
|
-
async function getFundraising(client,
|
|
649
|
+
async function getFundraising(client, tokenId, params) {
|
|
650
650
|
return client.get(
|
|
651
|
-
`/v5/fundraising/token/${encodeURIComponent(
|
|
651
|
+
`/v5/fundraising/token/${encodeURIComponent(tokenId)}`,
|
|
652
652
|
params
|
|
653
653
|
);
|
|
654
654
|
}
|
|
@@ -663,13 +663,16 @@ var columns2 = [
|
|
|
663
663
|
{ key: "pricePerToken", header: "Price/Token", align: "right" },
|
|
664
664
|
{ key: "numberOfInvestors", header: "Investors", align: "right" }
|
|
665
665
|
];
|
|
666
|
-
var fundraisingCommand = new Command4("fundraising").description(
|
|
666
|
+
var fundraisingCommand = new Command4("fundraising").description(
|
|
667
|
+
"Token fundraising commands"
|
|
668
|
+
);
|
|
669
|
+
fundraisingCommand.command("detail <tokenId>").description("Get fundraising data for a specific token").option("--funding-date-min <date>", "Min funding date (YYYY-MM-DD)").option("--funding-date-max <date>", "Max funding date (YYYY-MM-DD)").option("--raised-amount-min <value>", "Min raised amount").option("--raised-amount-max <value>", "Max raised amount").action(async (tokenId, opts, cmd) => {
|
|
667
670
|
const globalOpts = cmd.optsWithGlobals();
|
|
668
671
|
const config = resolveConfig(globalOpts);
|
|
669
672
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
670
673
|
noCache: config.noCache
|
|
671
674
|
});
|
|
672
|
-
const data = await getFundraising(client,
|
|
675
|
+
const data = await getFundraising(client, tokenId, {
|
|
673
676
|
fundingDateMin: opts.fundingDateMin,
|
|
674
677
|
fundingDateMax: opts.fundingDateMax,
|
|
675
678
|
raisedAmountMin: opts.raisedAmountMin,
|
|
@@ -694,9 +697,9 @@ import { Command as Command5 } from "commander";
|
|
|
694
697
|
async function listBurns(client, params) {
|
|
695
698
|
return client.get("/v5/burn/list", params);
|
|
696
699
|
}
|
|
697
|
-
async function getBurnDetail(client,
|
|
700
|
+
async function getBurnDetail(client, tokenId, params) {
|
|
698
701
|
return client.get(
|
|
699
|
-
`/v5/burn/${encodeURIComponent(
|
|
702
|
+
`/v5/burn/${encodeURIComponent(tokenId)}`,
|
|
700
703
|
params
|
|
701
704
|
);
|
|
702
705
|
}
|
|
@@ -728,13 +731,13 @@ burnCommand.command("list").description("List all tokens with burn events").opti
|
|
|
728
731
|
});
|
|
729
732
|
output(data, listColumns3, globalOpts.output || "table");
|
|
730
733
|
});
|
|
731
|
-
burnCommand.command("detail <
|
|
734
|
+
burnCommand.command("detail <tokenId>").description("Get burn events for a specific token").option("--start <date>", "Start date (YYYY-MM-DD)").option("--end <date>", "End date (YYYY-MM-DD)").action(async (tokenId, opts, cmd) => {
|
|
732
735
|
const globalOpts = cmd.optsWithGlobals();
|
|
733
736
|
const config = resolveConfig(globalOpts);
|
|
734
737
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
735
738
|
noCache: config.noCache
|
|
736
739
|
});
|
|
737
|
-
const data = await getBurnDetail(client,
|
|
740
|
+
const data = await getBurnDetail(client, tokenId, {
|
|
738
741
|
start: opts.start,
|
|
739
742
|
end: opts.end
|
|
740
743
|
});
|
|
@@ -756,9 +759,9 @@ import { Command as Command6 } from "commander";
|
|
|
756
759
|
async function listBuybacks(client, params) {
|
|
757
760
|
return client.get("/v5/buyback/list", params);
|
|
758
761
|
}
|
|
759
|
-
async function getBuybackDetail(client,
|
|
762
|
+
async function getBuybackDetail(client, tokenId, params) {
|
|
760
763
|
return client.get(
|
|
761
|
-
`/v5/buyback/${encodeURIComponent(
|
|
764
|
+
`/v5/buyback/${encodeURIComponent(tokenId)}`,
|
|
762
765
|
params
|
|
763
766
|
);
|
|
764
767
|
}
|
|
@@ -793,13 +796,13 @@ buybackCommand.command("list").description("List all tokens with buyback events"
|
|
|
793
796
|
});
|
|
794
797
|
output(data, listColumns4, globalOpts.output || "table");
|
|
795
798
|
});
|
|
796
|
-
buybackCommand.command("detail <
|
|
799
|
+
buybackCommand.command("detail <tokenId>").description("Get buyback events for a specific token").option("--start <date>", "Start date (YYYY-MM-DD)").option("--end <date>", "End date (YYYY-MM-DD)").action(async (tokenId, opts, cmd) => {
|
|
797
800
|
const globalOpts = cmd.optsWithGlobals();
|
|
798
801
|
const config = resolveConfig(globalOpts);
|
|
799
802
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
800
803
|
noCache: config.noCache
|
|
801
804
|
});
|
|
802
|
-
const data = await getBuybackDetail(client,
|
|
805
|
+
const data = await getBuybackDetail(client, tokenId, {
|
|
803
806
|
start: opts.start,
|
|
804
807
|
end: opts.end
|
|
805
808
|
});
|
|
@@ -818,15 +821,15 @@ buybackCommand.command("detail <tokenSlug>").description("Get buyback events for
|
|
|
818
821
|
import { Command as Command7 } from "commander";
|
|
819
822
|
|
|
820
823
|
// src/api/emission.ts
|
|
821
|
-
async function getDailyEmission(client,
|
|
824
|
+
async function getDailyEmission(client, tokenId, params) {
|
|
822
825
|
return client.get(
|
|
823
|
-
`/v5/daily-emission/${encodeURIComponent(
|
|
826
|
+
`/v5/daily-emission/${encodeURIComponent(tokenId)}`,
|
|
824
827
|
params
|
|
825
828
|
);
|
|
826
829
|
}
|
|
827
|
-
async function getWeeklyEmission(client,
|
|
830
|
+
async function getWeeklyEmission(client, tokenId, params) {
|
|
828
831
|
return client.get(
|
|
829
|
-
`/v5/emission/${encodeURIComponent(
|
|
832
|
+
`/v5/emission/${encodeURIComponent(tokenId)}`,
|
|
830
833
|
params
|
|
831
834
|
);
|
|
832
835
|
}
|
|
@@ -843,13 +846,13 @@ var columns3 = [
|
|
|
843
846
|
{ key: "totalCumulativeUnlockedAmount", header: "Cumulative", align: "right" }
|
|
844
847
|
];
|
|
845
848
|
var emissionCommand = new Command7("emission").description("Token emission commands");
|
|
846
|
-
emissionCommand.command("daily <
|
|
849
|
+
emissionCommand.command("daily <tokenId>").description("Get daily emission breakdown for a token").option("--start <date>", "Start date (YYYY-MM-DD)").option("--end <date>", "End date (YYYY-MM-DD)").option("--standard-allocation <names>", "Filter by allocation (comma-separated)").option("--page <number>", "Page number").option("--page-size <number>", "Items per page").action(async (tokenId, opts, cmd) => {
|
|
847
850
|
const globalOpts = cmd.optsWithGlobals();
|
|
848
851
|
const config = resolveConfig(globalOpts);
|
|
849
852
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
850
853
|
noCache: config.noCache
|
|
851
854
|
});
|
|
852
|
-
const data = await getDailyEmission(client,
|
|
855
|
+
const data = await getDailyEmission(client, tokenId, {
|
|
853
856
|
start: opts.start,
|
|
854
857
|
end: opts.end,
|
|
855
858
|
standardAllocation: opts.standardAllocation,
|
|
@@ -858,13 +861,13 @@ emissionCommand.command("daily <tokenSlug>").description("Get daily emission bre
|
|
|
858
861
|
});
|
|
859
862
|
output(data, columns3, globalOpts.output || "table");
|
|
860
863
|
});
|
|
861
|
-
emissionCommand.command("weekly <
|
|
864
|
+
emissionCommand.command("weekly <tokenId>").description("Get weekly emission breakdown for a token").option("--start <date>", "Start date (YYYY-MM-DD)").option("--end <date>", "End date (YYYY-MM-DD)").option("--standard-allocation <names>", "Filter by allocation (comma-separated)").option("--page <number>", "Page number").option("--page-size <number>", "Items per page").action(async (tokenId, opts, cmd) => {
|
|
862
865
|
const globalOpts = cmd.optsWithGlobals();
|
|
863
866
|
const config = resolveConfig(globalOpts);
|
|
864
867
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
865
868
|
noCache: config.noCache
|
|
866
869
|
});
|
|
867
|
-
const data = await getWeeklyEmission(client,
|
|
870
|
+
const data = await getWeeklyEmission(client, tokenId, {
|
|
868
871
|
start: opts.start,
|
|
869
872
|
end: opts.end,
|
|
870
873
|
standardAllocation: opts.standardAllocation,
|
|
@@ -878,10 +881,8 @@ emissionCommand.command("weekly <tokenSlug>").description("Get weekly emission b
|
|
|
878
881
|
import { Command as Command8 } from "commander";
|
|
879
882
|
|
|
880
883
|
// src/api/allocation.ts
|
|
881
|
-
async function getAllocation(client,
|
|
882
|
-
return client.get(
|
|
883
|
-
`/v5/allocations/${encodeURIComponent(tokenSlug)}`
|
|
884
|
-
);
|
|
884
|
+
async function getAllocation(client, tokenId) {
|
|
885
|
+
return client.get(`/v5/allocations/${encodeURIComponent(tokenId)}`);
|
|
885
886
|
}
|
|
886
887
|
|
|
887
888
|
// src/commands/allocation.ts
|
|
@@ -894,13 +895,14 @@ var columns4 = [
|
|
|
894
895
|
{ key: "allocationLockedAmount", header: "Locked", align: "right" },
|
|
895
896
|
{ key: "trackedAllocationPercentage", header: "Tracked %", align: "right" }
|
|
896
897
|
];
|
|
897
|
-
var allocationCommand = new Command8("allocation").description("
|
|
898
|
+
var allocationCommand = new Command8("allocation").description("Token allocation commands");
|
|
899
|
+
allocationCommand.command("detail <tokenId>").description("Get standard allocation data for a specific token").action(async (tokenId, _opts, cmd) => {
|
|
898
900
|
const globalOpts = cmd.optsWithGlobals();
|
|
899
901
|
const config = resolveConfig(globalOpts);
|
|
900
902
|
const client = new TokenomistClient(config.apiKey, config.baseUrl, {
|
|
901
903
|
noCache: config.noCache
|
|
902
904
|
});
|
|
903
|
-
const data = await getAllocation(client,
|
|
905
|
+
const data = await getAllocation(client, tokenId);
|
|
904
906
|
const outputMode = globalOpts.output || "table";
|
|
905
907
|
if (outputMode === "json") {
|
|
906
908
|
console.log(JSON.stringify(data, null, 2));
|
|
@@ -970,7 +972,7 @@ authCommand.command("status").description("Show current authentication status").
|
|
|
970
972
|
console.log(`Key: ${maskApiKey(fileKey)}`);
|
|
971
973
|
} else {
|
|
972
974
|
console.log("Not authenticated.");
|
|
973
|
-
console.log(`Run "
|
|
975
|
+
console.log(`Run "tok auth login" to store your API key.`);
|
|
974
976
|
}
|
|
975
977
|
});
|
|
976
978
|
|
|
@@ -979,7 +981,7 @@ import { Command as Command10 } from "commander";
|
|
|
979
981
|
|
|
980
982
|
// src/schema.json
|
|
981
983
|
var schema_default = {
|
|
982
|
-
name: "
|
|
984
|
+
name: "tok",
|
|
983
985
|
version: "0.1.0",
|
|
984
986
|
description: "CLI tool for the Tokenomist API",
|
|
985
987
|
globalOptions: {
|
|
@@ -994,12 +996,12 @@ var schema_default = {
|
|
|
994
996
|
options: {
|
|
995
997
|
"token-id": { flags: "--token-id <ids>", description: "Filter by token IDs (comma-separated)" }
|
|
996
998
|
},
|
|
997
|
-
example: "
|
|
999
|
+
example: "tok token list --output json"
|
|
998
1000
|
},
|
|
999
1001
|
"token search <query>": {
|
|
1000
|
-
description: "Search for tokens by name, symbol, or
|
|
1002
|
+
description: "Search for tokens by name, symbol, or ID",
|
|
1001
1003
|
arguments: { query: { required: true, description: "Search query string" } },
|
|
1002
|
-
example: "
|
|
1004
|
+
example: "tok token search bitcoin --output json"
|
|
1003
1005
|
},
|
|
1004
1006
|
"unlock list": {
|
|
1005
1007
|
description: "List unlock events grouped by token",
|
|
@@ -1014,7 +1016,7 @@ var schema_default = {
|
|
|
1014
1016
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1015
1017
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1016
1018
|
},
|
|
1017
|
-
example: "
|
|
1019
|
+
example: "tok unlock list --min-market-cap 1000000"
|
|
1018
1020
|
},
|
|
1019
1021
|
"unlock upcoming": {
|
|
1020
1022
|
description: "List next upcoming unlock event per token",
|
|
@@ -1029,11 +1031,11 @@ var schema_default = {
|
|
|
1029
1031
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1030
1032
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1031
1033
|
},
|
|
1032
|
-
example: "
|
|
1034
|
+
example: "tok unlock upcoming --output json"
|
|
1033
1035
|
},
|
|
1034
|
-
"unlock events <
|
|
1036
|
+
"unlock events <tokenId>": {
|
|
1035
1037
|
description: "Get unlock events for a specific token",
|
|
1036
|
-
arguments: {
|
|
1038
|
+
arguments: { tokenId: { required: true, description: "Token ID (e.g. solana)" } },
|
|
1037
1039
|
options: {
|
|
1038
1040
|
start: { flags: "--start <date>", description: "Start date (YYYY-MM-DD)" },
|
|
1039
1041
|
end: { flags: "--end <date>", description: "End date (YYYY-MM-DD)" },
|
|
@@ -1041,7 +1043,7 @@ var schema_default = {
|
|
|
1041
1043
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1042
1044
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1043
1045
|
},
|
|
1044
|
-
example: "
|
|
1046
|
+
example: "tok unlock events solana --start 2024-01-01 --end 2024-12-31"
|
|
1045
1047
|
},
|
|
1046
1048
|
"investor list": {
|
|
1047
1049
|
description: "List all investors",
|
|
@@ -1051,7 +1053,7 @@ var schema_default = {
|
|
|
1051
1053
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1052
1054
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1053
1055
|
},
|
|
1054
|
-
example: "
|
|
1056
|
+
example: "tok investor list --output json"
|
|
1055
1057
|
},
|
|
1056
1058
|
"investor detail <investorId>": {
|
|
1057
1059
|
description: "Get investor portfolio and funding rounds",
|
|
@@ -1063,18 +1065,18 @@ var schema_default = {
|
|
|
1063
1065
|
"raised-amount-min": { flags: "--raised-amount-min <amount>", description: "Minimum raised amount" },
|
|
1064
1066
|
"raised-amount-max": { flags: "--raised-amount-max <amount>", description: "Maximum raised amount" }
|
|
1065
1067
|
},
|
|
1066
|
-
example: "
|
|
1068
|
+
example: "tok investor detail 123 --is-lead-investor"
|
|
1067
1069
|
},
|
|
1068
|
-
"fundraising <
|
|
1069
|
-
description: "Get fundraising data for a token",
|
|
1070
|
-
arguments: {
|
|
1070
|
+
"fundraising detail <tokenId>": {
|
|
1071
|
+
description: "Get fundraising data for a specific token",
|
|
1072
|
+
arguments: { tokenId: { required: true, description: "Token ID" } },
|
|
1071
1073
|
options: {
|
|
1072
1074
|
"funding-date-min": { flags: "--funding-date-min <date>", description: "Minimum funding date" },
|
|
1073
1075
|
"funding-date-max": { flags: "--funding-date-max <date>", description: "Maximum funding date" },
|
|
1074
1076
|
"raised-amount-min": { flags: "--raised-amount-min <amount>", description: "Minimum raised amount" },
|
|
1075
1077
|
"raised-amount-max": { flags: "--raised-amount-max <amount>", description: "Maximum raised amount" }
|
|
1076
1078
|
},
|
|
1077
|
-
example: "
|
|
1079
|
+
example: "tok fundraising detail uniswap --output json"
|
|
1078
1080
|
},
|
|
1079
1081
|
"burn list": {
|
|
1080
1082
|
description: "List all tokens with burn data",
|
|
@@ -1083,16 +1085,16 @@ var schema_default = {
|
|
|
1083
1085
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1084
1086
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1085
1087
|
},
|
|
1086
|
-
example: "
|
|
1088
|
+
example: "tok burn list --output json"
|
|
1087
1089
|
},
|
|
1088
|
-
"burn detail <
|
|
1090
|
+
"burn detail <tokenId>": {
|
|
1089
1091
|
description: "Get burn events for a specific token",
|
|
1090
|
-
arguments: {
|
|
1092
|
+
arguments: { tokenId: { required: true, description: "Token ID" } },
|
|
1091
1093
|
options: {
|
|
1092
1094
|
start: { flags: "--start <date>", description: "Start date" },
|
|
1093
1095
|
end: { flags: "--end <date>", description: "End date" }
|
|
1094
1096
|
},
|
|
1095
|
-
example: "
|
|
1097
|
+
example: "tok burn detail solana --start 2024-01-01"
|
|
1096
1098
|
},
|
|
1097
1099
|
"buyback list": {
|
|
1098
1100
|
description: "List all tokens with buyback data",
|
|
@@ -1101,20 +1103,20 @@ var schema_default = {
|
|
|
1101
1103
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1102
1104
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1103
1105
|
},
|
|
1104
|
-
example: "
|
|
1106
|
+
example: "tok buyback list --output json"
|
|
1105
1107
|
},
|
|
1106
|
-
"buyback detail <
|
|
1108
|
+
"buyback detail <tokenId>": {
|
|
1107
1109
|
description: "Get buyback events for a specific token",
|
|
1108
|
-
arguments: {
|
|
1110
|
+
arguments: { tokenId: { required: true, description: "Token ID" } },
|
|
1109
1111
|
options: {
|
|
1110
1112
|
start: { flags: "--start <date>", description: "Start date" },
|
|
1111
1113
|
end: { flags: "--end <date>", description: "End date" }
|
|
1112
1114
|
},
|
|
1113
|
-
example: "
|
|
1115
|
+
example: "tok buyback detail solana --output json"
|
|
1114
1116
|
},
|
|
1115
|
-
"emission daily <
|
|
1117
|
+
"emission daily <tokenId>": {
|
|
1116
1118
|
description: "Get daily emission data for a token",
|
|
1117
|
-
arguments: {
|
|
1119
|
+
arguments: { tokenId: { required: true, description: "Token ID" } },
|
|
1118
1120
|
options: {
|
|
1119
1121
|
start: { flags: "--start <date>", description: "Start date" },
|
|
1120
1122
|
end: { flags: "--end <date>", description: "End date" },
|
|
@@ -1122,11 +1124,11 @@ var schema_default = {
|
|
|
1122
1124
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1123
1125
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1124
1126
|
},
|
|
1125
|
-
example: "
|
|
1127
|
+
example: "tok emission daily arbitrum --start 2024-08-01 --end 2024-08-31"
|
|
1126
1128
|
},
|
|
1127
|
-
"emission weekly <
|
|
1129
|
+
"emission weekly <tokenId>": {
|
|
1128
1130
|
description: "Get weekly emission data for a token",
|
|
1129
|
-
arguments: {
|
|
1131
|
+
arguments: { tokenId: { required: true, description: "Token ID" } },
|
|
1130
1132
|
options: {
|
|
1131
1133
|
start: { flags: "--start <date>", description: "Start date" },
|
|
1132
1134
|
end: { flags: "--end <date>", description: "End date" },
|
|
@@ -1134,34 +1136,34 @@ var schema_default = {
|
|
|
1134
1136
|
page: { flags: "--page <number>", description: "Page number" },
|
|
1135
1137
|
"page-size": { flags: "--page-size <number>", description: "Items per page" }
|
|
1136
1138
|
},
|
|
1137
|
-
example: "
|
|
1139
|
+
example: "tok emission weekly arbitrum --start 2024-01-01 --end 2024-06-30"
|
|
1138
1140
|
},
|
|
1139
|
-
"allocation <
|
|
1140
|
-
description: "Get standard allocation
|
|
1141
|
-
arguments: {
|
|
1142
|
-
example: "
|
|
1141
|
+
"allocation detail <tokenId>": {
|
|
1142
|
+
description: "Get standard allocation data for a specific token",
|
|
1143
|
+
arguments: { tokenId: { required: true, description: "Token ID" } },
|
|
1144
|
+
example: "tok allocation detail solana --output json"
|
|
1143
1145
|
},
|
|
1144
1146
|
"auth login": {
|
|
1145
1147
|
description: "Store API key",
|
|
1146
1148
|
options: {
|
|
1147
1149
|
"api-key": { flags: "--api-key <key>", description: "API key (prompts if not provided)" }
|
|
1148
1150
|
},
|
|
1149
|
-
example: "
|
|
1151
|
+
example: "tok auth login"
|
|
1150
1152
|
},
|
|
1151
1153
|
"auth logout": {
|
|
1152
1154
|
description: "Remove stored API key",
|
|
1153
|
-
example: "
|
|
1155
|
+
example: "tok auth logout"
|
|
1154
1156
|
},
|
|
1155
1157
|
"auth status": {
|
|
1156
1158
|
description: "Show current auth status",
|
|
1157
|
-
example: "
|
|
1159
|
+
example: "tok auth status"
|
|
1158
1160
|
},
|
|
1159
1161
|
schema: {
|
|
1160
1162
|
description: "Print full command schema as JSON",
|
|
1161
1163
|
options: {
|
|
1162
1164
|
pretty: { flags: "--pretty", description: "Pretty-print with 2-space indent" }
|
|
1163
1165
|
},
|
|
1164
|
-
example: "
|
|
1166
|
+
example: "tok schema --pretty"
|
|
1165
1167
|
}
|
|
1166
1168
|
}
|
|
1167
1169
|
};
|
|
@@ -1172,6 +1174,58 @@ var schemaCommand = new Command10("schema").description("Print full command sche
|
|
|
1172
1174
|
console.log(JSON.stringify(schema_default, null, indent));
|
|
1173
1175
|
});
|
|
1174
1176
|
|
|
1177
|
+
// src/banner.ts
|
|
1178
|
+
var BANNER_COLOR_OPEN = "\x1B[38;2;197;16;82m";
|
|
1179
|
+
var COLOR_RESET = "\x1B[0m";
|
|
1180
|
+
var BANNER = `\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
1181
|
+
\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D
|
|
1182
|
+
\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551
|
|
1183
|
+
\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551 \u2588\u2588\u2551
|
|
1184
|
+
\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551
|
|
1185
|
+
\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D `;
|
|
1186
|
+
var WELCOME_LINES = [
|
|
1187
|
+
"Welcome to tokenomist-cli v0.1.0",
|
|
1188
|
+
"Query token unlocks, emissions, fundraising, burns, and buybacks from the terminal.",
|
|
1189
|
+
"",
|
|
1190
|
+
" Getting started:",
|
|
1191
|
+
"",
|
|
1192
|
+
" $ tok auth login # store your API key",
|
|
1193
|
+
" $ tok token list # list all tracked tokens",
|
|
1194
|
+
" $ tok token search bitcoin # query tokens by name / symbol",
|
|
1195
|
+
" $ npx skills add tokenomist-ai/tokenomist-cli # install AI coding skills",
|
|
1196
|
+
" $ tok --help # for view more commands",
|
|
1197
|
+
"",
|
|
1198
|
+
"Docs: https://docs.tokenomist.ai/",
|
|
1199
|
+
"Site: https://tokenomist.ai",
|
|
1200
|
+
"Issues: https://github.com/tokenomist-ai/tokenomist-cli/issues"
|
|
1201
|
+
];
|
|
1202
|
+
function shouldUseColor(stream) {
|
|
1203
|
+
if (process.env.NO_COLOR !== void 0 && process.env.NO_COLOR !== "") return false;
|
|
1204
|
+
if (process.env.FORCE_COLOR === "0") return false;
|
|
1205
|
+
return Boolean(stream.isTTY);
|
|
1206
|
+
}
|
|
1207
|
+
function frame(lines, colored) {
|
|
1208
|
+
const innerWidth = Math.max(...lines.map((l) => l.length));
|
|
1209
|
+
const horizontal = "\u2500".repeat(innerWidth + 2);
|
|
1210
|
+
const open = colored ? BANNER_COLOR_OPEN : "";
|
|
1211
|
+
const close = colored ? COLOR_RESET : "";
|
|
1212
|
+
const top = `${open}\u256D${horizontal}\u256E${close}`;
|
|
1213
|
+
const bottom = `${open}\u2570${horizontal}\u256F${close}`;
|
|
1214
|
+
const side = `${open}\u2502${close}`;
|
|
1215
|
+
const middle = lines.map((l) => `${side} ${l.padEnd(innerWidth)} ${side}`);
|
|
1216
|
+
return [top, ...middle, bottom].join("\n");
|
|
1217
|
+
}
|
|
1218
|
+
function printWelcome(stream) {
|
|
1219
|
+
const colored = shouldUseColor(stream);
|
|
1220
|
+
const banner = colored ? `${BANNER_COLOR_OPEN}${BANNER}${COLOR_RESET}` : BANNER;
|
|
1221
|
+
stream.write(`${banner}
|
|
1222
|
+
|
|
1223
|
+
`);
|
|
1224
|
+
stream.write(`${frame(WELCOME_LINES, colored)}
|
|
1225
|
+
|
|
1226
|
+
`);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1175
1229
|
// src/index.ts
|
|
1176
1230
|
import { spawn } from "child_process";
|
|
1177
1231
|
import { readFileSync as readFileSync3 } from "fs";
|
|
@@ -1195,6 +1249,14 @@ Update available: ${data.current} \u2192 ${data.latest} (npm i -g @tokenomist-a
|
|
|
1195
1249
|
} catch {
|
|
1196
1250
|
}
|
|
1197
1251
|
}
|
|
1252
|
+
function showWelcomeBanner() {
|
|
1253
|
+
if (process.env.TOKENOMIST_NO_BANNER === "1") return false;
|
|
1254
|
+
if (process.env.CI === "1") return false;
|
|
1255
|
+
if (!process.stderr.isTTY) return false;
|
|
1256
|
+
if (process.argv.length > 2) return false;
|
|
1257
|
+
printWelcome(process.stderr);
|
|
1258
|
+
return true;
|
|
1259
|
+
}
|
|
1198
1260
|
function spawnUpdateCheck() {
|
|
1199
1261
|
if (process.env.NO_UPDATE_NOTIFIER === "1" || process.env.CI === "1") return;
|
|
1200
1262
|
try {
|
|
@@ -1204,7 +1266,7 @@ function spawnUpdateCheck() {
|
|
|
1204
1266
|
}
|
|
1205
1267
|
}
|
|
1206
1268
|
var program = new Command11();
|
|
1207
|
-
program.name("
|
|
1269
|
+
program.name("tok").description(
|
|
1208
1270
|
"CLI tool for the Tokenomist API \u2014 query token unlocks, emissions, fundraising, burns, and buybacks"
|
|
1209
1271
|
).version("0.1.0").option("-k, --api-key <key>", "API key (overrides env/config)").option("-o, --output <format>", "Output format: table, json, csv", "table").option("--base-url <url>", "API base URL").option("--no-cache", "Bypass response cache");
|
|
1210
1272
|
program.addCommand(tokenCommand);
|
|
@@ -1217,6 +1279,10 @@ program.addCommand(emissionCommand);
|
|
|
1217
1279
|
program.addCommand(allocationCommand);
|
|
1218
1280
|
program.addCommand(authCommand);
|
|
1219
1281
|
program.addCommand(schemaCommand);
|
|
1282
|
+
if (showWelcomeBanner()) {
|
|
1283
|
+
spawnUpdateCheck();
|
|
1284
|
+
process.exit(0);
|
|
1285
|
+
}
|
|
1220
1286
|
showUpdateNotification();
|
|
1221
1287
|
program.parseAsync(process.argv).then(() => {
|
|
1222
1288
|
spawnUpdateCheck();
|