@general-liquidity/gordon-cli 0.8.18 → 0.8.21

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 CHANGED
@@ -1,455 +1,84 @@
1
- <p align="center">
2
- <img src="gordon_ascii.png" alt="Gordon" width="400">
3
- </p>
4
-
5
- <h1 align="center">The Frontier Trading Agent</h1>
6
-
7
- <p align="center">
8
- <em>Talk naturally. Trade confidently. Sleep peacefully.</em>
9
- </p>
1
+ <h1 align="center">Gordon CLI</h1>
10
2
 
11
3
  <p align="center">
12
- <a href="https://www.npmjs.com/package/@general-liquidity/gordon-cli"><img src="https://img.shields.io/npm/v/@general-liquidity/gordon-cli.svg?style=flat-square&color=d4a27f" alt="npm version"></a>
13
- <a href="https://github.com/general-liquidity/gordon-cli/actions"><img src="https://img.shields.io/github/actions/workflow/status/general-liquidity/gordon-cli/release.yml?style=flat-square&label=build" alt="build status"></a>
14
- <a href="https://github.com/general-liquidity/gordon-cli/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@general-liquidity/gordon-cli.svg?style=flat-square" alt="license"></a>
15
- <a href="https://discord.gg/general-liquidity"><img src="https://img.shields.io/discord/XXXXXXXXX?style=flat-square&logo=discord&logoColor=white&label=discord" alt="Discord"></a>
4
+ The Frontier Trading Agent
16
5
  </p>
17
6
 
18
7
  <p align="center">
19
- <a href="#installation">Installation</a> •
20
- <a href="#quick-start">Quick Start</a> •
21
- <a href="#how-it-works">How It Works</a> •
22
- <a href="#safety">Safety</a>
23
- <a href="https://docs.gordon.trade">Docs</a>
8
+ <a href="https://www.npmjs.com/package/@general-liquidity/gordon-cli">npm</a> •
9
+ <a href="https://gordoncli.com">Website</a> •
10
+ <a href="https://docs.gordon.trade">Docs</a> •
11
+ <a href="https://github.com/general-liquidity/gordon-cli-dist/releases">Downloads</a>
24
12
  </p>
25
13
 
26
- ---
27
-
28
- ## What is Gordon?
29
-
30
- Gordon is **Claude Code for vibe trading**. Describe what you want to trade in plain English, and Gordon handles the technical analysis, risk management, and order execution—with your approval at every step.
31
-
32
- ```
33
- You: I think ETH is gonna bounce here
34
-
35
- Gordon: ETH/USDT @ $3,421. RSI oversold at 28, price 1.2% above the
36
- $3,380 support (tested 4x). Looks like a textbook bounce setup.
14
+ ## Install
37
15
 
38
- Entry: $3,400 (limit, near support)
39
- Stop: $3,290 (3.2% below entry)
40
- TP1: $3,580 (50% position, +5.3%)
41
- TP2: $3,720 (50% position, +9.4%)
16
+ `npm`:
42
17
 
43
- Risk/Reward: 1:2.8 — Want me to create this plan?
44
- ```
45
-
46
- No dashboards. No charts. No complexity. Just vibes. 📈
47
-
48
- ---
49
-
50
- ## Installation
51
-
52
- **npm** (recommended)
53
18
  ```bash
54
19
  npm install -g @general-liquidity/gordon-cli
55
20
  ```
56
- Downloads the matching prebuilt binary for your platform during install.
57
-
58
- **bun**
59
- ```bash
60
- bun add -g @general-liquidity/gordon-cli
61
- ```
62
-
63
- **curl** (standalone binary)
64
- ```bash
65
- curl -fsSL https://raw.githubusercontent.com/general-liquidity/gordon-cli/main/scripts/install.sh | sh
66
- ```
67
21
 
68
- **from source**
69
- ```bash
70
- git clone https://github.com/general-liquidity/gordon-cli.git
71
- cd gordon && bun install && bun run build
72
- ```
22
+ `bun`:
73
23
 
