hive-intelligence 1.0.1 → 1.1.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 (42) hide show
  1. package/README.md +332 -108
  2. package/build/{auth-PVT4GTAD.js → auth-77MKFFBQ.js} +3 -3
  3. package/build/{auth-PVT4GTAD.js.map → auth-77MKFFBQ.js.map} +1 -1
  4. package/build/{chunk-X7ETBCBP.js → chunk-CGXVV6WR.js} +2 -196
  5. package/build/chunk-CGXVV6WR.js.map +1 -0
  6. package/build/{chunk-FAFUYZQS.js → chunk-CP3FXEQA.js} +6 -5
  7. package/build/chunk-CP3FXEQA.js.map +1 -0
  8. package/build/{chunk-N43VRMVB.js → chunk-DTUDM6HX.js} +2 -2
  9. package/build/{chunk-IWBWPHYY.js → chunk-RRI526CJ.js} +3 -3
  10. package/build/{chunk-IWBWPHYY.js.map → chunk-RRI526CJ.js.map} +1 -1
  11. package/build/cli.js +27 -26
  12. package/build/cli.js.map +1 -1
  13. package/build/{completion-SBTSXTR3.js → completion-J6HFY6PS.js} +2 -2
  14. package/build/{config-2VDB2ZHE.js → config-ANFERP7A.js} +4 -5
  15. package/build/config-ANFERP7A.js.map +1 -0
  16. package/build/{doctor-A76Q4U4K.js → doctor-7WZMCQC7.js} +4 -4
  17. package/build/{errors-HRGXEUZR.js → errors-U6UZWVSD.js} +2 -2
  18. package/build/format-CVLLK6GD.js +75 -0
  19. package/build/format-CVLLK6GD.js.map +1 -0
  20. package/build/{init-YOJK6CH2.js → init-CAVIFVSH.js} +2 -2
  21. package/build/{init-YOJK6CH2.js.map → init-CAVIFVSH.js.map} +1 -1
  22. package/build/{namespace-7SBV4G7R.js → namespace-7JWWBWBL.js} +2 -2
  23. package/build/{output-6TJ3JTZ7.js → output-7PGQWJY2.js} +2 -2
  24. package/build/server.js +1 -209
  25. package/build/server.js.map +1 -1
  26. package/build/{tools-WYOZZHHG.js → tools-VRRMBCZQ.js} +12 -12
  27. package/build/tools-VRRMBCZQ.js.map +1 -0
  28. package/build/{watch-P2QWGFYV.js → watch-A75SVIQ6.js} +3 -3
  29. package/package.json +41 -7
  30. package/build/chunk-FAFUYZQS.js.map +0 -1
  31. package/build/chunk-X7ETBCBP.js.map +0 -1
  32. package/build/config-2VDB2ZHE.js.map +0 -1
  33. package/build/format-4OIUGZKY.js +0 -43
  34. package/build/format-4OIUGZKY.js.map +0 -1
  35. package/build/tools-WYOZZHHG.js.map +0 -1
  36. /package/build/{chunk-N43VRMVB.js.map → chunk-DTUDM6HX.js.map} +0 -0
  37. /package/build/{completion-SBTSXTR3.js.map → completion-J6HFY6PS.js.map} +0 -0
  38. /package/build/{doctor-A76Q4U4K.js.map → doctor-7WZMCQC7.js.map} +0 -0
  39. /package/build/{errors-HRGXEUZR.js.map → errors-U6UZWVSD.js.map} +0 -0
  40. /package/build/{namespace-7SBV4G7R.js.map → namespace-7JWWBWBL.js.map} +0 -0
  41. /package/build/{output-6TJ3JTZ7.js.map → output-7PGQWJY2.js.map} +0 -0
  42. /package/build/{watch-P2QWGFYV.js.map → watch-A75SVIQ6.js.map} +0 -0
package/README.md CHANGED
@@ -1,56 +1,87 @@
1
+ <div align="center">
2
+
1
3
  # Hive Intelligence
2
4
 
3
- MCP server and CLI for cryptocurrency, Web3, and financial market analytics. Access **389 tools** across **14 categories** from your AI assistant or terminal.
5
+ **Institutional-grade crypto market infrastructure for AI agents.**
4
6
 
