@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.
Files changed (84) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +64 -29
  3. package/dist/api-client.d.ts +4 -7
  4. package/dist/api-client.js +8 -13
  5. package/dist/cli.bundle.js +2314 -33711
  6. package/dist/credentials.js +1 -1
  7. package/dist/index.d.ts +0 -28
  8. package/dist/index.js +0 -24
  9. package/dist/logger.d.ts +8 -0
  10. package/dist/logger.js +12 -0
  11. package/dist/utils.js +3 -3
  12. package/package.json +30 -16
  13. package/dist/cli.d.ts +0 -5
  14. package/dist/cli.js +0 -157
  15. package/dist/commands/agent-cmd.d.ts +0 -9
  16. package/dist/commands/agent-cmd.js +0 -567
  17. package/dist/commands/audit.d.ts +0 -18
  18. package/dist/commands/audit.js +0 -73
  19. package/dist/commands/behavioral.d.ts +0 -73
  20. package/dist/commands/behavioral.js +0 -349
  21. package/dist/commands/benchmark-cmd.d.ts +0 -3
  22. package/dist/commands/benchmark-cmd.js +0 -191
  23. package/dist/commands/billing.d.ts +0 -12
  24. package/dist/commands/billing.js +0 -142
  25. package/dist/commands/catalysts.d.ts +0 -17
  26. package/dist/commands/catalysts.js +0 -151
  27. package/dist/commands/coaching-cmd.d.ts +0 -16
  28. package/dist/commands/coaching-cmd.js +0 -222
  29. package/dist/commands/config-cmd.d.ts +0 -30
  30. package/dist/commands/config-cmd.js +0 -515
  31. package/dist/commands/connect-chatgpt.d.ts +0 -5
  32. package/dist/commands/connect-chatgpt.js +0 -293
  33. package/dist/commands/connect-claude.d.ts +0 -5
  34. package/dist/commands/connect-claude.js +0 -280
  35. package/dist/commands/context.d.ts +0 -41
  36. package/dist/commands/context.js +0 -405
  37. package/dist/commands/cron-cmd.d.ts +0 -3
  38. package/dist/commands/cron-cmd.js +0 -305
  39. package/dist/commands/decisions.d.ts +0 -57
  40. package/dist/commands/decisions.js +0 -364
  41. package/dist/commands/edge-cmd.d.ts +0 -78
  42. package/dist/commands/edge-cmd.js +0 -183
  43. package/dist/commands/edge-guard-cmd.d.ts +0 -36
  44. package/dist/commands/edge-guard-cmd.js +0 -169
  45. package/dist/commands/events.d.ts +0 -3
  46. package/dist/commands/events.js +0 -117
  47. package/dist/commands/infra.d.ts +0 -24
  48. package/dist/commands/infra.js +0 -137
  49. package/dist/commands/journal.d.ts +0 -3
  50. package/dist/commands/journal.js +0 -302
  51. package/dist/commands/login.d.ts +0 -18
  52. package/dist/commands/login.js +0 -127
  53. package/dist/commands/logout.d.ts +0 -8
  54. package/dist/commands/logout.js +0 -108
  55. package/dist/commands/narratives.d.ts +0 -3
  56. package/dist/commands/narratives.js +0 -259
  57. package/dist/commands/onboarding.d.ts +0 -7
  58. package/dist/commands/onboarding.js +0 -281
  59. package/dist/commands/query.d.ts +0 -32
  60. package/dist/commands/query.js +0 -135
  61. package/dist/commands/replay-cmd.d.ts +0 -43
  62. package/dist/commands/replay-cmd.js +0 -184
  63. package/dist/commands/review.d.ts +0 -3
  64. package/dist/commands/review.js +0 -443
  65. package/dist/commands/risk.d.ts +0 -47
  66. package/dist/commands/risk.js +0 -158
  67. package/dist/commands/social.d.ts +0 -43
  68. package/dist/commands/social.js +0 -318
  69. package/dist/commands/soul-wizard.d.ts +0 -29
  70. package/dist/commands/soul-wizard.js +0 -155
  71. package/dist/commands/strategy-cmd.d.ts +0 -44
  72. package/dist/commands/strategy-cmd.js +0 -335
  73. package/dist/commands/subscribe.d.ts +0 -78
  74. package/dist/commands/subscribe.js +0 -552
  75. package/dist/commands/suggestions-cmd.d.ts +0 -24
  76. package/dist/commands/suggestions-cmd.js +0 -148
  77. package/dist/commands/thesis-cmd.d.ts +0 -3
  78. package/dist/commands/thesis-cmd.js +0 -129
  79. package/dist/commands/trader.d.ts +0 -30
  80. package/dist/commands/trader.js +0 -971
  81. package/dist/commands/watch.d.ts +0 -16
  82. package/dist/commands/watch.js +0 -104
  83. package/dist/commands/whoami.d.ts +0 -14
  84. 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
- 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.
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 tier available)
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. Query a token
22
- trading-boy query SOL
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. Get full context intelligence
25
- trading-boy context SOL
27
+ # 3. Create your first agent
28
+ trading-boy agent create --trader-id <id> --scan-interval-human 30m
26
29
 
27
- # 4. Register a trader profile
28
- trading-boy trader register --name MyTrader
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
- 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
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
@@ -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 not required (local API server runs without API keys).
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 if the CLI should use remote API mode.
25
+ * Check whether the CLI has enough configuration to use the API successfully.
26
26
  *
27
- * Remote mode activates when the user has an API key (from `login` or env var).
28
- * In remote mode, commands route through the REST API instead of direct DB connections.
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 };
@@ -1,4 +1,4 @@
1
- import { createLogger } from '@trading-boy/core';
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 not required (local API server runs without API keys).
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
- // ─── Remote Mode Detection ───
149
+ // ─── API Access Detection ───
149
150
  /**
150
- * Check if the CLI should use remote API mode.
151
+ * Check whether the CLI has enough configuration to use the API successfully.
151
152
  *
152
- * Remote mode activates when the user has an API key (from `login` or env var).
153
- * In remote mode, commands route through the REST API instead of direct DB connections.
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
- // Explicit env var override
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