74
- Then run:
75
24
  ```bash
76
- gordon
77
- ```
78
-
79
- ---
80
-
81
- ## Quick Start
82
-
83
- ### 1. First Run
84
-
85
- Gordon walks you through setup on first launch—API keys, preferences, safety modes.
86
-
87
- ### 2. Set Environment Variables
88
-
89
- ```bash
90
- # LLM Provider (pick one)
91
- export OPENAI_API_KEY="sk-..."
92
- export DEDALUS_API_KEY="dd-..."
93
-
94
- # Exchange (Binance for now)
95
- export BINANCE_API_KEY="..."
96
- export BINANCE_API_SECRET="..."
25
+ bun add -g @general-liquidity/gordon-cli
97
26
  ```
98
27
 
99
- ### 3. Start Talking
28
+ Standalone install script:
100
29
 
101
30
  ```bash
102
- gordon
103
- ```
104
-
105
- That's it. No config files needed. Just talk.
106
-
107
- ---
108
-
109
- ## How It Works
110
-
31
+ curl -fsSL https://raw.githubusercontent.com/general-liquidity/gordon-cli-dist/main/install.sh | sh
111
32
  ```
112
- ┌─────────────────────────────────────────────────────────────────┐
113
- │ YOU │
114
- │ "buy BTC near support" │
115
- └─────────────────────────────────────────────────────────────────┘
116
-
117
-
118
- ┌─────────────────────────────────────────────────────────────────┐
119
- │ 🛡️ MIDDLEWARE LAYER
120
- │ Input Guardrails │ Access Control │ Rate Limiting │
121
- └─────────────────────────────────────────────────────────────────┘
122
-
123
-
124
- ┌─────────────────────────────────────────────────────────────────┐
125
- │ 📈 GORDON (Mastra Agent Network)
126
- │ │
127
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
128
- │ │ Scanner │ │ Analyst │ │ Planner │ │ Executor │ │
129
- │ │ ──────── │ │ ──────── │ │ ──────── │ │ ──────── │ │
130
- │ │ Find │ │ Deep │ │ Create │ │ Execute │ │
131
- │ │ setups │ │ analysis │ │ plans │ │ orders │ │
132
- │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
133
- │ │
134
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
135
- │ │ Monitor │ │ Teacher │ │Backtester│ │ Gordon │ │
136
- │ │ ──────── │ │ ──────── │ │ ──────── │ │ ──────── │ │
137
- │ │ Track │ │ Explain │ │ Test │ │ Route & │ │
138
- │ │ positions│ │ concepts │ │ strategy │ │ orchestrate│ │
139
- │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
140
- │ │
141
- │ Handoff Validation │ Fallback Chains │ Error Recovery │
142
- └─────────────────────────────────────────────────────────────────┘
143
-
144
-
145
- ┌─────────────────────────────────────────────────────────────────┐
146
- │ 🔧 TOOLS LAYER (29 modules)
147
- │ │
148
- │ Trading: create_plan, execute_plan, close_trade, grid_plan │
149
- │ Analysis: indicators, orderbook, market_analysis, charts │
150
- │ Discovery: scan_market, trending, new_listings, top_movers │
151
- │ Risk: kelly_size, volatility_size, exit_conditions, drawdown │
152
- │ Portfolio: positions, wallet, earn, history, account │
153
- │ Backtest: run_backtest, optimize, monte_carlo, walk_forward │
154
- │ System: arm/disarm, scheduler, explain, shared_context │
155
- └─────────────────────────────────────────────────────────────────┘
156
-
157
-
158
- ┌─────────────────────────────────────────────────────────────────┐
159
- │ 💾 INFRASTRUCTURE LAYER
160
- │ │
161
- │ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
162
- │ │ Binance │ │ LLM │ │ SQLite │ │ LibSQL │ │
163
- │ │ REST+WS │ │ Providers │ │ Storage │ │ Vector │ │
164
- │ └───────────┘ └───────────┘ └───────────┘ └───────────┘ │
165
- │ │ │ │ │ │
166
- │ Orders & OpenAI Plans & Semantic │
167
- │ Market Data Anthropic Trades Memory │
168
- │ Real-time Google Events RAG │
169
- │ WebSocket Dedalus Audit Recall │
170
- └─────────────────────────────────────────────────────────────────┘
171
-
172
-
173
- ┌─────────────────────────────────────────────────────────────────┐
174
- │ TRADE PLAN │
175
- │ ┌────────────────────────────────────────────────────────────┐ │
176
- │ │ + BUY 0.15 ETH @ $3,400 (limit) │ │
177
- │ │ + STOP 0.15 ETH @ $3,290 (stop-limit) │ │
178
- │ │ + SELL 0.075 ETH @ $3,580 (TP1) │ │
179
- │ │ + SELL 0.075 ETH @ $3,720 (TP2) │ │
180
- │ └────────────────────────────────────────────────────────────┘ │
181
- │ │
182
- │ [ APPROVE ] [ MODIFY ] [ REJECT ] │
183
- └─────────────────────────────────────────────────────────────────┘
184
-
185
- ▼ (only if you approve + ARM)
186
- ┌─────────────────────────────────────────────────────────────────┐
187
- │ EXECUTION │
188
- │ Orders placed on Binance. Gordon monitors. │
189
- │ Auto-disarms after 24h. You stay in control. │
190
- └─────────────────────────────────────────────────────────────────┘
191
- ```
192
-
193
- ---
194
-
195
- ## Safety
196
33
 
