@trading-boy/cli 1.12.0 → 2.0.0

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 (83) hide show
  1. package/README.md +50 -22
  2. package/dist/api-client.d.ts +4 -7
  3. package/dist/api-client.js +8 -13
  4. package/dist/cli.bundle.js +1896 -33657
  5. package/dist/credentials.js +1 -1
  6. package/dist/index.d.ts +0 -28
  7. package/dist/index.js +0 -24
  8. package/dist/logger.d.ts +8 -0
  9. package/dist/logger.js +12 -0
  10. package/dist/utils.js +3 -3
  11. package/package.json +20 -5
  12. package/dist/cli.d.ts +0 -5
  13. package/dist/cli.js +0 -157
  14. package/dist/commands/agent-cmd.d.ts +0 -9
  15. package/dist/commands/agent-cmd.js +0 -567
  16. package/dist/commands/audit.d.ts +0 -18
  17. package/dist/commands/audit.js +0 -73
  18. package/dist/commands/behavioral.d.ts +0 -73
  19. package/dist/commands/behavioral.js +0 -349
  20. package/dist/commands/benchmark-cmd.d.ts +0 -3
  21. package/dist/commands/benchmark-cmd.js +0 -191
  22. package/dist/commands/billing.d.ts +0 -12
  23. package/dist/commands/billing.js +0 -142
  24. package/dist/commands/catalysts.d.ts +0 -17
  25. package/dist/commands/catalysts.js +0 -151
  26. package/dist/commands/coaching-cmd.d.ts +0 -16
  27. package/dist/commands/coaching-cmd.js +0 -222
  28. package/dist/commands/config-cmd.d.ts +0 -30
  29. package/dist/commands/config-cmd.js +0 -515
  30. package/dist/commands/connect-chatgpt.d.ts +0 -5
  31. package/dist/commands/connect-chatgpt.js +0 -293
  32. package/dist/commands/connect-claude.d.ts +0 -5
  33. package/dist/commands/connect-claude.js +0 -280
  34. package/dist/commands/context.d.ts +0 -41
  35. package/dist/commands/context.js +0 -405
  36. package/dist/commands/cron-cmd.d.ts +0 -3
  37. package/dist/commands/cron-cmd.js +0 -305
  38. package/dist/commands/decisions.d.ts +0 -57
  39. package/dist/commands/decisions.js +0 -364
  40. package/dist/commands/edge-cmd.d.ts +0 -78
  41. package/dist/commands/edge-cmd.js +0 -183
  42. package/dist/commands/edge-guard-cmd.d.ts +0 -36
  43. package/dist/commands/edge-guard-cmd.js +0 -169
  44. package/dist/commands/events.d.ts +0 -3
  45. package/dist/commands/events.js +0 -117
  46. package/dist/commands/infra.d.ts +0 -24
  47. package/dist/commands/infra.js +0 -137
  48. package/dist/commands/journal.d.ts +0 -3
  49. package/dist/commands/journal.js +0 -302
  50. package/dist/commands/login.d.ts +0 -18
  51. package/dist/commands/login.js +0 -127
  52. package/dist/commands/logout.d.ts +0 -8
  53. package/dist/commands/logout.js +0 -108
  54. package/dist/commands/narratives.d.ts +0 -3
  55. package/dist/commands/narratives.js +0 -259
  56. package/dist/commands/onboarding.d.ts +0 -7
  57. package/dist/commands/onboarding.js +0 -281
  58. package/dist/commands/query.d.ts +0 -32
  59. package/dist/commands/query.js +0 -135
  60. package/dist/commands/replay-cmd.d.ts +0 -43
  61. package/dist/commands/replay-cmd.js +0 -184
  62. package/dist/commands/review.d.ts +0 -3
  63. package/dist/commands/review.js +0 -443
  64. package/dist/commands/risk.d.ts +0 -47
  65. package/dist/commands/risk.js +0 -158
  66. package/dist/commands/social.d.ts +0 -43
  67. package/dist/commands/social.js +0 -318
  68. package/dist/commands/soul-wizard.d.ts +0 -29
  69. package/dist/commands/soul-wizard.js +0 -155
  70. package/dist/commands/strategy-cmd.d.ts +0 -44
  71. package/dist/commands/strategy-cmd.js +0 -335
  72. package/dist/commands/subscribe.d.ts +0 -78
  73. package/dist/commands/subscribe.js +0 -552
  74. package/dist/commands/suggestions-cmd.d.ts +0 -24
  75. package/dist/commands/suggestions-cmd.js +0 -148
  76. package/dist/commands/thesis-cmd.d.ts +0 -3
  77. package/dist/commands/thesis-cmd.js +0 -129
  78. package/dist/commands/trader.d.ts +0 -30
  79. package/dist/commands/trader.js +0 -971
  80. package/dist/commands/watch.d.ts +0 -16
  81. package/dist/commands/watch.js +0 -104
  82. package/dist/commands/whoami.d.ts +0 -14
  83. package/dist/commands/whoami.js +0 -105
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
 
