@spectratools/defillama-cli 0.2.0 → 0.4.2

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.
Files changed (4) hide show
  1. package/README.md +101 -0
  2. package/dist/cli.js +575 -60
  3. package/dist/index.js +581 -60
  4. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # @spectratools/defillama-cli
2
+
3
+ Query DefiLlama API data from the command line — TVL, volume, fees, and token prices.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add -g @spectratools/defillama-cli
9
+ ```
10
+
11
+ ## LLM / Agent Discovery
12
+
13
+ ```bash
14
+ # Emit machine-readable command metadata
15
+ defillama-cli --llms
16
+
17
+ # Register as a reusable local skill for agent runtimes
18
+ defillama-cli skills add
19
+
20
+ # Register as an MCP server entry
21
+ defillama-cli mcp add
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ No API key required — DefiLlama is a free, public API.
27
+
28
+ ```bash
29
+ # Top 10 protocols by TVL
30
+ defillama-cli tvl protocols --limit 10
31
+
32
+ # Top chains by TVL
33
+ defillama-cli tvl chains --limit 10
34
+
35
+ # Protocol detail with chain breakdown
36
+ defillama-cli tvl protocol aave
37
+
38
+ # TVL history for a protocol
39
+ defillama-cli tvl history aave --days 7
40
+
41
+ # Top DEXes by 24h volume
42
+ defillama-cli volume dexs --limit 10
43
+
44
+ # Volume for a specific DEX
45
+ defillama-cli volume protocol uniswap
46
+
47
+ # DEX aggregators ranked by volume
48
+ defillama-cli volume aggregators --limit 10
49
+
50
+ # Top protocols by fees
51
+ defillama-cli fees overview --limit 10
52
+
53
+ # Fee detail for a protocol
54
+ defillama-cli fees protocol aave
55
+
56
+ # Current token price
57
+ defillama-cli prices current ethereum:0xdAC17F958D2ee523a2206206994597C13D831ec7
58
+
59
+ # Historical token price
60
+ defillama-cli prices historical ethereum:0xdAC17F958D2ee523a2206206994597C13D831ec7 --date 2025-01-01
61
+
62
+ # Price chart
63
+ defillama-cli prices chart ethereum:0xdAC17F958D2ee523a2206206994597C13D831ec7 --start 2025-01-01 --period 1d
64
+ ```
65
+
66
+ ## Command Groups
67
+
68
+ | Group | Description |
69
+ |-------|-------------|
70
+ | `tvl` | Total value locked — protocols, chains, protocol detail, history |
71
+ | `volume` | DEX trading volume — dexs, protocol detail, aggregators |
72
+ | `fees` | Protocol fees and revenue — overview, protocol detail |
73
+ | `prices` | Token prices — current, historical, chart |
74
+
75
+ ## Chain Filtering
76
+
77
+ Several commands support `--chain` to filter by blockchain:
78
+
79
+ ```bash
80
+ defillama-cli tvl protocols --chain ethereum --limit 10
81
+ defillama-cli volume dexs --chain abstract --limit 10
82
+ defillama-cli fees overview --chain base --limit 10
83
+ ```
84
+
85
+ ## Output Modes
86
+
87
+ ```bash
88
+ # Human-readable table output (default)
89
+ defillama-cli tvl protocols --limit 5
90
+
91
+ # JSON output for pipelines
92
+ defillama-cli tvl protocols --limit 5 --json
93
+ ```
94
+
95
+ ## Documentation
96
+
97
+ Full documentation: [spectratools.dev/defillama](https://spectratools.dev/defillama/)
98
+
99
+ ## License
100
+
101
+ MIT