@trading-boy/cli 1.12.0 → 2.0.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/LICENSE +22 -0
- package/README.md +64 -29
- package/dist/api-client.d.ts +4 -7
- package/dist/api-client.js +8 -13
- package/dist/cli.bundle.js +2314 -33711
- package/dist/credentials.js +1 -1
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -24
- package/dist/logger.d.ts +8 -0
- package/dist/logger.js +12 -0
- package/dist/utils.js +3 -3
- package/package.json +30 -16
- package/dist/cli.d.ts +0 -5
- package/dist/cli.js +0 -157
- package/dist/commands/agent-cmd.d.ts +0 -9
- package/dist/commands/agent-cmd.js +0 -567
- package/dist/commands/audit.d.ts +0 -18
- package/dist/commands/audit.js +0 -73
- package/dist/commands/behavioral.d.ts +0 -73
- package/dist/commands/behavioral.js +0 -349
- package/dist/commands/benchmark-cmd.d.ts +0 -3
- package/dist/commands/benchmark-cmd.js +0 -191
- package/dist/commands/billing.d.ts +0 -12
- package/dist/commands/billing.js +0 -142
- package/dist/commands/catalysts.d.ts +0 -17
- package/dist/commands/catalysts.js +0 -151
- package/dist/commands/coaching-cmd.d.ts +0 -16
- package/dist/commands/coaching-cmd.js +0 -222
- package/dist/commands/config-cmd.d.ts +0 -30
- package/dist/commands/config-cmd.js +0 -515
- package/dist/commands/connect-chatgpt.d.ts +0 -5
- package/dist/commands/connect-chatgpt.js +0 -293
- package/dist/commands/connect-claude.d.ts +0 -5
- package/dist/commands/connect-claude.js +0 -280
- package/dist/commands/context.d.ts +0 -41
- package/dist/commands/context.js +0 -405
- package/dist/commands/cron-cmd.d.ts +0 -3
- package/dist/commands/cron-cmd.js +0 -305
- package/dist/commands/decisions.d.ts +0 -57
- package/dist/commands/decisions.js +0 -364
- package/dist/commands/edge-cmd.d.ts +0 -78
- package/dist/commands/edge-cmd.js +0 -183
- package/dist/commands/edge-guard-cmd.d.ts +0 -36
- package/dist/commands/edge-guard-cmd.js +0 -169
- package/dist/commands/events.d.ts +0 -3
- package/dist/commands/events.js +0 -117
- package/dist/commands/infra.d.ts +0 -24
- package/dist/commands/infra.js +0 -137
- package/dist/commands/journal.d.ts +0 -3
- package/dist/commands/journal.js +0 -302
- package/dist/commands/login.d.ts +0 -18
- package/dist/commands/login.js +0 -127
- package/dist/commands/logout.d.ts +0 -8
- package/dist/commands/logout.js +0 -108
- package/dist/commands/narratives.d.ts +0 -3
- package/dist/commands/narratives.js +0 -259
- package/dist/commands/onboarding.d.ts +0 -7
- package/dist/commands/onboarding.js +0 -281
- package/dist/commands/query.d.ts +0 -32
- package/dist/commands/query.js +0 -135
- package/dist/commands/replay-cmd.d.ts +0 -43
- package/dist/commands/replay-cmd.js +0 -184
- package/dist/commands/review.d.ts +0 -3
- package/dist/commands/review.js +0 -443
- package/dist/commands/risk.d.ts +0 -47
- package/dist/commands/risk.js +0 -158
- package/dist/commands/social.d.ts +0 -43
- package/dist/commands/social.js +0 -318
- package/dist/commands/soul-wizard.d.ts +0 -29
- package/dist/commands/soul-wizard.js +0 -155
- package/dist/commands/strategy-cmd.d.ts +0 -44
- package/dist/commands/strategy-cmd.js +0 -335
- package/dist/commands/subscribe.d.ts +0 -78
- package/dist/commands/subscribe.js +0 -552
- package/dist/commands/suggestions-cmd.d.ts +0 -24
- package/dist/commands/suggestions-cmd.js +0 -148
- package/dist/commands/thesis-cmd.d.ts +0 -3
- package/dist/commands/thesis-cmd.js +0 -129
- package/dist/commands/trader.d.ts +0 -30
- package/dist/commands/trader.js +0 -971
- package/dist/commands/watch.d.ts +0 -16
- package/dist/commands/watch.js +0 -104
- package/dist/commands/whoami.d.ts +0 -14
- package/dist/commands/whoami.js +0 -105
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2026 Cabal Ventures. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software and associated documentation files (the "Software") are the
|
|
4
|
+
proprietary property of Cabal Ventures. Unauthorized copying, modification,
|
|
5
|
+
distribution, or use of this Software, in whole or in part, is strictly
|
|
6
|
+
prohibited without the express written permission of Cabal Ventures.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
9
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
10
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
11
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
12
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
13
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
14
|
+
SOFTWARE.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
This project uses the following open-source software:
|
|
19
|
+
|
|
20
|
+
Hermes Agent Framework — MIT License
|
|
21
|
+
Copyright (c) Hermes Contributors
|
|
22
|
+
https://github.com/hermes-ai/hermes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trading-boy/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Remote trading intelligence for traders and AI agents. Real-time market data, on-chain analytics, DeFi risk scoring, and adaptive learning outcomes — 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
|
|
|
@@ -15,20 +15,23 @@ Requires Node.js 20+.
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
# 1. Subscribe (free
|
|
18
|
+
# 1. Subscribe (Starter is free; paid plans open checkout)
|
|
19
19
|
trading-boy subscribe --plan starter -e you@email.com
|
|
20
20
|
|
|
21
|
-
# 2.
|
|
22
|
-
|
|
21
|
+
# 2. Onboarding stores your Trading Boy API key locally.
|
|
22
|
+
# Power agents with ChatGPT or your own LLM provider API key:
|
|
23
|
+
trading-boy connect-chatgpt
|
|
24
|
+
# or
|
|
25
|
+
trading-boy config set-llm-key <your-llm-provider-api-key>
|
|
23
26
|
|
|
24
|
-
# 3.
|
|
25
|
-
trading-boy
|
|
27
|
+
# 3. Create your first agent
|
|
28
|
+
trading-boy agent create --trader-id <id> --scan-interval-human 30m
|
|
26
29
|
|
|
27
|
-
# 4.
|
|
28
|
-
trading-boy
|
|
30
|
+
# 4. Query a token
|
|
31
|
+
trading-boy context SOL
|
|
29
32
|
|
|
30
33
|
# 5. Log a trade
|
|
31
|
-
trading-boy journal entry SOL --direction LONG --price 148.50 --size 500
|
|
34
|
+
trading-boy journal log entry SOL --direction LONG --price 148.50 --size 500
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
## What You Get
|
|
@@ -46,27 +49,60 @@ trading-boy journal entry SOL --direction LONG --price 148.50 --size 500
|
|
|
46
49
|
## Commands
|
|
47
50
|
|
|
48
51
|
```
|
|
49
|
-
|
|
50
|
-
trading-boy
|
|
51
|
-
trading-boy
|
|
52
|
-
trading-boy
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
trading-boy
|
|
57
|
-
trading-boy
|
|
58
|
-
trading-boy
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
trading-boy
|
|
63
|
-
trading-boy
|
|
64
|
-
trading-boy
|
|
65
|
-
|
|
52
|
+
Core
|
|
53
|
+
trading-boy context <token> # Full 6-layer context package
|
|
54
|
+
trading-boy query <token> # Quick price + funding summary
|
|
55
|
+
trading-boy watch <token> # Live watch mode
|
|
56
|
+
|
|
57
|
+
Data & Analysis
|
|
58
|
+
trading-boy catalysts # Upcoming events
|
|
59
|
+
trading-boy risk <protocol> # DeFi risk assessment
|
|
60
|
+
trading-boy narrative list # Active market narratives
|
|
61
|
+
trading-boy events list # Event management
|
|
62
|
+
|
|
63
|
+
Trading Journal
|
|
64
|
+
trading-boy journal log entry <token> # Log a trade entry
|
|
65
|
+
trading-boy journal log exit <token> # Log a trade exit
|
|
66
|
+
trading-boy decisions # View decision history
|
|
67
|
+
trading-boy stats # Aggregate trading statistics
|
|
68
|
+
|
|
69
|
+
Edge & Safety
|
|
70
|
+
trading-boy edge <traderId> # Edge profile analytics
|
|
71
|
+
trading-boy edge-guard check <id> # Negative edge detection
|
|
72
|
+
trading-boy behavioral # Behavioral pattern analysis
|
|
73
|
+
trading-boy coaching pre-trade # AI-powered trade coaching
|
|
74
|
+
trading-boy thesis <id> # Thesis extraction (LLM)
|
|
75
|
+
|
|
76
|
+
Strategy & Benchmarking
|
|
77
|
+
trading-boy strategy list # Manage agent strategies
|
|
78
|
+
trading-boy replay # Backtest strategies
|
|
79
|
+
trading-boy benchmark # Performance leaderboard
|
|
80
|
+
trading-boy suggestions list # Optimization suggestions
|
|
81
|
+
|
|
82
|
+
Account
|
|
83
|
+
trading-boy subscribe # Subscribe via Stripe
|
|
84
|
+
trading-boy login # Store your Trading Boy API key
|
|
85
|
+
trading-boy connect-chatgpt # Connect ChatGPT after Trading Boy login
|
|
86
|
+
trading-boy whoami # Check auth status + key expiration
|
|
87
|
+
trading-boy rotate-key # Rotate your Trading Boy API key
|
|
88
|
+
trading-boy forgot-key # Recover key via email
|
|
89
|
+
trading-boy billing manage # Manage subscription
|
|
90
|
+
|
|
91
|
+
System
|
|
92
|
+
trading-boy trader register # Create trader profile
|
|
93
|
+
trading-boy config show # View API + LLM configuration
|
|
94
|
+
trading-boy config set-llm-key # Store your LLM provider API key
|
|
95
|
+
trading-boy cron list # Manage scheduled jobs
|
|
96
|
+
trading-boy agent create # Create a hosted trading agent
|
|
97
|
+
trading-boy agent list # Manage agents
|
|
66
98
|
```
|
|
67
99
|
|
|
68
100
|
Run `trading-boy --help` for the full command list.
|
|
69
101
|
|
|
102
|
+
## Public Package Scope
|
|
103
|
+
|
|
104
|
+
The published npm package is a public, remote-only CLI. End users can manage API/LLM settings and runtime model selection, but internal infrastructure management and server environment editing are intentionally not part of the npm release surface.
|
|
105
|
+
|
|
70
106
|
## Pricing
|
|
71
107
|
|
|
72
108
|
| Plan | Price | Tokens | Trades/mo |
|
|
@@ -82,10 +118,9 @@ All plans include every feature. Limits apply to traded tokens and logged trades
|
|
|
82
118
|
Trading Boy exposes an MCP server for AI agent integration and a REST API for programmatic access.
|
|
83
119
|
|
|
84
120
|
```bash
|
|
85
|
-
# Start the MCP server (for Claude, GPT, etc.)
|
|
86
|
-
trading-boy mcp
|
|
87
|
-
|
|
88
121
|
# REST API is hosted at https://api.cabal.ventures
|
|
122
|
+
# MCP server: npx @trading-boy/mcp-server
|
|
123
|
+
# CLI onboarding and first-agent setup: see docs/getting-started.md
|
|
89
124
|
```
|
|
90
125
|
|
|
91
126
|
## License
|
package/dist/api-client.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class ApiError extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Dev mode: TRADING_BOY_API_URL points to localhost AND NODE_ENV=development.
|
|
13
|
-
* In dev mode, auth is
|
|
13
|
+
* In dev mode, auth is optional for a local API server.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isDevMode(): boolean;
|
|
16
16
|
export declare function resolveApiKey(flagKey?: string): Promise<string>;
|
|
@@ -22,13 +22,10 @@ export declare function apiRequest<T>(path: string, options?: {
|
|
|
22
22
|
headers?: Record<string, string>;
|
|
23
23
|
}): Promise<T>;
|
|
24
24
|
/**
|
|
25
|
-
* Check
|
|
25
|
+
* Check whether the CLI has enough configuration to use the API successfully.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Local/dev mode: direct DB connections (requires NEO4J_URI, TIMESCALE_HOST, etc.)
|
|
31
|
-
* Remote mode: HTTP requests to TRADING_BOY_API_URL (defaults to https://api.cabal.ventures)
|
|
27
|
+
* The public CLI always talks to the Trading Boy API, either at the default hosted
|
|
28
|
+
* endpoint or at a user-specified TRADING_BOY_API_URL.
|
|
32
29
|
*/
|
|
33
30
|
export declare function isRemoteMode(): Promise<boolean>;
|
|
34
31
|
export { redactApiKey };
|
package/dist/api-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLogger } from '
|
|
1
|
+
import { createLogger } from './logger.js';
|
|
2
2
|
import { loadCredentials, redactApiKey } from './credentials.js';
|
|
3
3
|
const logger = createLogger('cli-api-client');
|
|
4
4
|
// ─── Constants ───
|
|
@@ -16,7 +16,7 @@ export class ApiError extends Error {
|
|
|
16
16
|
// ─── Dev Mode Detection ───
|
|
17
17
|
/**
|
|
18
18
|
* Dev mode: TRADING_BOY_API_URL points to localhost AND NODE_ENV=development.
|
|
19
|
-
* In dev mode, auth is
|
|
19
|
+
* In dev mode, auth is optional for a local API server.
|
|
20
20
|
*/
|
|
21
21
|
export function isDevMode() {
|
|
22
22
|
if (process.env.NODE_ENV !== 'development')
|
|
@@ -84,6 +84,7 @@ export async function apiRequest(path, options = {}) {
|
|
|
84
84
|
...(apiKey ? { 'X-API-Key': apiKey } : {}),
|
|
85
85
|
...(options.body ? { 'Content-Type': 'application/json' } : {}),
|
|
86
86
|
...options.headers,
|
|
87
|
+
'X-TB-Channel': 'cli',
|
|
87
88
|
};
|
|
88
89
|
const fetchOptions = {
|
|
89
90
|
method: options.method ?? 'GET',
|
|
@@ -145,21 +146,15 @@ export async function apiRequest(path, options = {}) {
|
|
|
145
146
|
}
|
|
146
147
|
return (await response.json());
|
|
147
148
|
}
|
|
148
|
-
// ───
|
|
149
|
+
// ─── API Access Detection ───
|
|
149
150
|
/**
|
|
150
|
-
* Check
|
|
151
|
+
* Check whether the CLI has enough configuration to use the API successfully.
|
|
151
152
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* Local/dev mode: direct DB connections (requires NEO4J_URI, TIMESCALE_HOST, etc.)
|
|
156
|
-
* Remote mode: HTTP requests to TRADING_BOY_API_URL (defaults to https://api.cabal.ventures)
|
|
153
|
+
* The public CLI always talks to the Trading Boy API, either at the default hosted
|
|
154
|
+
* endpoint or at a user-specified TRADING_BOY_API_URL.
|
|
157
155
|
*/
|
|
158
156
|
export async function isRemoteMode() {
|
|
159
|
-
//
|
|
160
|
-
if (process.env.TRADING_BOY_LOCAL === 'true')
|
|
161
|
-
return false;
|
|
162
|
-
// Tests always run in local mode
|
|
157
|
+
// Tests often stub auth and do not need stored credentials.
|
|
163
158
|
if (process.env.NODE_ENV === 'test')
|
|
164
159
|
return false;
|
|
165
160
|
// If API URL is explicitly set, use remote mode
|