@@ -28,7 +28,7 @@ trading-boy context SOL
28
28
  trading-boy trader register --name MyTrader
29
29
 
30
30
  # 5. Log a trade
31
- trading-boy journal entry SOL --direction LONG --price 148.50 --size 500
31
+ trading-boy journal log entry SOL --direction LONG --price 148.50 --size 500
32
32
  ```
33
33
 
34
34
  ## What You Get
@@ -46,27 +46,57 @@ trading-boy journal entry SOL --direction LONG --price 148.50 --size 500
46
46
  ## Commands
47
47
 
48
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
49
+ Core
50
+ trading-boy context <token> # Full 6-layer context package
51
+ trading-boy query <token> # Quick price + funding summary
52
+ trading-boy watch <token> # Live watch mode
53
+
54
+ Data & Analysis
55
+ trading-boy catalysts # Upcoming events
56
+ trading-boy risk <protocol> # DeFi risk assessment
57
+ trading-boy narrative list # Active market narratives
58
+ trading-boy events list # Event management
59
+
60
+ Trading Journal
61
+ trading-boy journal log entry <token> # Log a trade entry
62
+ trading-boy journal log exit <token> # Log a trade exit
63
+ trading-boy decisions # View decision history
64
+ trading-boy stats # Aggregate trading statistics
65
+
66
+ Edge & Safety
67
+ trading-boy edge <traderId> # Edge profile analytics
68
+ trading-boy edge-guard check <id> # Negative edge detection
69
+ trading-boy behavioral # Behavioral pattern analysis
70
+ trading-boy coaching pre-trade # AI-powered trade coaching
71
+ trading-boy thesis <id> # Thesis extraction (LLM)
72
+
73
+ Strategy & Benchmarking
74
+ trading-boy strategy list # Manage agent strategies
75
+ trading-boy replay # Backtest strategies
76
+ trading-boy benchmark # Performance leaderboard
77
+ trading-boy suggestions list # Optimization suggestions
78
+
79
+ Account
80
+ trading-boy subscribe # Subscribe via Stripe
81
+ trading-boy login # Store API key
82
+ trading-boy whoami # Check auth status + key expiration
83
+ trading-boy rotate-key # Rotate your API key
84
+ trading-boy forgot-key # Recover key via email
85
+ trading-boy billing manage # Manage subscription
86
+
87
+ System
88
+ trading-boy trader register # Create trader profile
89
+ trading-boy config show # View API + LLM configuration
90
+ trading-boy cron list # Manage scheduled jobs
91
+ trading-boy agent list # Manage agents
66
92
  ```
67
93
 
68
94
  Run `trading-boy --help` for the full command list.
69
95
 
96
+ ## Public Package Scope
97
+
98
+ 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.
99
+
70
100
  ## Pricing
71
101
 
72
102
  | Plan | Price | Tokens | Trades/mo |
@@ -82,10 +112,8 @@ All plans include every feature. Limits apply to traded tokens and logged trades
82
112
  Trading Boy exposes an MCP server for AI agent integration and a REST API for programmatic access.
83
113
 
84
114
  ```bash
85
- # Start the MCP server (for Claude, GPT, etc.)
86
- trading-boy mcp
87
-
88
115
  # REST API is hosted at https://api.cabal.ventures
116
+ # MCP server: npx @trading-boy/mcp-server (see docs/getting-started.md)
89
117
  ```
90
118
 
91
119
  ## 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