@vike-io/cli 0.7.3 → 0.8.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/CHANGELOG.md +7 -0
- package/SKILL.md +79 -1
- package/package.json +1 -1
- package/skills/vike-hl-position-match/SKILL.md +86 -0
- package/skills/vike-router/SKILL.md +1 -0
- package/src/commands/install.js +125 -0
- package/src/commands/perp.js +24 -0
- package/src/index.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes are documented here. Entries follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
4
4
|
|
|
5
|
+
## 0.8.0 — HL share-card reverse-lookup + multi-IDE installer + SKILL.md hardening
|
|
6
|
+
|
|
7
|
+
- **`vike perp find-position`** (new command, alias for the new `hl_position_match` MCP tool). Reverse-lookup a Hyperliquid open position from share-card details: paste `coin + side + leverage + entry` and get the wallet(s) holding a matching open position back. Walks widening entry tolerance bands (tight 0.05% → loose 0.5% → fallback 1.0%) with leverage tolerance ±0.5; tie-break by closest mark price. Returns `tolerance_used` so callers can flag low-confidence matches. Backed by `position_snapshots_latest` — near-real-time, no new schema.
|
|
8
|
+
- **`vike install`** (new command). One-shot multi-IDE skill drop: `--claude` writes `~/.claude/skills/vike/SKILL.md`; `--cursor` / `--copilot` / `--agents` update marker-fenced blocks in `.cursorrules` / `.github/copilot-instructions.md` / `AGENTS.md` (idempotent — re-running replaces the block, never clobbers surrounding user content). `--all` writes every target at once.
|
|
9
|
+
- **Root `SKILL.md` hardening**: added a "Critical Rules" block (8 hard rules agents most often violate), per-service "Historical Data Availability" tables (transfers per chain, prices per venue, HL perps, CEX perps, Polymarket — so agents stop over-promising data we don't have), and UTM-tagged signup links for attribution.
|
|
10
|
+
- New skill playbook: `vike-hl-position-match`. Total: 40 skills (was 39), 35 MCP tools (was 34).
|
|
11
|
+
|
|
5
12
|
## 0.7.3 — agent-discoverable SKILL.md + auto GH releases
|
|
6
13
|
|
|
7
14
|
- **Root-level `SKILL.md`** — single agent-discoverable entry point covering all 34 MCP tools, auth flow, intent → tool routing table, and per-service tool reference. Ships in the npm package so installing `@vike-io/cli` also installs the skill. Existing per-tool playbooks under `skills/` are unchanged and cross-linked from the root.
|
package/SKILL.md
CHANGED
|
@@ -12,6 +12,21 @@ Answer on-chain questions using the vike.io platform: 11 chains (ETH, BSC, Base,
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
+
## Critical Rules
|
|
16
|
+
|
|
17
|
+
Hard rules — agents that violate these produce wrong answers. Read once, apply always.
|
|
18
|
+
|
|
19
|
+
1. **Addresses are always full 0x-hex (42 chars).** Never truncate when querying. Never display truncated when the user asks for the address — they'll copy-paste it.
|
|
20
|
+
2. **Symbols are case-insensitive in queries, but display as the user typed.** `btc` and `BTC` both resolve; echo back what they wrote.
|
|
21
|
+
3. **Time windows are UTC, day-boundaries cut at 00:00 UTC.** "Today" = since 00:00 UTC today, not local-time today.
|
|
22
|
+
4. **Default page size is 50, max 500.** Don't request `--limit 10000` to "get everything" — paginate or use a screener tool instead.
|
|
23
|
+
5. **Refresh cadence varies by tool.** Wallet PnL, HL positions: ≤2 min. Transfer-derived metrics: 5 min. Token price history: 1 min. Always assume <5 min unless a tool says otherwise.
|
|
24
|
+
6. **USD amounts are floats in dollars.** `--min-usd 10000` = ten thousand dollars, not micro-USD.
|
|
25
|
+
7. **`--json` flag is always available** on CLI commands and gives stable machine-readable output. Default (human) format may change; `--json` will not.
|
|
26
|
+
8. **Resolve a token before asking transfer/holder questions.** `token_search` → take the canonical address → pass to `token_transfers` / `token_holders`. Symbol-only queries lose precision on tickers that collide across chains (e.g. FUN, BEAM, USDC).
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
15
30
|
## Step 1: Confirm Authentication
|
|
16
31
|
|
|
17
32
|
Follow this decision tree **before every session**. Do not skip to Step 2 until auth is confirmed.
|
|
@@ -32,7 +47,7 @@ If the user has no API key yet, tell them:
|
|
|
32
47
|
|
|
33
48
|
> **To use vike, you'll need a free API key:**
|
|
34
49
|
>
|
|
35
|
-
> 1. Visit https://vike.io/api/keys, sign in, and copy a key (starts with `vk_`).
|
|
50
|
+
> 1. Visit https://vike.io/api/keys?utm_source=skill&utm_medium=ai&utm_campaign=cli_skill, sign in, and copy a key (starts with `vk_`).
|
|
36
51
|
> 2. Save it: `vike login --api-key vk_...` (or `export VIKE_API_KEY=vk_...`).
|
|
37
52
|
> 3. Verify: `vike doctor`.
|
|
38
53
|
>
|
|
@@ -68,6 +83,7 @@ X-API-KEY: vk_...
|
|
|
68
83
|
| Funding rates across CEX perps (Binance/Bybit/OKX/Aster/HL) | **CEX Perps** | `vike perp funding` / `perp_funding` |
|
|
69
84
|
| Price spreads of same symbol across CEX perp venues | **CEX Perps** | `vike perp spreads` / `perp_spreads` |
|
|
70
85
|
| Top Hyperliquid perp traders by PnL / volume | **HL Perps** | `vike perp top-traders` / `hl_perp_top_traders` |
|
|
86
|
+
| Reverse-lookup an HL share card → which wallet holds it | **HL Perps** | `vike perp find-position` / `hl_position_match` |
|
|
71
87
|
| Deribit options flow, put/call ratios, IV | **Options** | `vike options flow` / `options_flow` |
|
|
72
88
|
| Active Polymarket markets, volume, odds | **Polymarket** | `vike polymarket markets` / `polymarket_markets` |
|
|
73
89
|
| Single Polymarket market detail | **Polymarket** | `vike polymarket detail` / `polymarket_market_detail` |
|
|
@@ -195,6 +211,7 @@ On-chain perps data: snapshots, fills, ledger, funding, attribution.
|
|
|
195
211
|
| Tool | Description | Skill |
|
|
196
212
|
|---|---|---|
|
|
197
213
|
| `hl_perp_top_traders` | Top HL traders by PnL/volume over a window | [vike-hl-top-traders](skills/vike-hl-top-traders/SKILL.md), [vike-hl-trader-profile](skills/vike-hl-trader-profile/SKILL.md) |
|
|
214
|
+
| `hl_position_match` | Reverse-lookup: share-card details (coin/side/lev/entry) → wallet holding that open position | [vike-hl-position-match](skills/vike-hl-position-match/SKILL.md) |
|
|
198
215
|
|
|
199
216
|
For per-symbol HL screening / individual trader deep-dive, use [vike-perp-screener](skills/vike-perp-screener/SKILL.md) and [vike-hl-trader-profile](skills/vike-hl-trader-profile/SKILL.md).
|
|
200
217
|
|
|
@@ -260,6 +277,67 @@ General web search + AI-summarized fetch for off-chain context (news, docs, soci
|
|
|
260
277
|
|
|
261
278
|
---
|
|
262
279
|
|
|
280
|
+
## Historical data availability
|
|
281
|
+
|
|
282
|
+
Coverage windows per dataset. Don't ask for data older than the window — the tool will return empty or 503.
|
|
283
|
+
|
|
284
|
+
### Transfers & on-chain (per chain)
|
|
285
|
+
|
|
286
|
+
| Chain | Earliest block / date | Notes |
|
|
287
|
+
|---|---|---|
|
|
288
|
+
| Ethereum | 2018-01 (block ~4.85M) | Full history; ETH + ERC-20 |
|
|
289
|
+
| BSC | 2021-01 | Full history; BNB + BEP-20 |
|
|
290
|
+
| Base | 2023-08 (chain launch) | Full history |
|
|
291
|
+
| Arbitrum | 2024-Q3 onward | Backfill in progress; pre-2024 sparse |
|
|
292
|
+
| HyperEVM | 2025-Q1 (chain launch) | Full history |
|
|
293
|
+
| Bitcoin | 2024-01 | Recent windows only — full-history backfill not active |
|
|
294
|
+
| Solana | 2026-Q1 onward | Recent only — see `vike-cli` chain-coverage notes |
|
|
295
|
+
| Tron/XMR/ZEC/Dash | 2024 onward | Recent only |
|
|
296
|
+
|
|
297
|
+
### Prices (data_history, spot)
|
|
298
|
+
|
|
299
|
+
| Venue | Earliest | Notes |
|
|
300
|
+
|---|---|---|
|
|
301
|
+
| Binance | 2017-08 | Full minute-level OHLCV |
|
|
302
|
+
| Bybit | 2020-03 | Full minute-level OHLCV |
|
|
303
|
+
| OKX | 2019-04 | Full minute-level OHLCV |
|
|
304
|
+
| Gate | 2017 (CSV) → 2024-05 (CSV ends) | After 2024-05 use API; capped 10k minutes/request |
|
|
305
|
+
| Coinbase | 2015 | Full history (recently added) |
|
|
306
|
+
| KuCoin | 2018 | Full history (recently added) |
|
|
307
|
+
| Pyth | 2023 | On-chain price feed; sparse pre-2023 |
|
|
308
|
+
| Deribit options | 2020 onward | BTC + ETH only |
|
|
309
|
+
|
|
310
|
+
### Hyperliquid perps (hl_perps DB)
|
|
311
|
+
|
|
312
|
+
| Dataset | Window | Notes |
|
|
313
|
+
|---|---|---|
|
|
314
|
+
| Snapshots (positions / equity) | 30 days | TTL — older snapshots dropped |
|
|
315
|
+
| Fills | 30 days | TTL |
|
|
316
|
+
| Ledger (deposits/withdrawals) | 30 days | TTL |
|
|
317
|
+
| Funding payments | 90 days | API-backed since 2026-04-22 |
|
|
318
|
+
| Daily attributed PnL | All-time | `wallet_pnl_attributed_daily` is the long-history view |
|
|
319
|
+
| Daily flows | All-time | `wallet_flows_daily` |
|
|
320
|
+
| Top-trader leaderboards | rolling 24h / 7d / 30d | derived on-the-fly |
|
|
321
|
+
|
|
322
|
+
### CEX perps (data_perp DB)
|
|
323
|
+
|
|
324
|
+
| Dataset | Window |
|
|
325
|
+
|---|---|
|
|
326
|
+
| `tickers_1m` (ticker snapshots) | rolling 24h |
|
|
327
|
+
| Funding rates | 90 days |
|
|
328
|
+
| Trades (ws_trades) | rolling 7-30 days per venue |
|
|
329
|
+
|
|
330
|
+
### Polymarket
|
|
331
|
+
|
|
332
|
+
| Dataset | Window | Notes |
|
|
333
|
+
|---|---|---|
|
|
334
|
+
| Active markets | live | scraper paused 2026-05-24 (CF block); historical snapshots still queryable |
|
|
335
|
+
| Wallet positions | last known snapshot | not real-time until scraper resumes |
|
|
336
|
+
|
|
337
|
+
If your query needs older data than what's listed: say so clearly and offer the nearest in-range window. Don't silently return empty.
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
263
341
|
## Cost & rate-limit awareness
|
|
264
342
|
|
|
265
343
|
- **Cheap (counts as 1 credit):** `token_search`, `wallet_summary`, `alerts_list`, `wallet_ens`, `perp_funding`.
|
package/package.json
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vike-hl-position-match
|
|
3
|
+
description: Reverse-lookup a Hyperliquid open position from share-card details (coin + side + leverage + entry price). Use when the user pastes or describes a HL share card and asks "whose card is this?", "find this trader", or "who has a 25x ETH long open at $3,200?". Returns matching wallet(s) ranked by entry-price proximity.
|
|
4
|
+
allowed-tools: Bash(vike:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# vike-hl-position-match
|
|
8
|
+
|
|
9
|
+
Find the wallet(s) holding an open Hyperliquid perp position that match a share card.
|
|
10
|
+
|
|
11
|
+
## Command
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
vike perp find-position
|
|
15
|
+
--coin <SYM> # e.g. BTC, ETH, SOL
|
|
16
|
+
--side long|short
|
|
17
|
+
--leverage <X> # e.g. 25
|
|
18
|
+
--entry <PRICE> # entry price from the card
|
|
19
|
+
[--mark <PRICE>] # current mark price — sharpens tie-break when multiple wallets share entry
|
|
20
|
+
[--limit N] # max matches, default 10, max 50
|
|
21
|
+
[--json]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## How matching works
|
|
25
|
+
|
|
26
|
+
The tool walks three widening entry-price tolerance bands until it finds at least one match:
|
|
27
|
+
|
|
28
|
+
| Band | Tolerance | When it's used |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| tight | ±0.05% | First pass — most share cards round-trip exactly |
|
|
31
|
+
| loose | ±0.5% | Fallback if no tight matches |
|
|
32
|
+
| fallback | ±1.0% | Last resort — anything wider is noise |
|
|
33
|
+
|
|
34
|
+
Leverage must be within **±0.5** of the queried value (so `--leverage 5` matches positions at 4.5×–5.5×). Tie-breaking inside a band is by closest live `mark_price` to the queried `--mark` (or to `--entry` if `--mark` is not given).
|
|
35
|
+
|
|
36
|
+
The response includes `tolerance_used` so the caller knows which band matched (`tight` / `loose` / `fallback` / `no_match`).
|
|
37
|
+
|
|
38
|
+
## Common queries
|
|
39
|
+
|
|
40
|
+
| User says | Flags |
|
|
41
|
+
|---|---|
|
|
42
|
+
| "Find this share card: 25x ETH long, entry $3,210" | `--coin ETH --side long --leverage 25 --entry 3210` |
|
|
43
|
+
| "Whose 10x BTC short is open at $58,400? Current mark $57,900" | `--coin BTC --side short --leverage 10 --entry 58400 --mark 57900` |
|
|
44
|
+
| "Top 5 matches for 50x SOL long around $145" | `--coin SOL --side long --leverage 50 --entry 145 --limit 5` |
|
|
45
|
+
|
|
46
|
+
## Output schema
|
|
47
|
+
|
|
48
|
+
```jsonc
|
|
49
|
+
{
|
|
50
|
+
"match_count": 3,
|
|
51
|
+
"tolerance_used": "tight", // tight | loose | fallback | no_match
|
|
52
|
+
"query": { "coin": "ETH", "side": "long", "leverage": 25, "entry_price": 3210, "mark_price_hint": 3215 },
|
|
53
|
+
"matches": [
|
|
54
|
+
{
|
|
55
|
+
"address": "0x...",
|
|
56
|
+
"coin": "ETH", "side": "long",
|
|
57
|
+
"snapshot_ts": 1716700000, // unix seconds — how fresh the snapshot is
|
|
58
|
+
"size_token": 12.5, "size_usd": 40250,
|
|
59
|
+
"entry_price": 3209.8, "mark_price": 3215.3,
|
|
60
|
+
"leverage": 25.0,
|
|
61
|
+
"liquidation_price": 3082.1,
|
|
62
|
+
"unrealized_pnl": 68.75,
|
|
63
|
+
"entry_dist_pct": 0.0062 // |query.entry - match.entry| / query.entry × 100
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Reading the result
|
|
70
|
+
|
|
71
|
+
- **Multiple matches at the exact same entry** (e.g. five wallets long ETH at 3210.00) — popular round-number entries collide. Treat as ambiguous; surface all and let the user disambiguate by size or address. Don't claim "this is the wallet" when `match_count > 1` in the tight band.
|
|
72
|
+
- **`tolerance_used: fallback`** — the closest match is >0.5% off the queried entry. The card might be from a previous fill that's since been added to (size-weighted entry moves on add) or from a different exchange. Treat as low-confidence.
|
|
73
|
+
- **`tolerance_used: no_match`** — the position is closed, the entry was from a margin-changing event, or the wallet was outside our HL coverage. Don't suggest a wallet anyway.
|
|
74
|
+
- **`snapshot_ts`** is the snapshot time of that position row. The pipeline refreshes <5 min behind live; older `snapshot_ts` doesn't mean the position is stale, just that the wallet hasn't transacted since.
|
|
75
|
+
|
|
76
|
+
## Anti-patterns
|
|
77
|
+
|
|
78
|
+
- Don't fabricate matches when the tool returns `match_count: 0`. Say "no open position matches that share card" — closed positions, post-card adds, or non-HL cards all produce empty results.
|
|
79
|
+
- Don't strip the address when displaying — share-card investigations always want the full 0x...40hex (users copy-paste it).
|
|
80
|
+
- Don't infer trader skill from a single share-card match. Use `vike perp top-traders` or `vike wallet summary` for profile context.
|
|
81
|
+
|
|
82
|
+
## Pairs well with
|
|
83
|
+
|
|
84
|
+
- [vike-wallet-summary](../vike-wallet-summary/SKILL.md) — once you have the address, get the trader's HL profile + multi-chain identity.
|
|
85
|
+
- [vike-hl-top-traders](../vike-hl-top-traders/SKILL.md) — check if the matched wallet is on a leaderboard.
|
|
86
|
+
- [vike-wallet-label-provenance](../vike-wallet-label-provenance/SKILL.md) — find out if the wallet is a known CEX/fund/MM rather than a retail trader.
|
|
@@ -22,6 +22,7 @@ Route the user's question to the right `vike-*` skill.
|
|
|
22
22
|
| Perp funding rates / arb opportunities | `vike-perp-funding-arb` |
|
|
23
23
|
| Cross-venue perp price spreads | `vike-perp-spread-arb` |
|
|
24
24
|
| Top Hyperliquid perp traders | `vike-hl-top-traders` |
|
|
25
|
+
| Match an HL share card → wallet (reverse-lookup) | `vike-hl-position-match` |
|
|
25
26
|
| Profile a single HL perp trader | `vike-hl-trader-profile` |
|
|
26
27
|
| HL market overview (vol/OI/funding) | `vike-perp-screener` |
|
|
27
28
|
| Compare a symbol across all perp venues | `vike-cross-venue-perps` |
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// `vike install` — copy SKILL.md into the agent-discoverable locations for
|
|
2
|
+
// supported IDEs/agents so the skill loads without the user having to wire
|
|
3
|
+
// it up manually.
|
|
4
|
+
//
|
|
5
|
+
// Targets:
|
|
6
|
+
// --claude → ~/.claude/skills/vike/SKILL.md
|
|
7
|
+
// --cursor → ./.cursorrules (project root, joined under "## vike skill" header)
|
|
8
|
+
// --copilot → ./.github/copilot-instructions.md (same join pattern)
|
|
9
|
+
// --agents → ./AGENTS.md (same join pattern, project-root convention)
|
|
10
|
+
// --all → all of the above
|
|
11
|
+
//
|
|
12
|
+
// Behaviour: idempotent. For files we don't own (project-root markdown), we
|
|
13
|
+
// detect a fenced "<!-- vike-skill:begin -->...<!-- vike-skill:end -->" block
|
|
14
|
+
// and replace just that block — never clobber the rest of the user's file.
|
|
15
|
+
|
|
16
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, statSync } from 'node:fs';
|
|
17
|
+
import { homedir } from 'node:os';
|
|
18
|
+
import { join, dirname, resolve } from 'node:path';
|
|
19
|
+
import { fileURLToPath } from 'node:url';
|
|
20
|
+
|
|
21
|
+
const BEGIN = '<!-- vike-skill:begin -->';
|
|
22
|
+
const END = '<!-- vike-skill:end -->';
|
|
23
|
+
|
|
24
|
+
function readSkillSource() {
|
|
25
|
+
// SKILL.md ships at the root of the npm package, two levels up from
|
|
26
|
+
// src/commands/install.js.
|
|
27
|
+
const here = fileURLToPath(import.meta.url);
|
|
28
|
+
const candidate = resolve(dirname(here), '..', '..', 'SKILL.md');
|
|
29
|
+
if (!existsSync(candidate)) {
|
|
30
|
+
throw new Error(`SKILL.md not found at ${candidate}. Reinstall @vike-io/cli.`);
|
|
31
|
+
}
|
|
32
|
+
return readFileSync(candidate, 'utf8');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function writeStandalone(path, skill) {
|
|
36
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
37
|
+
writeFileSync(path, skill, { mode: 0o644 });
|
|
38
|
+
return { path, mode: 'replaced' };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function upsertBlock(path, skill, header) {
|
|
42
|
+
const wrapped = `${BEGIN}\n${header ? header + '\n\n' : ''}${skill}\n${END}`;
|
|
43
|
+
if (!existsSync(path)) {
|
|
44
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
45
|
+
writeFileSync(path, wrapped + '\n', { mode: 0o644 });
|
|
46
|
+
return { path, mode: 'created' };
|
|
47
|
+
}
|
|
48
|
+
const current = readFileSync(path, 'utf8');
|
|
49
|
+
if (current.includes(BEGIN) && current.includes(END)) {
|
|
50
|
+
const before = current.slice(0, current.indexOf(BEGIN));
|
|
51
|
+
const after = current.slice(current.indexOf(END) + END.length);
|
|
52
|
+
writeFileSync(path, before + wrapped + after, { mode: 0o644 });
|
|
53
|
+
return { path, mode: 'updated' };
|
|
54
|
+
}
|
|
55
|
+
const sep = current.endsWith('\n') ? '\n' : '\n\n';
|
|
56
|
+
writeFileSync(path, current + sep + wrapped + '\n', { mode: 0o644 });
|
|
57
|
+
return { path, mode: 'appended' };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function installClaude(skill) {
|
|
61
|
+
return writeStandalone(join(homedir(), '.claude', 'skills', 'vike', 'SKILL.md'), skill);
|
|
62
|
+
}
|
|
63
|
+
function installCursor(skill, cwd) {
|
|
64
|
+
return upsertBlock(join(cwd, '.cursorrules'), skill, '# vike skill — on-chain analytics for AI agents');
|
|
65
|
+
}
|
|
66
|
+
function installCopilot(skill, cwd) {
|
|
67
|
+
return upsertBlock(
|
|
68
|
+
join(cwd, '.github', 'copilot-instructions.md'),
|
|
69
|
+
skill,
|
|
70
|
+
'# vike skill — on-chain analytics for AI agents'
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function installAgents(skill, cwd) {
|
|
74
|
+
return upsertBlock(join(cwd, 'AGENTS.md'), skill, '# vike skill — on-chain analytics for AI agents');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function registerInstall(program) {
|
|
78
|
+
program
|
|
79
|
+
.command('install')
|
|
80
|
+
.description('Copy vike SKILL.md into agent-discoverable locations (Claude, Cursor, Copilot, AGENTS.md)')
|
|
81
|
+
.option('--claude', 'Install to ~/.claude/skills/vike/SKILL.md')
|
|
82
|
+
.option('--cursor', 'Append/update vike block in ./.cursorrules')
|
|
83
|
+
.option('--copilot', 'Append/update vike block in ./.github/copilot-instructions.md')
|
|
84
|
+
.option('--agents', 'Append/update vike block in ./AGENTS.md')
|
|
85
|
+
.option('--all', 'Install to every supported target')
|
|
86
|
+
.option('--cwd <dir>', 'Project root (defaults to current directory)')
|
|
87
|
+
.action((opts) => {
|
|
88
|
+
const cwd = opts.cwd ? resolve(opts.cwd) : process.cwd();
|
|
89
|
+
const targets = opts.all
|
|
90
|
+
? { claude: true, cursor: true, copilot: true, agents: true }
|
|
91
|
+
: opts;
|
|
92
|
+
if (!targets.claude && !targets.cursor && !targets.copilot && !targets.agents) {
|
|
93
|
+
console.error('No target selected. Use --claude / --cursor / --copilot / --agents / --all.');
|
|
94
|
+
console.error('Examples:');
|
|
95
|
+
console.error(' vike install --claude');
|
|
96
|
+
console.error(' vike install --all');
|
|
97
|
+
process.exitCode = 1;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
let skill;
|
|
101
|
+
try {
|
|
102
|
+
skill = readSkillSource();
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.error(`vike install: ${e.message}`);
|
|
105
|
+
process.exitCode = 1;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const results = [];
|
|
109
|
+
try {
|
|
110
|
+
if (targets.claude) results.push(installClaude(skill));
|
|
111
|
+
if (targets.cursor) results.push(installCursor(skill, cwd));
|
|
112
|
+
if (targets.copilot) results.push(installCopilot(skill, cwd));
|
|
113
|
+
if (targets.agents) results.push(installAgents(skill, cwd));
|
|
114
|
+
} catch (e) {
|
|
115
|
+
console.error(`vike install: ${e.message}`);
|
|
116
|
+
process.exitCode = 1;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
for (const r of results) {
|
|
120
|
+
const size = (() => { try { return statSync(r.path).size; } catch { return 0; } })();
|
|
121
|
+
console.log(`${r.mode.padEnd(8)} ${r.path} (${size} bytes)`);
|
|
122
|
+
}
|
|
123
|
+
console.log(`\nInstalled ${results.length} target(s). Restart your AI client to pick up the skill.`);
|
|
124
|
+
});
|
|
125
|
+
}
|
package/src/commands/perp.js
CHANGED
|
@@ -31,6 +31,30 @@ export function registerPerp(program) {
|
|
|
31
31
|
} catch (err) { emitError(err, opts); }
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
+
cmd
|
|
35
|
+
.command('find-position')
|
|
36
|
+
.description('Reverse-lookup HL open positions matching a share-card (coin/side/lev/entry)')
|
|
37
|
+
.requiredOption('--coin <s>', 'Asset symbol (e.g. BTC, ETH)')
|
|
38
|
+
.requiredOption('--side <s>', 'long | short')
|
|
39
|
+
.requiredOption('--leverage <x>', 'Leverage from the share card (e.g. 25)')
|
|
40
|
+
.requiredOption('--entry <p>', 'Entry price from the share card')
|
|
41
|
+
.option('--mark <p>', 'Optional current mark price (sharpens tie-break)')
|
|
42
|
+
.option('--limit <n>', 'Max matches (default 10, max 50)', '10')
|
|
43
|
+
.option('--json', 'Emit JSON')
|
|
44
|
+
.action(async (opts) => {
|
|
45
|
+
try {
|
|
46
|
+
const r = await callTool('hl_position_match', {
|
|
47
|
+
coin: opts.coin,
|
|
48
|
+
side: opts.side,
|
|
49
|
+
leverage: Number(opts.leverage),
|
|
50
|
+
entry_price: Number(opts.entry),
|
|
51
|
+
mark_price: opts.mark != null ? Number(opts.mark) : undefined,
|
|
52
|
+
limit: parseInt10(opts.limit, 10),
|
|
53
|
+
});
|
|
54
|
+
emit(r, opts);
|
|
55
|
+
} catch (err) { emitError(err, opts); }
|
|
56
|
+
});
|
|
57
|
+
|
|
34
58
|
cmd
|
|
35
59
|
.command('top-traders')
|
|
36
60
|
.description('Top Hyperliquid perp wallets by PnL / ROI / win rate / volume')
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { registerWeb } from './commands/web.js';
|
|
|
12
12
|
// commands. New wallet subcommands (counterparties, pnl-history, balances,
|
|
13
13
|
// ens) are added under registerWallet.
|
|
14
14
|
import { registerInit } from './commands/init.js';
|
|
15
|
+
import { registerInstall } from './commands/install.js';
|
|
15
16
|
import { registerDoctor } from './commands/doctor.js';
|
|
16
17
|
import { registerSchema } from './commands/schema.js';
|
|
17
18
|
import { registerLogin, registerLogout } from './commands/auth.js';
|
|
@@ -55,6 +56,7 @@ program.hook('postAction', (_thisCmd, actionCmd) => {
|
|
|
55
56
|
registerLogin(program);
|
|
56
57
|
registerLogout(program);
|
|
57
58
|
registerInit(program);
|
|
59
|
+
registerInstall(program);
|
|
58
60
|
registerDoctor(program);
|
|
59
61
|
registerSchema(program);
|
|
60
62
|
registerToken(program);
|