@trading-boy/cli 1.2.8 → 1.2.10
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 +89 -4
- package/dist/cli.bundle.js +9 -6
- package/dist/commands/login.js +10 -6
- package/package.json +29 -11
package/README.md
CHANGED
|
@@ -1,8 +1,93 @@
|
|
|
1
1
|
# @trading-boy/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Crypto context intelligence for traders and AI agents. Real-time market data, on-chain analytics, DeFi risk scoring, and an adaptive learning engine — all from the command line.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Website:** [cabal.ventures](https://cabal.ventures) | **Docs:** [cabal.ventures/docs](https://cabal.ventures/docs)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @trading-boy/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Node.js 20+.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 1. Subscribe (free tier available)
|
|
19
|
+
trading-boy subscribe --plan starter -e you@email.com
|
|
20
|
+
|
|
21
|
+
# 2. Query a token
|
|
22
|
+
trading-boy query SOL
|
|
23
|
+
|
|
24
|
+
# 3. Get full context intelligence
|
|
25
|
+
trading-boy context SOL
|
|
26
|
+
|
|
27
|
+
# 4. Register a trader profile
|
|
28
|
+
trading-boy trader register --name MyTrader
|
|
29
|
+
|
|
30
|
+
# 5. Log a trade
|
|
31
|
+
trading-boy journal entry SOL --direction LONG --price 148.50 --size 500
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What You Get
|
|
35
|
+
|
|
36
|
+
- **Real-time prices** for 100+ Solana SPL tokens and 229 Hyperliquid perpetuals
|
|
37
|
+
- **Funding rates & open interest** from Binance perp markets
|
|
38
|
+
- **On-chain analytics** — whale transactions, exchange flows, smart money tracking
|
|
39
|
+
- **DeFi risk scoring** — protocol dependency trees, contagion risk, concentration analysis
|
|
40
|
+
- **Trading journal** — context-linked decisions with outcome tracking and confidence calibration
|
|
41
|
+
- **Behavioral guardrails** — bias detection, overtrading alerts, pattern analysis
|
|
42
|
+
- **Adaptive learning** — signals improve based on your personal trading outcomes
|
|
43
|
+
- **Edge analytics** — win rate, best/worst setups, confidence calibration scores
|
|
44
|
+
- **Agent integration** — MCP server for Claude, GPT, and other AI agents
|
|
45
|
+
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
trading-boy context <token> # Full 6-layer context package
|
|
50
|
+
trading-boy query <token> # Quick price + funding summary
|
|
51
|
+
trading-boy watch <token> # Live watch mode
|
|
52
|
+
trading-boy catalysts # Upcoming events
|
|
53
|
+
trading-boy risk <protocol> # DeFi risk assessment
|
|
54
|
+
trading-boy narrative list # Active market narratives
|
|
55
|
+
|
|
56
|
+
trading-boy journal entry <token> # Log a trade entry
|
|
57
|
+
trading-boy journal exit <token> # Log a trade exit
|
|
58
|
+
trading-boy decisions # View decision history
|
|
59
|
+
trading-boy edge <traderId> # Edge profile analytics
|
|
60
|
+
trading-boy behavioral # Behavioral pattern analysis
|
|
61
|
+
|
|
62
|
+
trading-boy subscribe # Subscribe via Stripe
|
|
63
|
+
trading-boy login # Store API key
|
|
64
|
+
trading-boy trader register # Create trader profile
|
|
65
|
+
trading-boy billing manage # Manage subscription
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Run `trading-boy --help` for the full command list.
|
|
69
|
+
|
|
70
|
+
## Pricing
|
|
71
|
+
|
|
72
|
+
| Plan | Price | Tokens | Trades/mo |
|
|
73
|
+
|------|-------|--------|-----------|
|
|
74
|
+
| Starter | Free | 5 | 50 |
|
|
75
|
+
| Pro | $29/mo | 25 | 500 |
|
|
76
|
+
| Edge | $99/mo | 100 | Unlimited |
|
|
77
|
+
|
|
78
|
+
All plans include every feature. Limits apply to traded tokens and logged trades only — queries are unlimited.
|
|
79
|
+
|
|
80
|
+
## API & Agent Integration
|
|
81
|
+
|
|
82
|
+
Trading Boy exposes an MCP server for AI agent integration and a REST API for programmatic access.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Start the MCP server (for Claude, GPT, etc.)
|
|
86
|
+
trading-boy mcp
|
|
87
|
+
|
|
88
|
+
# REST API is hosted at https://api.cabal.ventures
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
package/dist/cli.bundle.js
CHANGED
|
@@ -45742,7 +45742,7 @@ function registerInfraCommand(program2) {
|
|
|
45742
45742
|
// dist/commands/login.js
|
|
45743
45743
|
init_source();
|
|
45744
45744
|
var logger19 = createLogger("cli-login");
|
|
45745
|
-
var API_KEY_PATTERN = /^tb_(live|test)_[a-f0-9]{32}$/;
|
|
45745
|
+
var API_KEY_PATTERN = /^tb_(live|test|free)_[a-f0-9]{32}$/;
|
|
45746
45746
|
function validateApiKeyFormat(key) {
|
|
45747
45747
|
return API_KEY_PATTERN.test(key);
|
|
45748
45748
|
}
|
|
@@ -45750,8 +45750,11 @@ async function verifyApiKey(apiKey) {
|
|
|
45750
45750
|
const apiBase = getApiBase();
|
|
45751
45751
|
const response = await fetch(`${apiBase}/api/v1/auth/verify`, {
|
|
45752
45752
|
method: "POST",
|
|
45753
|
-
headers: {
|
|
45754
|
-
|
|
45753
|
+
headers: {
|
|
45754
|
+
"Content-Type": "application/json",
|
|
45755
|
+
"Authorization": `Bearer ${apiKey}`
|
|
45756
|
+
},
|
|
45757
|
+
body: "{}"
|
|
45755
45758
|
});
|
|
45756
45759
|
if (!response.ok) {
|
|
45757
45760
|
if (response.status === 401) {
|
|
@@ -45782,7 +45785,7 @@ async function executeLogin(apiKey) {
|
|
|
45782
45785
|
};
|
|
45783
45786
|
}
|
|
45784
45787
|
function registerLoginCommand(program2) {
|
|
45785
|
-
program2.command("login").description("Authenticate with your Trading Boy API key").
|
|
45788
|
+
program2.command("login").description("Authenticate with your Trading Boy API key").addOption(new Option("--api-key <key>", "API key (deprecated \u2014 use TRADING_BOY_API_KEY env var)").hideHelp()).action(async (opts) => {
|
|
45786
45789
|
try {
|
|
45787
45790
|
let apiKey;
|
|
45788
45791
|
if (opts.apiKey) {
|
|
@@ -45801,14 +45804,14 @@ function registerLoginCommand(program2) {
|
|
|
45801
45804
|
if (!input)
|
|
45802
45805
|
return "API key is required";
|
|
45803
45806
|
if (!validateApiKeyFormat(input)) {
|
|
45804
|
-
return "Invalid key format. Expected: tb_live_<32hex
|
|
45807
|
+
return "Invalid key format. Expected: tb_live_<32hex>, tb_test_<32hex>, or tb_free_<32hex>";
|
|
45805
45808
|
}
|
|
45806
45809
|
return true;
|
|
45807
45810
|
}
|
|
45808
45811
|
});
|
|
45809
45812
|
}
|
|
45810
45813
|
if (!validateApiKeyFormat(apiKey)) {
|
|
45811
|
-
console.error(source_default.red(" Invalid key format. Expected: tb_live_<32hex
|
|
45814
|
+
console.error(source_default.red(" Invalid key format. Expected: tb_live_<32hex>, tb_test_<32hex>, or tb_free_<32hex>"));
|
|
45812
45815
|
process.exitCode = 1;
|
|
45813
45816
|
return;
|
|
45814
45817
|
}
|
package/dist/commands/login.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Option } from 'commander';
|
|
1
2
|
import chalk from 'chalk';
|
|
2
3
|
import { createLogger } from '@trading-boy/core';
|
|
3
4
|
import { storeCredentials, redactApiKey } from '../credentials.js';
|
|
4
5
|
import { getApiBase } from '../api-client.js';
|
|
5
6
|
const logger = createLogger('cli-login');
|
|
6
7
|
// ─── API Key Validation ───
|
|
7
|
-
const API_KEY_PATTERN = /^tb_(live|test)_[a-f0-9]{32}$/;
|
|
8
|
+
const API_KEY_PATTERN = /^tb_(live|test|free)_[a-f0-9]{32}$/;
|
|
8
9
|
export function validateApiKeyFormat(key) {
|
|
9
10
|
return API_KEY_PATTERN.test(key);
|
|
10
11
|
}
|
|
@@ -13,8 +14,11 @@ export async function verifyApiKey(apiKey) {
|
|
|
13
14
|
const apiBase = getApiBase();
|
|
14
15
|
const response = await fetch(`${apiBase}/api/v1/auth/verify`, {
|
|
15
16
|
method: 'POST',
|
|
16
|
-
headers: {
|
|
17
|
-
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
20
|
+
},
|
|
21
|
+
body: '{}',
|
|
18
22
|
});
|
|
19
23
|
if (!response.ok) {
|
|
20
24
|
if (response.status === 401) {
|
|
@@ -53,7 +57,7 @@ export function registerLoginCommand(program) {
|
|
|
53
57
|
program
|
|
54
58
|
.command('login')
|
|
55
59
|
.description('Authenticate with your Trading Boy API key')
|
|
56
|
-
.
|
|
60
|
+
.addOption(new Option('--api-key <key>', 'API key (deprecated — use TRADING_BOY_API_KEY env var)').hideHelp())
|
|
57
61
|
.action(async (opts) => {
|
|
58
62
|
try {
|
|
59
63
|
let apiKey;
|
|
@@ -76,7 +80,7 @@ export function registerLoginCommand(program) {
|
|
|
76
80
|
if (!input)
|
|
77
81
|
return 'API key is required';
|
|
78
82
|
if (!validateApiKeyFormat(input)) {
|
|
79
|
-
return 'Invalid key format. Expected: tb_live_<32hex
|
|
83
|
+
return 'Invalid key format. Expected: tb_live_<32hex>, tb_test_<32hex>, or tb_free_<32hex>';
|
|
80
84
|
}
|
|
81
85
|
return true;
|
|
82
86
|
},
|
|
@@ -84,7 +88,7 @@ export function registerLoginCommand(program) {
|
|
|
84
88
|
}
|
|
85
89
|
// Validate format before making network request
|
|
86
90
|
if (!validateApiKeyFormat(apiKey)) {
|
|
87
|
-
console.error(chalk.red(' Invalid key format. Expected: tb_live_<32hex
|
|
91
|
+
console.error(chalk.red(' Invalid key format. Expected: tb_live_<32hex>, tb_test_<32hex>, or tb_free_<32hex>'));
|
|
88
92
|
process.exitCode = 1;
|
|
89
93
|
return;
|
|
90
94
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trading-boy/cli",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Trading Boy CLI — crypto context intelligence for traders and AI agents",
|
|
3
|
+
"version": "1.2.10",
|
|
4
|
+
"description": "Trading Boy CLI — crypto context intelligence for traders and AI agents. Query real-time prices, funding rates, whale activity, and DeFi risk for 100+ Solana tokens and 229 Hyperliquid perpetuals.",
|
|
5
|
+
"homepage": "https://cabal.ventures",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/0xLLM73/Trading-Boy"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"crypto",
|
|
13
|
+
"trading",
|
|
14
|
+
"solana",
|
|
15
|
+
"hyperliquid",
|
|
16
|
+
"defi",
|
|
17
|
+
"trading-journal",
|
|
18
|
+
"context-intelligence",
|
|
19
|
+
"ai-agents",
|
|
20
|
+
"mcp",
|
|
21
|
+
"cli"
|
|
22
|
+
],
|
|
5
23
|
"publishConfig": {
|
|
6
24
|
"access": "public"
|
|
7
25
|
},
|
|
@@ -16,10 +34,17 @@
|
|
|
16
34
|
"!dist/**/*.test.*",
|
|
17
35
|
"!dist/**/*.map"
|
|
18
36
|
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc && node esbuild.config.js",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"lint": "eslint src/",
|
|
42
|
+
"clean": "rm -rf dist .turbo"
|
|
43
|
+
},
|
|
19
44
|
"dependencies": {
|
|
20
45
|
"@inquirer/prompts": "~7.10.1",
|
|
21
46
|
"@napi-rs/keyring": "~1.1.3",
|
|
22
|
-
"@trading-boy/core": "
|
|
47
|
+
"@trading-boy/core": "workspace:~1.2.0",
|
|
23
48
|
"chalk": "~5.6.2",
|
|
24
49
|
"commander": "~13.1.0",
|
|
25
50
|
"open": "~10.2.0",
|
|
@@ -29,12 +54,5 @@
|
|
|
29
54
|
"devDependencies": {
|
|
30
55
|
"esbuild": "~0.27.4",
|
|
31
56
|
"typescript": "^5.7.0"
|
|
32
|
-
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"build": "tsc && node esbuild.config.js",
|
|
35
|
-
"typecheck": "tsc --noEmit",
|
|
36
|
-
"test": "vitest run",
|
|
37
|
-
"lint": "eslint src/",
|
|
38
|
-
"clean": "rm -rf dist .turbo"
|
|
39
57
|
}
|
|
40
|
-
}
|
|
58
|
+
}
|