197
- Gordon is paranoid about your money. Here's how:
34
+ Windows PowerShell:
198
35
 
199
- | Protection | Description |
200
- |------------|-------------|
201
- | 🔒 **SAFE Mode Default** | Gordon starts in SAFE mode. Can analyze, cannot trade. |
202
- | ⏰ **24h Auto-Disarm** | ARMED mode expires automatically. No forgotten bots. |
203
- | ✋ **Human Approval** | Every order requires explicit "yes". No exceptions. |
204
- | 📊 **Risk Disclosure** | See exact $ at risk before every trade. |
205
- | 🛡️ **Position Limits** | Configurable max allocation per trade (default 10%). |
206
- | 💰 **Cash Reserve** | Always keeps 20% cash. Never goes all-in. |
207
-
208
- ```
209
- SAFE MODE (default) ARMED MODE (you enable)
210
- ───────────────────── ─────────────────────────
211
- ✓ Scan markets ✓ Everything in SAFE, plus:
212
- ✓ Analyze coins ✓ Execute approved plans
213
- ✓ Create plans ✓ Place real orders
214
- ✓ Explain concepts ✓ Monitor positions
215
- ✗ Execute trades ⏰ Auto-expires in 24h
36
+ ```powershell
37
+ irm https://raw.githubusercontent.com/general-liquidity/gordon-cli-dist/main/install.ps1 | iex
216
38
  ```
217
39
 
218
- ---
219
-
220
- ## Everything We Built
221
-
222
- ~200 TypeScript files implementing a production-grade trading platform.
223
-
224
- ### Core Platform
225
-
226
- - **8-Agent Network** — Mastra-based orchestration: Scanner, Analyst, Planner, Executor, Monitor, Teacher, Backtester, Gordon (coordinator)
227
- - **Agent Handoffs** — Validated transitions between agents with fallback chains and error recovery
228
- - **Cross-Agent Memory** — Shared context allowing agents to pass analysis, plans, and backtest results
229
- - **Semantic Memory** — LibSQL Vector for RAG-based recall of past trades and analyses
230
- - **LLM Client** — Multi-provider support (OpenAI, Anthropic Claude, Google Gemini, Dedalus Labs)
231
-
232
- ### Security & Middleware
233
-
234
- - **Input Guardrails** — Prompt injection detection, dangerous command blocking
235
- - **Output Sanitization** — Sensitive data filtering in responses
236
- - **Access Control** — ARMED mode enforcement for trading tools
237
- - **Rate Limiting** — Per-agent, per-tool rate limits to prevent abuse
238
- - **Audit Logging** — Comprehensive trail of all sensitive operations
239
-
240
- ### Observability
40
+ The npm package is a thin wrapper. It downloads the matching prebuilt binary for your platform during install.
241
41
 
242
- - **OpenTelemetry Tracing** — Distributed tracing for agent calls and tool execution
243
- - **Metrics Collection** — Tool invocation counts, success/failure rates, latency tracking
244
- - **Request Monitoring** — Per-request performance metrics and error classification
42
+ ## Supported binaries
245
43
 
246
- ### Trading Engine
44
+ - macOS arm64
45
+ - macOS x64
46
+ - Linux arm64
47
+ - Linux x64
48
+ - Windows x64
247
49
 
248
- - **Scanner** Market-wide opportunity detection across top 50 cryptos
249
- - **Analyzer** — Deep technical analysis per coin with multiple timeframes
250
- - **Planner** — AI-powered trade plan generation with entry/SL/TP levels
251
- - **Validator** — Risk checks, position limits, allocation validation
252
- - **Executor** — Order placement with OCO orders and rollback on failure
253
- - **Monitor** — Real-time position tracking via WebSocket, fill detection, alerts
254
- - **Trailing Stops** — Automatic trailing stop-loss management
255
- - **Order Recovery** — Automatic recovery mechanism for failed/interrupted orders
256
- - **Grid Calculator** — DCA and grid entry calculations
50
+ Release binaries and package manager manifests are published at:
257
51
 
258
- ### Trading Strategies
52
+ - `https://github.com/general-liquidity/gordon-cli-dist/releases`
259
53
 