5
- ## Install
7
+ One MCP server. [376+ live tools](https://mcp.hiveintelligence.xyz/api/v1/tools). 10 categories. 9 data providers — [CoinGecko, DefiLlama, Moralis, GoldRush, Codex, GoPlus, Helius, Tenderly, and CCXT](#powered-by) normalized into a single agent-ready surface, so your agent gets prices, DeFi, wallets, security, and DEX flows in one request instead of nine APIs. Built for Claude, Cursor, ChatGPT, and any agent that speaks Model Context Protocol.
6
8
 
7
- ```bash
8
- npm install -g hive-intelligence
9
- ```
9
+ [![npm version](https://img.shields.io/npm/v/hive-intelligence.svg?color=blue&label=npm)](https://www.npmjs.com/package/hive-intelligence)
10
+ [![npm downloads](https://img.shields.io/npm/dw/hive-intelligence.svg?color=blue&label=downloads%2Fweek)](https://www.npmjs.com/package/hive-intelligence)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
12
+ [![MCP](https://img.shields.io/badge/MCP-compatible-orange.svg)](https://modelcontextprotocol.io)
13
+ [![Docs](https://img.shields.io/badge/docs-hiveintelligence.xyz-purple.svg)](https://hiveintelligence.xyz)
10
14
 
11
- This gives you two commands:
15
+ [**Quick Start**](#quickstart) · [**Example prompts**](#example-prompts) · [**Tool catalog**](#tool-catalog) · [**FAQ**](#faq) · [**Get an API key**](https://hiveintelligence.xyz/dashboard/keys)
12
16
 
13
- | Command | Purpose |
14
- |---------|---------|
15
- | `hive-intelligence` | MCP stdio server for AI clients (Claude Desktop, Cursor, VS Code, etc.) |
16
- | `hive` | CLI tool for terminal usage |
17
+ </div>
17
18
 
18
- > **Note:** `hive-intelligence` is an MCP stdio server — running it directly opens a stdio transport that waits for JSON-RPC messages. It is not interactive and does not accept subcommands. For terminal usage, use the `hive` CLI.
19
+ > **New here?** [Try the Free Demo](https://hiveintelligence.xyz/dashboard/keys) (10K credits/month, no card required) · [See install guides](https://hiveintelligence.xyz/install) · [Run a test prompt](#example-prompts)
19
20
 
20
- ### Run without installing
21
+ ---
21
22
 
22
- The CLI is a separate bin in the same package, so with `npx` you must select it explicitly via `-p`:
23
+ ## What is Hive Intelligence?
23
24
 
24
- ```bash
25
- # Run the CLI via npx (note: -p selects the package, `hive` is the bin)
26
- HIVE_API_KEY=hive_live_... npx -y -p hive-intelligence hive --help
27
- HIVE_API_KEY=hive_live_... npx -y -p hive-intelligence hive market price --ids bitcoin --vs usd
25
+ Hive Intelligence is a managed MCP server that gives AI agents structured, runtime access to live cryptocurrency market data, DeFi activity, wallet positions, token security signals, DEX flows, NFT analytics, prediction markets, and on-chain network data. One API key, one tool surface, nine upstream providers normalized into a single agent-ready schema.
26
+
27
+ Stop stitching CoinGecko + DefiLlama + Moralis + GoPlus + half a dozen others. Point your agent at Hive once, get every crypto answer it needs.
28
+
29
+ **Used by:** AI agents in Claude Desktop, Cursor, ChatGPT Desktop, Claude Code, Windsurf, VS Code (Copilot Chat), Gemini CLI, and any client that speaks MCP or REST.
30
+
31
+ ## Powered by
32
+
33
+ Nine production data providers, normalized into one tool surface:
28
34
 
29
- # Plain `npx -y hive-intelligence` launches the MCP stdio server, not the CLI.
30
35
  ```
36
+ CoinGecko · DefiLlama · Moralis · GoldRush · Codex · GoPlus · Helius · Tenderly · CCXT
37
+ ```
38
+
39
+ | Provider | Coverage |
40
+ |----------|----------|
41
+ | **CoinGecko** | Market data, prices, OHLCV, exchanges, NFT collections |
42
+ | **DefiLlama** | TVL, yield pools, protocol metrics, bridges, treasuries |
43
+ | **Moralis** | Wallet analytics, NFT data, token transfers, EVM coverage |
44
+ | **GoldRush** (Covalent) | Multi-chain wallet activity, transaction history, 100+ chains |
45
+ | **Codex** (Defined.fi) | DEX pair OHLCV, prediction markets (Polymarket) |
46
+ | **GoPlus** | Token security, honeypot detection, contract risk, malicious-address reputation |
47
+ | **Helius** | Solana RPC, DAS, compressed NFTs, priority fees |
48
+ | **Tenderly** | EVM transaction simulation, contract decode, debugging |
49
+ | **CCXT** | Centralized exchange data, order books, derivatives, funding rates |
31
50
 
32
- ## API Key
51
+ ## Quickstart
33
52
 
34
- An API key is required. Get one at [hiveintelligence.xyz](https://hiveintelligence.xyz) and set it as an environment variable:
53
+ The fastest way to use Hive is `npx`. No install required.
35
54
 
36
55
  ```bash
37
- export HIVE_API_KEY="hive_live_..."
56
+ HIVE_API_KEY=hive_live_... npx -y -p hive-intelligence hive market price --ids bitcoin --vs usd
38
57
  ```
39
58
 
40
- Or use the CLI login:
59
+ Get an API key at [hiveintelligence.xyz/dashboard/keys](https://hiveintelligence.xyz/dashboard/keys). The free **Demo** plan ships with 10,000 monthly credits and access to every tool — no credit card required.
60
+
61
+ ### What you get
62
+
63
+ ```
64
+ hive-intelligence → MCP stdio server. Plug into Claude Desktop, Cursor, VS Code, etc.
65
+ hive → CLI. Run any tool from your terminal or scripts.
66
+ ```
67
+
68
+ `hive-intelligence` is a stdio transport. Running it directly opens a JSON-RPC channel and waits for an MCP client. It is **not** an interactive command. For terminal use, use the `hive` CLI.
69
+
70
+ ### Install globally (optional)
41
71
 
42
72
  ```bash
43
- hive auth login
73
+ npm install -g hive-intelligence
44
74
  ```
45
75
 
46
- ## MCP Server Setup
76
+ After this, both `hive-intelligence` and `hive` are on your `PATH`.
47
77
 
48
- ### Claude Desktop
78
+ ## Connect to your AI client
79
+
80
+ Drop Hive into any MCP-compatible client. Replace `hive_live_...` with your API key.
49
81
 
50
- Add to your config file:
82
+ ### Claude Desktop
51
83
 
52
- - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
53
- - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
84
+ `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
54
85
 
55
86
  ```json
56
87
  {
@@ -58,9 +89,7 @@ Add to your config file:
58
89
  "hive": {
59
90
  "command": "npx",
60
91
  "args": ["-y", "hive-intelligence"],
61
- "env": {
62
- "HIVE_API_KEY": "hive_live_..."
63
- }
92
+ "env": { "HIVE_API_KEY": "hive_live_..." }
64
93
  }
65
94
  }
66
95
  }
@@ -68,7 +97,7 @@ Add to your config file:
68
97
 
69
98
  ### Cursor
70
99
 
71
- Add to `.cursor/mcp.json`:
100
+ `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):
72
101
 
73
102
  ```json
74
103
  {
@@ -76,17 +105,15 @@ Add to `.cursor/mcp.json`:
76
105
  "hive": {
77
106
  "command": "npx",
78
107
  "args": ["-y", "hive-intelligence"],
79
- "env": {
80
- "HIVE_API_KEY": "hive_live_..."
81
- }
108
+ "env": { "HIVE_API_KEY": "hive_live_..." }
82
109
  }
83
110
  }
84
111
  }
85
112
  ```
86
113
 
87
- ### VS Code
114
+ ### VS Code (GitHub Copilot Chat)
88
115
 
89
- Add to `.vscode/mcp.json`:
116
+ `.vscode/mcp.json`:
90
117
 
91
118
  ```json
92
119
  {
@@ -95,9 +122,7 @@ Add to `.vscode/mcp.json`:
95
122
  "type": "stdio",
96
123
  "command": "npx",
97
124
  "args": ["-y", "hive-intelligence"],
98
- "env": {
99
- "HIVE_API_KEY": "hive_live_..."
100
- }
125
+ "env": { "HIVE_API_KEY": "hive_live_..." }
101
126
  }
102
127
  }
103
128
  }
@@ -106,67 +131,235 @@ Add to `.vscode/mcp.json`:
106
131
  ### Claude Code
107
132
 
108
133
  ```bash
109
- claude mcp add hive-intelligence -e HIVE_API_KEY=hive_live_... -- npx -y hive-intelligence
134
+ claude mcp add hive -e HIVE_API_KEY=hive_live_... -- npx -y hive-intelligence
110
135
  ```
111
136
 
112
- ### Remote MCP Server
137
+ ### Windsurf
113
138
 
114
- For clients that support HTTP transport:
139
+ `~/.codeium/windsurf/mcp_config.json`:
140
+
141
+ ```json
142
+ {
143
+ "mcpServers": {
144
+ "hive": {
145
+ "command": "npx",
146
+ "args": ["-y", "hive-intelligence"],
147
+ "env": { "HIVE_API_KEY": "hive_live_..." }
148
+ }
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### Gemini CLI
154
+
155
+ `~/.gemini/settings.json`:
156
+
157
+ ```json
158
+ {
159
+ "mcpServers": {
160
+ "hive": {
161
+ "command": "npx",
162
+ "args": ["-y", "hive-intelligence"],
163
+ "env": { "HIVE_API_KEY": "hive_live_..." }
164
+ }
165
+ }
166
+ }
167
+ ```
168
+
169
+ ### Remote MCP (HTTP)
170
+
171
+ For clients that support Streamable HTTP transport (skips the local Node process entirely):
115
172
 
116
173
  ```
117
- URL: https://mcp.hiveintelligence.xyz/mcp
118
- Headers: { "Authorization": "Bearer hive_live_..." }
174
+ URL: https://mcp.hiveintelligence.xyz/mcp
175
+ Headers: Authorization: Bearer hive_live_...
119
176
  ```
120
177
 
121
- More details: https://hiveintelligence.xyz/crypto-mcp
178
+ Full setup guides: [hiveintelligence.xyz/install](https://hiveintelligence.xyz/install)
179
+
180
+ ## Example prompts
122
181
 
123
- ## CLI Usage
182
+ Once Hive is connected, talk to your AI client in plain English. Every prompt below maps to a real tool call you don't have to write.
183
+
184
+ **Market data**
185
+
186
+ ```
187
+ What's the price of BTC, ETH, and SOL right now in USD?
188
+ Show me the top 10 coins by market cap with 24h change.
189
+ What's the OHLCV for ETH/USD over the last 30 days?
190
+ Which coins gained the most this week?
191
+ What are the current funding rates for BTC perps across exchanges?
192
+ ```
124
193
 
125
- The `hive` CLI is a lightweight client that talks to the Hive API. Set `HIVE_API_KEY` (or run `hive auth login`) before making calls.
194
+ **DeFi**
195
+
196
+ ```
197
+ What's the current TVL of Aave?
198
+ List the top 20 yield pools above 10% APY on Ethereum.
199
+ Compare Uniswap and PancakeSwap fee revenue this month.
200
+ Show me protocol TVL rankings for Solana.
201
+ Which bridges have the highest weekly volume?
202
+ ```
203
+
204
+ **Wallets and portfolios**
205
+
206
+ ```
207
+ Show me the portfolio of vitalik.eth across all chains.
208
+ What tokens does this wallet hold? 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
209
+ Show DeFi positions for this address on Arbitrum.
210
+ What was this wallet's PnL over the last 30 days?
211
+ List recent NFT trades from this wallet.
212
+ ```
213
+
214
+ **Token security**
215
+
216
+ ```
217
+ Is this token a honeypot? 0x...
218
+ Run a rugpull check on $PEPE.
219
+ Show me the top holders of this token and how concentrated they are.
220
+ What approvals does this wallet have? Are any risky?
221
+ Simulate this transaction before I sign it: <tx hash or calldata>
222
+ ```
223
+
224
+ **On-chain DEX**
225
+
226
+ ```
227
+ What are the trending pairs on Uniswap V3 right now?
228
+ Show me top trades on Solana DEXes in the last hour.
229
+ What's the liquidity profile of this pool? <pool address>
230
+ Find pairs that whales are accumulating today.
231
+ ```
232
+
233
+ **NFT analytics**
234
+
235
+ ```
236
+ What's the floor price of CryptoPunks? Show 24h trend.
237
+ Compare Bored Apes and Pudgy Penguins on volume.
238
+ Show me the trait floor for this collection.
239
+ List recent compressed NFT mints on Solana.
240
+ ```
241
+
242
+ **Prediction markets**
243
+
244
+ ```
245
+ What are the most-traded events on Polymarket this week?
246
+ Show me the top traders on Polymarket by P&L.
247
+ What's the implied probability of this market right now?
248
+ Trace this trader's position history.
249
+ ```
250
+
251
+ **Network infrastructure**
252
+
253
+ ```
254
+ What are current gas prices on Ethereum, Arbitrum, and Base?
255
+ Show me Solana priority fees right now.
256
+ List supported chains and their RPC status.
257
+ ```
258
+
259
+ ## Tool catalog
260
+
261
+ 376+ tools across 10 categories. Every tool is callable directly via `hive tools call <name>` or through the MCP `tools/call` method.
262
+
263
+ | # | Category | Tools | What's inside |
264
+ |---|----------|-------|---------------|
265
+ | 1 | **Market Data and Price** | 70+ | Prices, OHLCV, market caps, derivatives, funding rates, stablecoins, gainers/losers, exchange tickers |
266
+ | 2 | **On-Chain DEX & Pool Analytics** | 58+ | DEX pools, liquidity, trending pairs, swap history, bridges, GoldRush XY=K analytics |
267
+ | 3 | **Portfolio & Wallet** | 49+ | Balances, PnL, DeFi positions, swap history, NFT holdings, multi-chain history |
268
+ | 4 | **Token & Contract Data** | 44+ | Token metadata, holders, top traders, ENS resolution, treasury tracking, transfers |
269
+ | 5 | **DeFi Protocol Analytics** | 21+ | TVL, fees, yield farming, chain metrics, treasuries, emissions |
270
+ | 6 | **NFT Analytics** | 41+ | Collection data, floors, market charts, NFT pools, trait metadata, sales |
271
+ | 7 | **Security & Risk Analysis** | 37+ | Honeypot detection, rugpull checks, approval risk, Tenderly simulation, gas estimation |
272
+ | 8 | **Network & Infrastructure** | 20+ | Chain health, blocks, gas prices, supported networks, event logs |
273
+ | 9 | **Search & Discovery** | 10+ | Cross-provider search, trending coins, categories, token discovery |
274
+ | 10 | **Prediction Markets** | 19+ | Polymarket events, traders, outcome prices, trade history, market stats |
275
+
276
+ Live category endpoints (for clients that want a smaller scoped tool surface):
277
+
278
+ ```
279
+ https://mcp.hiveintelligence.xyz/hive_market_data/mcp
280
+ https://mcp.hiveintelligence.xyz/hive_onchain_dex/mcp
281
+ https://mcp.hiveintelligence.xyz/hive_portfolio_wallet/mcp
282
+ https://mcp.hiveintelligence.xyz/hive_token_contract/mcp
283
+ https://mcp.hiveintelligence.xyz/hive_defi_protocol/mcp
284
+ https://mcp.hiveintelligence.xyz/hive_nft_analytics/mcp
285
+ https://mcp.hiveintelligence.xyz/hive_security_risk/mcp
286
+ https://mcp.hiveintelligence.xyz/hive_network_infrastructure/mcp
287
+ https://mcp.hiveintelligence.xyz/hive_search_discovery/mcp
288
+ https://mcp.hiveintelligence.xyz/hive_prediction_markets/mcp
289
+ ```
290
+
291
+ Full live tool list: `https://mcp.hiveintelligence.xyz/api/v1/tools` (requires API key) or [hiveintelligence.xyz/tools/live-catalog](https://hiveintelligence.xyz/tools/live-catalog).
292
+
293
+ ## Why Hive over a single-provider MCP?
294
+
295
+ | | Hive | CoinGecko MCP | Moralis MCP | DefiLlama MCP | GoPlus only |
296
+ |---|---|---|---|---|---|
297
+ | Providers normalized | **9** | 1 | 1 | 1 | 1 |
298
+ | Categories | **10** | 2 | 3 | 1 | 1 |
299
+ | Total tools | **376+** | ~50 | ~60 | ~15 | ~20 |
300
+ | Market data | ✓ | ✓ | partial | – | – |
301
+ | DeFi TVL + yields | ✓ | – | – | ✓ | – |
302
+ | Wallet portfolio | ✓ | – | ✓ | – | – |
303
+ | Pre-signing security | **✓** | – | – | – | ✓ |
304
+ | DEX pool analytics | ✓ | – | partial | – | – |
305
+ | Prediction markets | **✓** | – | – | – | – |
306
+ | Solana depth (DAS) | ✓ | – | – | – | – |
307
+ | Managed (no ops) | ✓ | ✓ | partial | varies | varies |
308
+
309
+ Single-provider MCPs win on niche depth. Hive wins when the agent needs **broad crypto context in one request** — prices + DeFi + wallet + security + DEX in a single conversation, without the user (or the agent) figuring out which tool lives in which provider.
310
+
311
+ ## CLI
312
+
313
+ The `hive` CLI is a thin terminal client over the same Hive API. Set `HIVE_API_KEY` (or `hive auth login` once) and you're done.
126
314
 
127
315
  ```bash
128
- # Get Bitcoin price
129
- hive market price --ids bitcoin --vs usd
316
+ # Crypto prices
317
+ hive market price --ids bitcoin,ethereum,solana --vs usd
130
318
 
131
- # Top coins by market cap
132
- hive market top --vs usd --limit 10
319
+ # Top 20 coins by market cap
320
+ hive market top --vs usd --limit 20
133
321
 
134
322
  # DeFi protocol TVL
135
323
  hive defi tvl --protocol aave
136
324
 
137
- # Stock quote
138
- hive stocks quote --symbol AAPL
325
+ # Token security scan
326
+ hive security scan --token 0x...
327
+
328
+ # Wallet portfolio across chains
329
+ hive portfolio balance --address 0x...
139
330
 
140
- # Search across all tools
141
- hive tools search "price"
331
+ # Polymarket event stats
332
+ hive prediction markets --event "us-presidential-election-2028"
333
+
334
+ # Search across all 376+ tools
335
+ hive tools search "funding rate"
142
336
 
143
337
  # Run any tool by name
144
- hive tools call get_price --args '{"ids": "ethereum", "vs_currencies": "usd"}'
338
+ hive tools call get_price --args '{"ids":"bitcoin","vs_currencies":"usd"}'
145
339
  ```
146
340
 
147
- ### CLI Commands
341
+ ### CLI domains
148
342
 
149
- | Domain | Description |
150
- |--------|-------------|
343
+ | Domain | What's there |
344
+ |--------|--------------|
151
345
  | `market` | Crypto prices, charts, rankings, stablecoins, gas |
152
346
  | `defi` | DeFi protocol TVL, fees, yields, bridges |
347
+ | `dex` | DEX pools, trending pairs, trades, volume |
153
348
  | `portfolio` | Wallet balances, DeFi positions, NFTs |
154
349
  | `security` | Token security scans, approvals, simulations |
155
- | `stocks` | Stock quotes, candles, financials, analyst ratings |
156
- | `macro` | Economic calendar, market status, country data |
157
- | `prediction` | Prediction markets, events, traders, outcomes |
158
- | `exchange` | CEX tickers, orderbooks, trades, funding rates |
159
- | `dex` | DEX pools, trending pairs, trades, volume |
160
350
  | `wallet` | On-chain balances, transfers, transactions |
161
351
  | `nft` | NFT collections, markets, trends |
352
+ | `prediction` | Prediction markets, events, traders, outcomes |
353
+ | `exchange` | CEX tickers, orderbooks, trades, funding rates |
162
354
  | `network` | Chains, gas prices, blocks |
163
355
  | `search` | Search tokens and pools |
164
- | `altdata` | Insider trades, earnings, IPOs |
165
356
 
166
- ### CLI Options
357
+ Run `hive <domain> --help` to see commands within a domain. Run `hive tools list` for the full 376+ tool catalog.
358
+
359
+ ### CLI flags
167
360
 
168
361
  ```
169
- --json Force JSON output
362
+ --json Force JSON envelope output
170
363
  --pretty Force human-readable output
171
364
  --fields <list> Comma-separated fields to include
172
365
  --jq <expr> Filter JSON output (jq-like syntax)
@@ -177,24 +370,17 @@ hive tools call get_price --args '{"ids": "ethereum", "vs_currencies": "usd"}'
177
370
  -v, --verbose Show debug info
178
371
  ```
179
372
 
180
- ### Authentication and Profiles
373
+ ### Auth and profiles
181
374
 
182
375
  ```bash
183
- # Log in with API key
184
- hive auth login
185
-
186
- # Check connectivity
187
- hive doctor
188
-
189
- # Show current profile
190
- hive auth whoami
191
-
192
- # Manage multiple profiles
193
- hive auth profiles
194
- hive auth switch production
376
+ hive auth login # Save API key once
377
+ hive auth whoami # Show current profile
378
+ hive auth profiles # List all profiles
379
+ hive auth switch prod # Switch profiles
380
+ hive doctor # Check connectivity
195
381
  ```
196
382
 
197
- ### Shell Completion
383
+ ### Shell completion
198
384
 
199
385
  ```bash
200
386
  # Bash
@@ -217,36 +403,67 @@ hive alias set btc 'market price --ids bitcoin --vs usd'
217
403
  hive btc
218
404
  ```
219
405
 
220
- ## Analytics Categories (389 Tools)
406
+ ## Pricing
221
407
 
222
- | # | Category | Tools | Description |
223
- |---|----------|-------|-------------|
224
- | 1 | Market Data & Price | 70 | Real-time/historical prices, OHLCV, market caps, stablecoins, derivatives, funding rates |
225
- | 2 | On-Chain DEX & Pool | 58 | DEX pools, liquidity, trending pairs, volume, bridges, GoldRush XY=K analytics |
226
- | 3 | Portfolio & Wallet | 50 | Wallet balances, PnL, DeFi positions, swap history, Moralis & GoldRush intelligence |
227
- | 4 | Token & Contract | 44 | Token metadata, holders, Moralis analytics, ENS resolution, treasury tracking |
228
- | 5 | DeFi Protocol | 21 | TVL data, protocol fees, yield farming, chain metrics, treasuries |
229
- | 6 | NFT Analytics | 41 | Collection data, market charts, liquidity pools, GoldRush NFT metadata & traits |
230
- | 7 | Security & Risk | 37 | Token security, honeypot detection, Tenderly simulation, gas estimation |
231
- | 8 | Network & Infrastructure | 20 | Network health, block data, chain statuses, event logs |
232
- | 9 | Search & Discovery | 10 | Coin search, trending analysis, categories, token discovery |
233
- | 10 | Stocks & Equities | 8 | Real-time quotes, candles, company profiles, recommendations |
234
- | 11 | Forex & Commodities | 4 | Forex rates, commodity prices (gold, silver, platinum) |
235
- | 12 | Economic Indicators | 3 | Economic calendar, market status, country data |
236
- | 13 | Alternative Data | 5 | Insider trading, sentiment scores, earnings/IPO calendar |
237
- | 14 | Prediction Markets | 19 | Polymarket/Kalshi events, trader stats, outcome prices, trade history |
408
+ | Plan | Monthly credits | Rate limit | API keys | Price |
409
+ |------|-----------------|------------|----------|-------|
410
+ | **Demo** | 10,000 | 30 req/min | 1 | Free |
411
+ | **Analyst** | 500,000 | 500 req/min | 10 | $129/mo |
412
+ | **Pro** | 2,000,000 | 1,000 req/min | 25 | $499/mo |
413
+ | **Enterprise** | Custom | 3,000 req/min | 100 | Custom |
238
414
 
239
- ## Data Providers
415
+ One credit = one tool call, regardless of upstream provider or response size. Discovery calls (`tools/list`, `GET /api/v1/tools`) are free.
240
416
 
241
- CoinGecko, DefiLlama, GeckoTerminal, Codex (Defined.fi), Moralis, GoPlus, GoldRush (Covalent), Tenderly, CCXT, Finnhub
417
+ Full pricing: [hiveintelligence.xyz/pricing](https://hiveintelligence.xyz/pricing)
242
418
 
243
- ## Environment Variables
419
+ Machine-readable pricing for AI agents: [hiveintelligence.xyz/pricing.md](https://hiveintelligence.xyz/pricing.md)
420
+
421
+ ## Configuration
244
422
 
245
423
  | Variable | Description |
246
424
  |----------|-------------|
247
- | `HIVE_API_KEY` | **Required.** API key (or use `hive auth login`) |
248
- | `HIVE_API_URL` | Custom server URL (default: `https://mcp.hiveintelligence.xyz`) |
249
- | `API_EXECUTE_ENDPOINT` | Override MCP server backend URL |
425
+ | `HIVE_API_KEY` | **Required.** API key or run `hive auth login` |
426
+ | `HIVE_API_URL` | Custom base URL (default: `https://mcp.hiveintelligence.xyz`) |
427
+ | `API_EXECUTE_ENDPOINT` | Override execute endpoint (advanced) |
428
+
429
+ ## FAQ
430
+
431
+ **What is Hive Intelligence?**
432
+ A managed MCP server, REST API, and CLI that gives AI agents structured access to live crypto market data, DeFi activity, wallet positions, token security signals, DEX flows, NFTs, prediction markets, and on-chain network data through one normalized tool surface.
433
+
434
+ **What does an API key cost?**
435
+ Free Demo plan with 10,000 monthly credits — no credit card required. Paid plans start at $129/month for 500K credits. Get a key at [hiveintelligence.xyz/dashboard/keys](https://hiveintelligence.xyz/dashboard/keys).
436
+
437
+ **Why doesn't `npx -y hive-intelligence` show subcommands?**
438
+ `hive-intelligence` is the MCP stdio server bin — it opens a JSON-RPC transport and waits for an MCP client. For interactive terminal use, use the `hive` CLI: `npx -y -p hive-intelligence hive --help`.
439
+
440
+ **Which AI clients support MCP?**
441
+ Claude Desktop, Claude Code, Claude Mobile, ChatGPT Desktop, Cursor, Windsurf, VS Code (via Copilot Chat), Gemini CLI, and any client implementing the [Model Context Protocol](https://modelcontextprotocol.io). Setup guides for each: [hiveintelligence.xyz/install](https://hiveintelligence.xyz/install).
442
+
443
+ **Can I use the remote HTTP endpoint instead of stdio?**
444
+ Yes. Point your MCP client at `https://mcp.hiveintelligence.xyz/mcp` with `Authorization: Bearer <key>`. Skips the local Node process entirely. Recommended for ChatGPT Desktop, Cursor (cloud), and any HTTP-MCP-aware client.
445
+
446
+ **What chains are supported?**
447
+ EVM (Ethereum, Arbitrum, Optimism, Base, Polygon, BNB Chain, Avalanche, and 90+ more), Solana with full Helius DAS coverage including compressed NFTs, Bitcoin, and others depending on the provider mix per category.
448
+
449
+ **Is the source code open?**
450
+ This package (the CLI and stdio MCP server bin) is MIT-licensed and open source. The managed backend that serves `mcp.hiveintelligence.xyz` is operated as a service.
451
+
452
+ **How does Hive prevent hallucinated answers?**
453
+ Every tool call returns explicit error envelopes with provider attribution and timestamps. Security tools (`get_token_security`, `detect_rugpull`) wrap GoPlus and return structured risk flags. Time-series tools accept point-in-time params (`at`, `block_number`) so agents can answer historical questions without drifting to "latest."
454
+
455
+ **Hive vs CoinGecko MCP / Moralis MCP / DefiLlama MCP?**
456
+ Hive normalizes nine providers into one tool surface (376+ tools) covering market data, DeFi, wallets, security, DEX, NFTs, prediction markets, and network infrastructure. Single-provider MCPs go deeper inside their provider's data; Hive goes broader so agents can answer cross-domain questions in one request.
457
+
458
+ ## Documentation
459
+
460
+ - **Quick Start** — [hiveintelligence.xyz/quick-start](https://hiveintelligence.xyz/quick-start)
461
+ - **API Reference** — [hiveintelligence.xyz/api-integration](https://hiveintelligence.xyz/api-integration)
462
+ - **All Install Guides** — [hiveintelligence.xyz/install](https://hiveintelligence.xyz/install)
463
+ - **CLI Reference** — [hiveintelligence.xyz/cli](https://hiveintelligence.xyz/cli)
464
+ - **Tool Catalog** — [hiveintelligence.xyz/tools/live-catalog](https://hiveintelligence.xyz/tools/live-catalog)
465
+ - **Use Cases** — [hiveintelligence.xyz/use-cases](https://hiveintelligence.xyz/use-cases)
466
+ - **What is MCP for crypto?** — [hiveintelligence.xyz/glossary/mcp-crypto](https://hiveintelligence.xyz/glossary/mcp-crypto)
250
467
 
251
468
  ## Development
252
469
 
@@ -257,13 +474,20 @@ npm install
257
474
  # Build
258
475
  npm run build
259
476
 
260
- # Test with MCP inspector
477
+ # Test with the MCP inspector
261
478
  npm run inspector
262
479
 
263
- # Start MCP server locally
480
+ # Run the MCP server locally
264
481
  npm start
265
482
  ```
266
483
 
484
+ ## Support
485
+
486
+ - **GitHub Issues** — [github.com/hive-intel/hive-crypto-mcp/issues](https://github.com/hive-intel/hive-crypto-mcp/issues)
487
+ - **Email** — [support@hiveintelligence.xyz](mailto:support@hiveintelligence.xyz)
488
+ - **Telegram** — [t.me/HiveIntelligence](https://t.me/HiveIntelligence)
489
+ - **Twitter / X** — [@Hive_Intel](https://x.com/Hive_Intel)
490
+
267
491
  ## License
268
492
 
269
- MIT
493
+ MIT © Hive Intelligence
@@ -174,7 +174,7 @@ async function runLogout() {
174
174
  async function runWhoami() {
175
175
  const profile = getActiveProfile();
176
176
  if (!profile) {
177
- process.stderr.write("Not logged in. Run: hive-mcp auth login\n");
177
+ process.stderr.write("Not logged in. Run: hive auth login\n");
178
178
  return;
179
179
  }
180
180
  process.stderr.write(
@@ -193,7 +193,7 @@ Profile: ${profile.name}${profile.isActive ? " (active)" : ""}
193
193
  async function runProfiles() {
194
194
  const profiles = listProfiles();
195
195
  if (profiles.length === 0) {
196
- process.stderr.write("No profiles configured. Run: hive-mcp auth login\n");
196
+ process.stderr.write("No profiles configured. Run: hive auth login\n");
197
197
  return;
198
198
  }
199
199
  for (const p of profiles) {
@@ -230,4 +230,4 @@ export {
230
230
  saveProfile,
231
231
  switchProfile
232
232
  };
233
- //# sourceMappingURL=auth-PVT4GTAD.js.map
233
+ //# sourceMappingURL=auth-77MKFFBQ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/auth.ts"],"sourcesContent":["import { createInterface } from \"node:readline\";\nimport {\n ensureConfigDir,\n getConfig,\n saveConfig,\n getCredentials,\n saveCredentials,\n} from \"./config-dir.js\";\n\ninterface ProfileInfo {\n name: string;\n apiKey: string;\n apiUrl: string;\n createdAt: string;\n isActive: boolean;\n}\n\nexport function maskKey(key: string): string {\n if (!key) return \"(empty)\";\n const visible = Math.min(8, key.length - 1);\n return key.slice(0, visible) + \"...\";\n}\n\nexport function saveProfile(\n name: string,\n apiKey: string,\n apiUrl: string,\n): void {\n ensureConfigDir();\n const creds = getCredentials();\n creds.profiles[name] = {\n apiKey,\n apiUrl,\n createdAt: new Date().toISOString(),\n };\n saveCredentials(creds);\n const config = getConfig();\n config.activeProfile = name;\n saveConfig(config);\n}\n\nexport function removeProfile(name: string): void {\n const creds = getCredentials();\n delete creds.profiles[name];\n saveCredentials(creds);\n const config = getConfig();\n if (config.activeProfile === name) {\n const remaining = Object.keys(creds.profiles);\n config.activeProfile = remaining[0] ?? \"default\";\n saveConfig(config);\n }\n}\n\nexport function getActiveProfile(): ProfileInfo | null {\n const config = getConfig();\n const creds = getCredentials();\n const profile = creds.profiles[config.activeProfile];\n if (!profile) return null;\n return { name: config.activeProfile, ...profile, isActive: true };\n}\n\nexport function listProfiles(): ProfileInfo[] {\n const config = getConfig();\n const creds = getCredentials();\n return Object.entries(creds.profiles).map(([name, p]) => ({\n name,\n ...p,\n isActive: name === config.activeProfile,\n }));\n}\n\nexport function switchProfile(name: string): void {\n const creds = getCredentials();\n if (!creds.profiles[name]) {\n throw new Error(`Profile \"${name}\" not found`);\n }\n const config = getConfig();\n config.activeProfile = name;\n saveConfig(config);\n}\n\nconst ask = (\n rl: ReturnType<typeof createInterface>,\n q: string,\n): Promise<string> => new Promise((resolve) => rl.question(q, resolve));\n\n/** Prompt for sensitive input with echo suppressed (shows asterisks) */\nfunction askSecret(prompt: string): Promise<string> {\n // Non-TTY: fall back to regular readline (no masking possible)\n if (!process.stdin.isTTY) {\n const rl = createInterface({\n input: process.stdin,\n output: process.stderr,\n });\n return new Promise((resolve) =>\n rl.question(prompt, (ans) => {\n rl.close();\n resolve(ans);\n }),\n );\n }\n\n return new Promise((resolve) => {\n process.stderr.write(prompt);\n const chunks: string[] = [];\n const stdin = process.stdin;\n const wasRaw = stdin.isRaw;\n\n if (typeof stdin.setRawMode === \"function\") {\n stdin.setRawMode(true);\n }\n stdin.resume();\n stdin.setEncoding(\"utf-8\");\n\n const onData = (ch: string) => {\n const c = ch.toString();\n if (c === \"\\n\" || c === \"\\r\" || c === \"\\u0004\") {\n stdin.removeListener(\"data\", onData);\n if (typeof stdin.setRawMode === \"function\") {\n stdin.setRawMode(wasRaw ?? false);\n }\n stdin.pause();\n process.stderr.write(\"\\n\");\n resolve(chunks.join(\"\"));\n } else if (c === \"\\u0003\") {\n // Ctrl+C\n process.exit(130);\n } else if (c === \"\\u007f\" || c === \"\\b\") {\n // Backspace\n if (chunks.length > 0) {\n chunks.pop();\n process.stderr.write(\"\\b \\b\");\n }\n } else {\n chunks.push(c);\n process.stderr.write(\"*\");\n }\n };\n\n stdin.on(\"data\", onData);\n });\n}\n\nexport async function runLogin(opts: { profile?: string }): Promise<void> {\n const profileName = opts.profile ?? \"default\";\n process.stderr.write(`\\nHive CLI — Login (profile: ${profileName})\\n\\n`);\n\n const keyInput = await askSecret(\"API Key: \");\n const apiKey = keyInput.trim();\n if (!apiKey) {\n process.stderr.write(\"No API key provided. Aborting.\\n\");\n process.exit(1);\n }\n\n const rl = createInterface({ input: process.stdin, output: process.stderr });\n const urlInput = await ask(\n rl,\n `API URL [https://mcp.hiveintelligence.xyz]: `,\n );\n rl.close();\n const apiUrl =\n urlInput.trim() ||\n \"https://mcp.hiveintelligence.xyz\";\n\n process.stderr.write(`\\nValidating against ${apiUrl}...\\n`);\n try {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), 10000);\n const resp = await fetch(`${apiUrl}/ping`, {\n headers: { Authorization: `Bearer ${apiKey}` },\n signal: controller.signal,\n });\n clearTimeout(timer);\n if (resp.ok) {\n process.stderr.write(\"Key validated successfully.\\n\");\n } else if (resp.status === 401 || resp.status === 403) {\n process.stderr.write(\n `Warning: Server returned ${resp.status} — key may be invalid.\\n`,\n );\n } else {\n process.stderr.write(`Warning: Server returned ${resp.status}.\\n`);\n }\n } catch {\n process.stderr.write(\"Warning: Could not reach server — saving anyway.\\n\");\n }\n\n saveProfile(profileName, apiKey, apiUrl);\n process.stderr.write(\n `\\nProfile \"${profileName}\" saved. Key: ${maskKey(apiKey)}\\n`,\n );\n}\n\nexport async function runLogout(): Promise<void> {\n const config = getConfig();\n const profile = config.activeProfile;\n removeProfile(profile);\n process.stderr.write(`Logged out of profile \"${profile}\".\\n`);\n}\n\nexport async function runWhoami(): Promise<void> {\n const profile = getActiveProfile();\n if (!profile) {\n process.stderr.write(\"Not logged in. Run: hive-mcp auth login\\n\");\n return;\n }\n process.stderr.write(\n `\\nProfile: ${profile.name}${profile.isActive ? \" (active)\" : \"\"}\\n`,\n );\n process.stderr.write(`API Key: ${maskKey(profile.apiKey)}\\n`);\n process.stderr.write(`API URL: ${profile.apiUrl}\\n`);\n process.stderr.write(`Created: ${profile.createdAt}\\n\\n`);\n}\n\nexport async function runProfiles(): Promise<void> {\n const profiles = listProfiles();\n if (profiles.length === 0) {\n process.stderr.write(\"No profiles configured. Run: hive-mcp auth login\\n\");\n return;\n }\n for (const p of profiles) {\n const marker = p.isActive ? \" *\" : \"\";\n process.stderr.write(\n ` ${p.name}${marker} ${maskKey(p.apiKey)} ${p.apiUrl}\\n`,\n );\n }\n process.stderr.write(\"\\n\");\n}\n\nexport async function runSwitch(name: string): Promise<void> {\n try {\n switchProfile(name);\n process.stderr.write(`Switched to profile \"${name}\".\\n`);\n } catch (err) {\n process.stderr.write(\n (err instanceof Error ? err.message : String(err)) + \"\\n\",\n );\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,uBAAuB;AAiBzB,SAAS,QAAQ,KAAqB;AAC3C,MAAI,CAAC,IAAK,QAAO;AACjB,QAAM,UAAU,KAAK,IAAI,GAAG,IAAI,SAAS,CAAC;AAC1C,SAAO,IAAI,MAAM,GAAG,OAAO,IAAI;AACjC;AAEO,SAAS,YACd,MACA,QACA,QACM;AACN,kBAAgB;AAChB,QAAM,QAAQ,eAAe;AAC7B,QAAM,SAAS,IAAI,IAAI;AAAA,IACrB;AAAA,IACA;AAAA,IACA,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,EACpC;AACA,kBAAgB,KAAK;AACrB,QAAM,SAAS,UAAU;AACzB,SAAO,gBAAgB;AACvB,aAAW,MAAM;AACnB;AAEO,SAAS,cAAc,MAAoB;AAChD,QAAM,QAAQ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OAAO,MAAM,2CAA2C;AAChE;AAAA,EACF;AACA,UAAQ,OAAO;AAAA,IACb;AAAA,YAAe,QAAQ,IAAI,GAAG,QAAQ,WAAW,cAAc,EAAE;AAAA;AAAA,EACnE;AACA,UAAQ,OAAO,MAAM,aAAa,QAAQ,QAAQ,MAAM,CAAC;AAAA,CAAI;AAC7D,UAAQ,OAAO,MAAM,aAAa,QAAQ,MAAM;AAAA,CAAI;AACpD,UAAQ,OAAO,MAAM,aAAa,QAAQ,SAAS;AAAA;AAAA,CAAM;AAC3D;AAEA,eAAsB,cAA6B;AACjD,QAAM,WAAW,aAAa;AAC9B,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,OAAO,MAAM,oDAAoD;AACzE;AAAA,EACF;AACA,aAAW,KAAK,UAAU;AACxB,UAAM,SAAS,EAAE,WAAW,OAAO;AACnC,YAAQ,OAAO;AAAA,MACb,KAAK,EAAE,IAAI,GAAG,MAAM,KAAK,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM;AAAA;AAAA,IACzD;AAAA,EACF;AACA,UAAQ,OAAO,MAAM,IAAI;AAC3B;AAEA,eAAsB,UAAU,MAA6B;AAC3D,MAAI;AACF,kBAAc,IAAI;AAClB,YAAQ,OAAO,MAAM,wBAAwB,IAAI;AAAA,CAAM;AAAA,EACzD,SAAS,KAAK;AACZ,YAAQ,OAAO;AAAA,OACZ,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,KAAK;AAAA,IACvD;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/cli/auth.ts"],"sourcesContent":["import { createInterface } from \"node:readline\";\nimport {\n ensureConfigDir,\n getConfig,\n saveConfig,\n getCredentials,\n saveCredentials,\n} from \"./config-dir.js\";\n\ninterface ProfileInfo {\n name: string;\n apiKey: string;\n apiUrl: string;\n createdAt: string;\n isActive: boolean;\n}\n\nexport function maskKey(key: string): string {\n if (!key) return \"(empty)\";\n const visible = Math.min(8, key.length - 1);\n return key.slice(0, visible) + \"...\";\n}\n\nexport function saveProfile(\n name: string,\n apiKey: string,\n apiUrl: string,\n): void {\n ensureConfigDir();\n const creds = getCredentials();\n creds.profiles[name] = {\n apiKey,\n apiUrl,\n createdAt: new Date().toISOString(),\n };\n saveCredentials(creds);\n const config = getConfig();\n config.activeProfile = name;\n saveConfig(config);\n}\n\nexport function removeProfile(name: string): void {\n const creds = getCredentials();\n delete creds.profiles[name];\n saveCredentials(creds);\n const config = getConfig();\n if (config.activeProfile === name) {\n const remaining = Object.keys(creds.profiles);\n config.activeProfile = remaining[0] ?? \"default\";\n saveConfig(config);\n }\n}\n\nexport function getActiveProfile(): ProfileInfo | null {\n const config = getConfig();\n const creds = getCredentials();\n const profile = creds.profiles[config.activeProfile];\n if (!profile) return null;\n return { name: config.activeProfile, ...profile, isActive: true };\n}\n\nexport function listProfiles(): ProfileInfo[] {\n const config = getConfig();\n const creds = getCredentials();\n return Object.entries(creds.profiles).map(([name, p]) => ({\n name,\n ...p,\n isActive: name === config.activeProfile,\n }));\n}\n\nexport function switchProfile(name: string): void {\n const creds = getCredentials();\n if (!creds.profiles[name]) {\n throw new Error(`Profile \"${name}\" not found`);\n }\n const config = getConfig();\n config.activeProfile = name;\n saveConfig(config);\n}\n\nconst ask = (\n rl: ReturnType<typeof createInterface>,\n q: string,\n): Promise<string> => new Promise((resolve) => rl.question(q, resolve));\n\n/** Prompt for sensitive input with echo suppressed (shows asterisks) */\nfunction askSecret(prompt: string): Promise<string> {\n // Non-TTY: fall back to regular readline (no masking possible)\n if (!process.stdin.isTTY) {\n const rl = createInterface({\n input: process.stdin,\n output: process.stderr,\n });\n return new Promise((resolve) =>\n rl.question(prompt, (ans) => {\n rl.close();\n resolve(ans);\n }),\n );\n }\n\n return new Promise((resolve) => {\n process.stderr.write(prompt);\n const chunks: string[] = [];\n const stdin = process.stdin;\n const wasRaw = stdin.isRaw;\n\n if (typeof stdin.setRawMode === \"function\") {\n stdin.setRawMode(true);\n }\n stdin.resume();\n stdin.setEncoding(\"utf-8\");\n\n const onData = (ch: string) => {\n const c = ch.toString();\n if (c === \"\\n\" || c === \"\\r\" || c === \"\\u0004\") {\n stdin.removeListener(\"data\", onData);\n if (typeof stdin.setRawMode === \"function\") {\n stdin.setRawMode(wasRaw ?? false);\n }\n stdin.pause();\n process.stderr.write(\"\\n\");\n resolve(chunks.join(\"\"));\n } else if (c === \"\\u0003\") {\n // Ctrl+C\n process.exit(130);\n } else if (c === \"\\u007f\" || c === \"\\b\") {\n // Backspace\n if (chunks.length > 0) {\n chunks.pop();\n process.stderr.write(\"\\b \\b\");\n }\n } else {\n chunks.push(c);\n process.stderr.write(\"*\");\n }\n };\n\n stdin.on(\"data\", onData);\n });\n}\n\nexport async function runLogin(opts: { profile?: string }): Promise<void> {\n const profileName = opts.profile ?? \"default\";\n process.stderr.write(`\\nHive CLI — Login (profile: ${profileName})\\n\\n`);\n\n const keyInput = await askSecret(\"API Key: \");\n const apiKey = keyInput.trim();\n if (!apiKey) {\n process.stderr.write(\"No API key provided. Aborting.\\n\");\n process.exit(1);\n }\n\n const rl = createInterface({ input: process.stdin, output: process.stderr });\n const urlInput = await ask(\n rl,\n `API URL [https://mcp.hiveintelligence.xyz]: `,\n );\n rl.close();\n const apiUrl =\n urlInput.trim() ||\n \"https://mcp.hiveintelligence.xyz\";\n\n process.stderr.write(`\\nValidating against ${apiUrl}...\\n`);\n try {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), 10000);\n const resp = await fetch(`${apiUrl}/ping`, {\n headers: { Authorization: `Bearer ${apiKey}` },\n signal: controller.signal,\n });\n clearTimeout(timer);\n if (resp.ok) {\n process.stderr.write(\"Key validated successfully.\\n\");\n } else if (resp.status === 401 || resp.status === 403) {\n process.stderr.write(\n `Warning: Server returned ${resp.status} — key may be invalid.\\n`,\n );\n } else {\n process.stderr.write(`Warning: Server returned ${resp.status}.\\n`);\n }\n } catch {\n process.stderr.write(\"Warning: Could not reach server — saving anyway.\\n\");\n }\n\n saveProfile(profileName, apiKey, apiUrl);\n process.stderr.write(\n `\\nProfile \"${profileName}\" saved. Key: ${maskKey(apiKey)}\\n`,\n );\n}\n\nexport async function runLogout(): Promise<void> {\n const config = getConfig();\n const profile = config.activeProfile;\n removeProfile(profile);\n process.stderr.write(`Logged out of profile \"${profile}\".\\n`);\n}\n\nexport async function runWhoami(): Promise<void> {\n const profile = getActiveProfile();\n if (!profile) {\n process.stderr.write(\"Not logged in. Run: hive auth login\\n\");\n return;\n }\n process.stderr.write(\n `\\nProfile: ${profile.name}${profile.isActive ? \" (active)\" : \"\"}\\n`,\n );\n process.stderr.write(`API Key: ${maskKey(profile.apiKey)}\\n`);\n process.stderr.write(`API URL: ${profile.apiUrl}\\n`);\n process.stderr.write(`Created: ${profile.createdAt}\\n\\n`);\n}\n\nexport async function runProfiles(): Promise<void> {\n const profiles = listProfiles();\n if (profiles.length === 0) {\n process.stderr.write(\"No profiles configured. Run: hive auth login\\n\");\n return;\n }\n for (const p of profiles) {\n const marker = p.isActive ? \" *\" : \"\";\n process.stderr.write(\n ` ${p.name}${marker} ${maskKey(p.apiKey)} ${p.apiUrl}\\n`,\n );\n }\n process.stderr.write(\"\\n\");\n}\n\nexport async function runSwitch(name: string): Promise<void> {\n try {\n switchProfile(name);\n process.stderr.write(`Switched to profile \"${name}\".\\n`);\n } catch (err) {\n process.stderr.write(\n (err instanceof Error ? err.message : String(err)) + \"\\n\",\n );\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,uBAAuB;AAiBzB,SAAS,QAAQ,KAAqB;AAC3C,MAAI,CAAC,IAAK,QAAO;AACjB,QAAM,UAAU,KAAK,IAAI,GAAG,IAAI,SAAS,CAAC;AAC1C,SAAO,IAAI,MAAM,GAAG,OAAO,IAAI;AACjC;AAEO,SAAS,YACd,MACA,QACA,QACM;AACN,kBAAgB;AAChB,QAAM,QAAQ,eAAe;AAC7B,QAAM,SAAS,IAAI,IAAI;AAAA,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