@hedge-layer/cli 1.5.0 → 1.7.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.
- package/README.md +32 -118
- package/dist/index.mjs +573 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@hedge-layer/cli)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
|
|
6
|
-
Command-line interface for [Hedge Layer](https://hedgelayer.ai)
|
|
6
|
+
Command-line interface for [Hedge Layer](https://hedgelayer.ai): prediction market intelligence from the terminal.
|
|
7
|
+
|
|
8
|
+
The canonical CLI guide now lives in the Hedge Layer web app docs:
|
|
9
|
+
[hedgelayer.ai/docs/cli](https://hedgelayer.ai/docs/cli).
|
|
7
10
|
|
|
8
11
|
## Install
|
|
9
12
|
|
|
@@ -16,7 +19,7 @@ Requires Node.js 22 or later.
|
|
|
16
19
|
## Quick Start
|
|
17
20
|
|
|
18
21
|
```bash
|
|
19
|
-
# 1. Create an API token at https://hedgelayer.ai/settings
|
|
22
|
+
# 1. Create an API token at https://hedgelayer.ai/account/settings
|
|
20
23
|
# 2. Authenticate the CLI
|
|
21
24
|
hl auth login
|
|
22
25
|
|
|
@@ -25,138 +28,49 @@ hl brief "US China trade war tariffs"
|
|
|
25
28
|
|
|
26
29
|
# 4. Or start an interactive research session
|
|
27
30
|
hl research
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Authentication
|
|
31
|
-
|
|
32
|
-
The CLI uses API tokens created in the Hedge Layer web app. Tokens are stored locally in `~/.hedgelayer/config.json`.
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
hl auth login # Paste your API token (interactive)
|
|
36
|
-
hl auth status # Check current authentication
|
|
37
|
-
hl auth logout # Remove stored token
|
|
38
|
-
```
|
|
39
31
|
|
|
40
|
-
|
|
32
|
+
# 5. Run the persisted liquidity-provider loop
|
|
33
|
+
hl lp scan "liquidity opportunities"
|
|
34
|
+
hl lp recommend --scan-id <scan-id>
|
|
35
|
+
hl lp evaluate
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
hl
|
|
37
|
+
# 6. Check linked wallet funds
|
|
38
|
+
hl wallet balances
|
|
44
39
|
```
|
|
45
40
|
|
|
46
41
|
## Commands
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Generate a Market Brief directly from a topic — no Q&A, no interactive session. The AI researches current events, discovers relevant prediction markets, and synthesizes a structured brief with causal reasoning and coverage gaps.
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
# Generate a brief (streams progress to stderr, brief to stdout)
|
|
54
|
-
hl brief "US China trade war tariffs"
|
|
55
|
-
hl brief "hurricane season impact on Florida" --location "US Southeast" --time-horizon "6 months"
|
|
56
|
-
|
|
57
|
-
# Pipe the brief as JSON
|
|
58
|
-
hl --json brief "crypto regulation 2026" | jq '.markets'
|
|
59
|
-
|
|
60
|
-
# Filter by tags and volume
|
|
61
|
-
hl brief "energy policy" --tags "geopolitics,energy" --min-volume 10000
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
| Option | Description |
|
|
65
|
-
|--------|-------------|
|
|
66
|
-
| `-l, --location <loc>` | Geographic context (e.g. `"Middle East"`, `"US"`) |
|
|
67
|
-
| `-t, --time-horizon <h>` | Time frame (e.g. `"3 months"`, `"2026"`) |
|
|
68
|
-
| `--tags <tags>` | Comma-separated focus area tags (e.g. `"geopolitics,energy"`) |
|
|
69
|
-
| `--min-volume <n>` | Minimum market volume in USD |
|
|
70
|
-
| `--max-yes-price <n>` | Maximum YES price (0-1) |
|
|
71
|
-
|
|
72
|
-
### Research
|
|
73
|
-
|
|
74
|
-
AI-powered interactive research sessions. Describe a topic or thesis, and the AI researches current events, discovers relevant prediction markets, and synthesizes a structured Market Brief through a multi-turn conversation.
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Start an interactive research session (Q&A)
|
|
78
|
-
hl research
|
|
79
|
-
|
|
80
|
-
# Non-interactive: same Market Brief as `hl brief`, JSON on stdout (blocking `POST /api/brief` with stream off)
|
|
81
|
-
hl research run "US election forecasting"
|
|
82
|
-
|
|
83
|
-
# List past research sessions
|
|
84
|
-
hl research list
|
|
85
|
-
hl research list --status completed
|
|
43
|
+
Full command documentation is available at
|
|
44
|
+
[hedgelayer.ai/docs/cli](https://hedgelayer.ai/docs/cli).
|
|
86
45
|
|
|
87
|
-
|
|
88
|
-
hl research show <id>
|
|
89
|
-
|
|
90
|
-
# Delete a session
|
|
91
|
-
hl research delete <id>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
For a **non-interactive** JSON brief from the shell, use `hl research run` (blocking) or `hl brief` (streams progress on stderr). Both use the same `POST /api/brief` endpoint.
|
|
95
|
-
|
|
96
|
-
### Feed
|
|
97
|
-
|
|
98
|
-
Deterministic ranking of active Polymarket markets (same engine as the in-app **getFeed** tool and `GET /api/feed`). No LLM — fast quantitative screens.
|
|
46
|
+
Liquidity-provider workflows are available under `hl lp`:
|
|
99
47
|
|
|
100
48
|
```bash
|
|
101
|
-
|
|
102
|
-
hl
|
|
103
|
-
hl
|
|
104
|
-
|
|
105
|
-
# Deep books that are either new (last 7d) or long-dated (90d+ to resolution), sorted by liquidity
|
|
106
|
-
hl feed liquid-new-or-long
|
|
107
|
-
|
|
108
|
-
# Custom: e.g. crypto tag only, sort by movement
|
|
109
|
-
hl feed --tag crypto --sort-by movement --limit 25
|
|
110
|
-
|
|
111
|
-
# Candidate screen tuned for allocator dry-run cycles
|
|
112
|
-
hl feed liquidity-provider
|
|
49
|
+
hl lp scan "liquidity opportunities" # persist candidate evidence
|
|
50
|
+
hl lp recommend --scan-id <scan-id> # recommend allocate/reduce/exit actions
|
|
51
|
+
hl lp evaluate # summarize PnL lessons
|
|
52
|
+
hl lp run # run the dry-run chain
|
|
113
53
|
```
|
|
114
54
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
### Allocator
|
|
118
|
-
|
|
119
|
-
Run the liquidity-provider loop from the terminal. The CLI first fetches feed candidates, then calls `POST /api/allocator/cycle` with your API token. The web API enforces user-scoped auth and dry-run mode; this command plans allocations and passive orders but does not place live trades.
|
|
55
|
+
Wallet commands are available under `hl wallet`:
|
|
120
56
|
|
|
121
57
|
```bash
|
|
122
|
-
|
|
123
|
-
hl
|
|
124
|
-
|
|
125
|
-
#
|
|
126
|
-
hl
|
|
127
|
-
|
|
128
|
-
# Pipe machine-readable decisions into jq
|
|
129
|
-
hl --json allocator cycle --capital-limit 1000 --per-market-limit 150 | jq '.result.summary'
|
|
130
|
-
|
|
131
|
-
# Continue a monitoring/rebalance cycle from existing allocation state
|
|
132
|
-
hl allocator cycle --allocations ./allocations.json
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Key options include `--capital-limit`, `--per-market-limit`, `--min-expected-return-daily-pct`, `--max-order-notional`, `--max-spread`, `--allocator-min-liquidity`, and the same feed filters used by `hl feed`.
|
|
136
|
-
|
|
137
|
-
### Profile
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
hl profile
|
|
58
|
+
hl wallet status # show linked owner and Polymarket deposit wallet status
|
|
59
|
+
hl wallet balances # show available pUSD, USDC.e, and POL
|
|
60
|
+
hl wallet funds # alias for balances
|
|
61
|
+
hl wallet deposit # show public Polygon deposit address and assets
|
|
62
|
+
hl wallet deposit --bridge # also show Polymarket Bridge deposit addresses
|
|
63
|
+
hl wallet withdraw --asset pUSD --amount 10 --to 0x...
|
|
141
64
|
```
|
|
142
65
|
|
|
143
|
-
|
|
66
|
+
`hl wallet withdraw` creates a withdrawal intent, opens the browser signing page,
|
|
67
|
+
and polls until the deposit-wallet transfer succeeds, fails, or times out.
|
|
68
|
+
The CLI token never receives wallet signing power.
|
|
144
69
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
| `--token <token>` | Override stored API token |
|
|
150
|
-
| `--verbose` | Show HTTP request/response details |
|
|
151
|
-
| `--no-color` | Disable colored output |
|
|
152
|
-
|
|
153
|
-
### JSON output
|
|
154
|
-
|
|
155
|
-
Every command supports `--json` for pipe-friendly output:
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
hl --json research list | jq '.[0].id'
|
|
159
|
-
```
|
|
70
|
+
Withdrawals currently send `pUSD` from the linked Polymarket deposit wallet on Polygon.
|
|
71
|
+
Keep a small `POL` balance in the owner wallet for Polygon gas; without native
|
|
72
|
+
`POL`, the browser-signed transfer can fail even when the deposit wallet has
|
|
73
|
+
enough `pUSD`.
|
|
160
74
|
|
|
161
75
|
## Changelog
|
|
162
76
|
|