260
- - **Tier 1 (Beginner):** Support Bounce, Bollinger Bounce, SMA Crossover, Volume Surge, VWAP Bounce
261
- - **Tier 2 (Intermediate):** Consolidation Pop, ADX Trend, EMA-RSI Crossover, Relative Strength, Engulfing Pattern
262
- - **Strategy Ensemble** — Combine multiple strategies with configurable weights
54
+ ## Setup
263
55
 
264
- ### Backtesting Engine
56
+ Set one LLM provider key before first launch:
265
57
 
266
- - **Historical Simulation** — Full backtesting against historical data
267
- - **Monte Carlo Analysis** — Statistical confidence intervals
268
- - **Walk-Forward Validation** — Out-of-sample testing
269
- - **Grid Search Optimization** — Hyperparameter tuning
270
- - **Alpha Decay Analysis** — Strategy degradation detection
271
- - **Performance Metrics** — Sharpe ratio, max drawdown, profit factor, win rate
272
-
273
- ### Technical Analysis
274
-
275
- - **RSI** — Relative Strength Index (oversold/overbought)
276
- - **MACD** — Momentum and trend direction
277
- - **Bollinger Bands** — Volatility and mean reversion
278
- - **ATR** — Average True Range for stop placement
279
- - **VWAP** — Volume Weighted Average Price
280
- - **Stochastic RSI** — Momentum oscillator
281
- - **EMA/SMA** — Trend following indicators
282
- - **Volume Analysis** — Confirmation signals and whale detection
283
- - **Support/Resistance** — Automatic level detection
284
-
285
- ### Infrastructure
286
-
287
- - **Binance Client** — Full REST API with HMAC signing, rate limiting, circuit breaker
288
- - **Binance WebSocket** — Real-time price feeds and order updates
289
- - **SQLite Storage** — Plans, trades, events, audit logs with WAL mode
290
- - **LibSQL Vector** — Semantic memory and RAG for conversation recall
291
- - **Service Container** — Dependency injection for clean architecture
292
- - **Repository Pattern** — Data access layer for trades and plans
293
- - **Event Bus** — Event-driven architecture for system coordination
294
- - **Caching Layer** — Price and result caching with TTL
295
- - **Resilience** — Retry logic, exponential backoff, circuit breakers, fallback chains
296
-
297
- ### User Experience
298
-
299
- - **Ink CLI** — React-based terminal UI with theme support
300
- - **Real-time Chat** — Streaming responses with agent attribution
301
- - **Onboarding Flow** — First-run setup wizard
302
- - **Model Selector** — Choose your preferred LLM
303
- - **Keyboard Shortcuts** — Power user navigation
304
- - **Command Autocomplete** — Slash command suggestions
305
- - **Status Bar** — Mode, portfolio value, BTC price, connection status
306
-
307
- ---
308
-
309
- ## Configuration
310
-
311
- Gordon stores config at `~/.gordon/config.json`:
312
-
313
- ```json
314
- {
315
- "version": "1.0.0",
316
- "mode": "SAFE",
317
- "preferences": {
318
- "cashReservePercent": 0.2,
319
- "maxAllocationPerTrade": 0.1,
320
- "defaultTimeframes": ["1h", "4h"],
321
- "topNCoins": 50
322
- }
323
- }
58
+ ```bash
59
+ export OPENAI_API_KEY="sk-..."
324
60
  ```
325
61
 
326
- ### Environment Variables
327
-
328
- | Variable | Required | Description |
329
- |----------|----------|-------------|
330
- | `OPENAI_API_KEY` | One LLM | OpenAI API key |
331
- | `ANTHROPIC_API_KEY` | provider | Anthropic Claude API key |
332
- | `GOOGLE_GENERATIVE_AI_API_KEY` | required | Google Gemini API key |
333
- | `DEDALUS_API_KEY` | | Dedalus Labs API key (20+ models) |
334
- | `BINANCE_API_KEY` | For trading | Binance API key |
335
- | `BINANCE_API_SECRET` | For trading | Binance secret |
336
-
337
- ---
338
-
339
- ## Development
62
+ or
340
63
 
341
64
  ```bash
342
- bun install # Install dependencies
343
- bun run dev # Development mode (hot reload)
344
- bun test # Run tests
345
- bun run typecheck # Type check
346
- bun run build # Build for npm
347
- bun run build:binary # Build standalone executable
65
+ export DEDALUS_API_KEY="dd-..."
348
66
  ```
349
67
 
350
- ### Project Structure
68
+ or
351
69
 
70
+ ```bash
71
+ export INCEPTION_API_KEY="..."
352
72
  ```
353
- gordon/
354
- ├── src/
355
- │ ├── app/ # Terminal UI (React + Ink)
356
- │ │ ├── App.tsx
357
- │ │ ├── ChatView.tsx
358
- │ │ ├── ChatInput.tsx
359
- │ │ ├── components/ # Reusable UI components
360
- │ │ └── ...
361
- │ ├── core/ # Trading logic
362
- │ │ ├── scanner.ts
363
- │ │ ├── analyzer.ts
364
- │ │ ├── planner.ts
365
- │ │ ├── executor.ts
366
- │ │ ├── monitor.ts
367
- │ │ ├── trailing-stop.ts
368
- │ │ ├── indicators/ # Technical indicators
369
- │ │ └── risk-management/
370
- │ ├── backtest/ # Backtesting engine
371
- │ │ ├── engine.ts
372
- │ │ ├── monte-carlo.ts
373
- │ │ ├── walk-forward.ts
374
- │ │ └── optimization/
375
- │ ├── strategies/ # Trading strategies
376
- │ │ ├── tier-1/ # Beginner strategies
377
- │ │ ├── tier-2/ # Intermediate strategies
378
- │ │ └── ensemble.ts
379
- │ ├── services/ # Business services
380
- │ │ ├── trading.service.ts
381
- │ │ ├── portfolio.service.ts
382
- │ │ └── container.ts # Dependency injection
383
- │ ├── repositories/ # Data access layer
384
- │ ├── infra/ # Infrastructure
385
- │ │ ├── agents/ # Mastra multi-agent system
386
- │ │ │ ├── tools/ # 29 tool modules
387
- │ │ │ └── middleware/ # Guardrails, access control
388
- │ │ ├── binance/ # Exchange client + WebSocket
389
- │ │ ├── llm/ # LLM providers
390
- │ │ ├── storage/ # SQLite + config
391
- │ │ ├── observability/ # OpenTelemetry tracing + metrics
392
- │ │ ├── audit/ # Audit logging
393
- │ │ └── cache/ # Caching layer
394
- │ ├── events/ # Event-driven architecture
395
- │ └── types/ # TypeScript definitions
396
- ├── prompts/ # LLM prompt templates
397
- ├── scripts/ # Install scripts
398
- └── .github/ # CI/CD workflows
399
- ```
400
-
401
- ---
402
-
403
- ## Roadmap
404
-
405
- - [x] Support Bounce strategy
406
- - [x] Binance spot trading
407
- - [x] Multi-provider LLM (OpenAI, Anthropic, Google, Dedalus)
408
- - [x] Plan-as-diff approval UI
409
- - [x] SAFE/ARMED modes with 24h auto-expiry
410
- - [x] Trailing stops
411
- - [x] 10+ trading strategies (tier 1 & tier 2)
412
- - [x] Backtesting engine with Monte Carlo & walk-forward
413
- - [x] Real-time WebSocket monitoring
414
- - [x] Order recovery mechanism
415
- - [x] Audit logging & security guardrails
416
- - [ ] More exchanges (Coinbase, Kraken)
417
- - [ ] Portfolio rebalancing
418
- - [ ] Mobile notifications
419
- - [ ] Paper trading mode
420
-
421
- ---
422
-
423
- ## Contributing
424
73
 
425
- We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
74
+ Then run:
426
75
 
427
76
  ```bash
428
- # Fork, clone, then:
429
- bun install
430
- bun test
431
- # Make changes, add tests, submit PR
77
+ gordon
432
78
  ```
433
79
 
434
- ---
435
-
436
- ## License
80
+ ## Docs
437
81
 
438
- MIT © [General Liquidity, Inc.](https://generalliquidity.com)
439
-
440
- ---
441
-
442
- <p align="center">
443
- <sub>
444
- <em>"The most valuable commodity I know of is information."</em>
445
- <br>
446
- — Gordon Gekko (the other one)
447
- </sub>
448
- </p>
449
-
450
- <p align="center">
451
- <a href="https://github.com/general-liquidity/gordon-cli">GitHub</a> •
452
- <a href="https://www.npmjs.com/package/@general-liquidity/gordon-cli">npm</a> •
453
- <a href="https://discord.gg/general-liquidity">Discord</a> •
454
- <a href="https://docs.gordon.trade">Docs</a>
455
- </p>
82
+ - Website: `https://gordoncli.com`
83
+ - Docs: `https://docs.gordon.trade`
84
+ - Public distribution repo: `https://github.com/general-liquidity/gordon-cli-dist`
package/lib/platform.cjs CHANGED
@@ -38,9 +38,9 @@ function getInstalledBinaryPath(packageRoot = path.resolve(__dirname, ".."), pla
38
38
  function getDownloadUrl(version, platform = process.platform, arch = process.arch) {
39
39
  const { assetName } = getTarget(platform, arch);
40
40
  const cleanVersion = String(version).replace(/^v/, "");
41
+ const distRepo = process.env.GORDON_BINARY_DIST_REPO || "general-liquidity/gordon-cli-dist";
41
42
  const baseUrl =
42
- process.env.GORDON_BINARY_BASE_URL ||
43
- `https://github.com/general-liquidity/gordon-cli/releases/download/v${cleanVersion}`;
43
+ process.env.GORDON_BINARY_BASE_URL || `https://github.com/${distRepo}/releases/download/v${cleanVersion}`;
44
44
  return `${baseUrl.replace(/\/$/, "")}/${assetName}`;
45
45
  }
46
46
 
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@general-liquidity/gordon-cli",
3
- "version": "0.8.18",
3
+ "version": "0.8.21",
4
4
  "description": "The Frontier Trading Agent",
5
5
  "author": "General Liquidity, Inc.",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/general-liquidity/gordon-cli.git"
9
+ "url": "https://github.com/general-liquidity/gordon-cli-dist.git"
10
10
  },
11
- "homepage": "https://github.com/general-liquidity/gordon-cli#readme",
12
- "bugs": "https://github.com/general-liquidity/gordon-cli/issues",
11
+ "homepage": "https://gordoncli.com",
12
+ "bugs": "https://github.com/general-liquidity/gordon-cli-dist/issues",
13
13
  "keywords": [
14
14
  "trading",
15
15
  "crypto",