@vike-io/cli 0.8.1 → 0.9.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 CHANGED
@@ -2,6 +2,12 @@
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.9.0 — `vike ohlcv` (CEX historical candles)
6
+
7
+ - **`vike ohlcv <symbol>`** (new command, wraps the new `ohlcv` MCP tool). Historical CEX candles for a canonical ticker (`BTC`) or exchange pair (`BTCUSDT`) across any timeframe (1m–1w), spot or perp. Flags: `--interval`, `--exchange` (binance/bybit/okx/gate/kucoin/coinbase/mexc/pyth, or omit for the merged best-source series), `--market`, `--start`/`--end`, `--limit` (max 5000), and `--cursor` paging. Look-ahead-safe — the in-progress bucket is excluded. Distinct from `vike token chart`, which serves DEX candles by **contract address** at 5/30/120-min only.
8
+ - **First live e2e test** (`tests/ohlcv.e2e.test.js`) hitting `vike.io/mcp`; `vitest.e2e.config.js` now auto-loads a gitignored `.env` for `VIKE_API_KEY` (real env vars still win). Coverage + `--help` tests updated.
9
+ - New skill playbook `vike-ohlcv` (registered in `skills.sh.json`); routing/command maps updated across root `SKILL.md`, `vike-router`, `README`, and `AGENTS`. Eval questions added for historical-data fetch + an `ohlcv`-vs-`token chart` trap. Total: 41 skills (was 40), 36 MCP tools (was 35).
10
+
5
11
  ## 0.8.0 — HL share-card reverse-lookup + multi-IDE installer + SKILL.md hardening
6
12
 
7
13
  - **`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.
@@ -43,22 +49,26 @@ Total: 38 skills (was 33), 34 MCP tools (was 29).
43
49
  Mostly internal-quality improvements; no new commands. Backbone for everything that follows.
44
50
 
45
51
  **New infra**
52
+
46
53
  - **Background update-check** — silent detached subprocess polls the registry once/day; next-run prints `Update available: X.Y.Z → A.B.C`. Honors `NO_UPDATE_NOTIFIER` / `CI` / `VIKE_NO_UPDATE_CHECK`.
47
54
  - **First-run-after-upgrade notice** — one-time `Updated to X.Y.Z` print.
48
55
  - **Telemetry skeleton** — anonymous UUID + 30-min session ID, fire-and-forget. NO sink endpoint wired yet (events drop silently); shape is stable so we can flip it on without refactoring. Opt-out via `DO_NOT_TRACK=1` or `VIKE_NO_TELEMETRY=1`.
49
56
  - **Centralized chain registry** (`src/chains.js`) — `ALL_CHAINS`, `EVM_CHAINS`, `WALLET_CHAINS`, `CHAIN_ALIASES`, `normaliseChain()`, `isEvmAddress()`.
50
57
 
51
58
  **Testing + release safety**
59
+
52
60
  - Two-tier vitest config — `npm test` (unit/integration, <30s) vs `npm run test:e2e` (live MCP, up to 2 min).
53
61
  - Four meta-tests added: shebang, pack-and-install (catches missing `files`), CLI help for every command, command coverage regression.
54
62
  - Pretest changeset validator — hard-fails on wrong package name in changeset frontmatter; warns on missing changeset.
55
63
  - Postinstall script hardened — global-install + TTY gates, always `exit 0`.
56
64
 
57
65
  **Skill quality evals (preview)**
66
+
58
67
  - `evals/` directory with a `uv run`-script harness: A/B-tests every question against `vike --help` only vs `vike --help + SKILL.md`. Scores per question; aggregates a Δ for each skill. If a skill doesn't move the score, it shouldn't ship. Run: `uv run --script evals/runner.py` (needs `ANTHROPIC_API_KEY`).
59
68
  - 14 starter questions in `evals/questions.yaml`.
60
69
 
61
70
  **Security**
71
+
62
72
  - `SECURITY.md` published (report at security@vike.io; 48h ack, 7d critical-fix SLA).
63
73
  - `CODEOWNERS` file (single-maintainer for now; security-sensitive paths called out).
64
74
  - Dependabot weekly PRs for npm + GitHub Actions deps.
package/README.md CHANGED
@@ -41,6 +41,7 @@ Get an API key at [vike.io/account?tab=api-keys](https://vike.io/account?tab=api
41
41
 
42
42
  ```
43
43
  vike token search | transfers | chart
44
+ vike ohlcv <symbol> # CEX candles, any timeframe (BTC, BTCUSDT)
44
45
  vike wallet summary | discover
45
46
  vike perp funding | spreads | top-traders
46
47
  vike options flow
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.8.1",
6
+ "version": "0.9.0",
7
7
  "description": "AI-agent CLI for vike.io on-chain analytics, perps, options, and prediction markets across 11 chains",
8
8
  "type": "module",
9
9
  "main": "src/index.js",
@@ -66,7 +66,8 @@ X-API-KEY: vk_...
66
66
  |---|---|---|
67
67
  | Token by symbol/name → address, market cap, holders | **Tokens** | `vike token search` / `token_search` |
68
68
  | Token holders, who bought/sold, top inflows | **Tokens** | `vike token transfers` / `token_transfers` |
69
- | Token chart / OHLCV / historical price | **Tokens** | `vike token chart` / `token_chart` |
69
+ | Token chart / DEX OHLCV by contract address | **Tokens** | `vike token chart` / `token_chart` |
70
+ | CEX candles by ticker/pair, any timeframe (1m–1w), spot or perp | **Tokens** | `vike ohlcv <symbol>` / `ohlcv` |
70
71
  | Filter/screen tokens by smart-money flow, liquidity, age | **Tokens** | `vike token screener` / `token_screener` |
71
72
  | Single wallet's PnL, holdings, recent activity | **Wallets** | `vike wallet summary` / `wallet_summary` |
72
73
  | Top wallets by PnL on a token / leaderboard | **Wallets** | `vike wallet discover` / `wallet_discover` |
@@ -155,7 +156,8 @@ Address resolution, transfers, OHLCV, holder cohorts, screening.
155
156
  |---|---|---|
156
157
  | `token_search` | Symbol/name → contract address + chain + market cap | [vike-token-search](skills/vike-token-search/SKILL.md) |
157
158
  | `token_transfers` | Recent transfers with USD values; supports `--min-usd`, time windows | [vike-token-transfers](skills/vike-token-transfers/SKILL.md) |
158
- | `token_chart` | OHLCV from data_history (binance/bybit/okx/gate aggregate) | [vike-token-research](skills/vike-token-research/SKILL.md) |
159
+ | `token_chart` | DEX OHLCV by contract address (5/30/120-min, data_history aggregate) | [vike-token-research](skills/vike-token-research/SKILL.md) |
160
+ | `ohlcv` | CEX candles by ticker (BTC) or pair (BTCUSDT), 1m–1w, spot/perp, paged | [vike-ohlcv](skills/vike-ohlcv/SKILL.md) |
159
161
  | `token_holders` | Top holders + concentration metrics | [vike-token-holders](skills/vike-token-holders/SKILL.md) |
160
162
  | `token_screener` | Filter tokens by smart-money inflow, age, liquidity, sector | [vike-token-screener](skills/vike-token-screener/SKILL.md) |
161
163
 
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: vike-ohlcv
3
+ description: Historical CEX candles for a canonical ticker (BTC) or exchange pair (BTCUSDT) at any timeframe (1m–1w), spot or perp. Use when the user asks "BTC hourly candles" / "ETH 4h chart on Binance" / "give me daily OHLCV for SOL" / needs look-ahead-safe candle data for a backtest.
4
+ allowed-tools: Bash(vike:*)
5
+ ---
6
+
7
+ # vike-ohlcv
8
+
9
+ CEX OHLCV candles by ticker or pair. Distinct from `vike token chart`, which serves DEX candles by **contract address** at only 5/30/120-min resolution.
10
+
11
+ ## Command
12
+
13
+ ```bash
14
+ vike ohlcv <symbol> [--interval 1m|3m|5m|15m|30m|1h|2h|4h|6h|8h|12h|1d|1w] \
15
+ [--exchange binance|bybit|okx|gate|kucoin|coinbase|mexc|pyth] \
16
+ [--market spot|perp] [--start <ts>] [--end <ts>] \
17
+ [--limit N] [--cursor <c>] [--json]
18
+ ```
19
+
20
+ - `<symbol>` — canonical ticker (`BTC`, `ETH`) or an exchange pair (`BTCUSDT`, `BTCUSDT_PERP`).
21
+ - `--exchange` — **omit for the merged best-source series** (best venue per minute, gaps backfilled). Pin a venue only for that venue's raw series.
22
+ - `--interval` defaults to `1h`. `--market` defaults to `spot`.
23
+ - `--start` / `--end` — ISO-8601 UTC (`2026-01-01`) or epoch ms. Buckets are left-aligned UTC.
24
+ - `--limit` defaults to 500, hard max 5000.
25
+
26
+ ## Examples
27
+
28
+ ```bash
29
+ # Last 500 hourly candles, merged best-source:
30
+ vike ohlcv BTC --json
31
+
32
+ # 4h Binance perp candles for ETH:
33
+ vike ohlcv ETH --interval 4h --market perp --exchange binance --json
34
+
35
+ # Daily candles over an explicit range:
36
+ vike ohlcv SOL --interval 1d --start 2026-01-01 --end 2026-03-01 --json
37
+
38
+ # Page forward with the cursor from a previous call:
39
+ vike ohlcv BTC --interval 1m --limit 5000 --cursor <next_cursor> --json
40
+ ```
41
+
42
+ ## Output
43
+
44
+ `{ symbol, pair, exchange, interval, market, tz, candles[], next_cursor }`
45
+
46
+ Each candle: `{ ts (epoch ms, UTC), open, high, low, close, volume }`, ascending by `ts`.
47
+
48
+ ## Reading
49
+
50
+ - **Look-ahead-safe**: the in-progress (partial) bucket is excluded, so the last candle is always closed — safe to feed into a backtest.
51
+ - `exchange: "merged"` means no `--exchange` was pinned; each minute is sourced from the best available venue with gaps backfilled.
52
+ - `pair` echoes how the symbol resolved — `BTCUSDT` for spot, `BTCUSDT_PERP` for perp.
53
+ - Use `next_cursor` to page; pass it back via `--cursor`. A null/absent cursor means the series is exhausted.
54
+
55
+ ## Anti-patterns
56
+
57
+ - Don't use this for an on-chain/DEX-only token with no CEX listing — use `vike token chart <contract_address>` instead.
58
+ - Don't omit `--market perp` when the user clearly means a perpetual; spot and perp candles differ.
59
+ - Don't request 1m candles over a multi-month range in one call — page with `--cursor` (hard max 5000 candles/call).
60
+
61
+ ## Pairs well with
62
+
63
+ - `vike token chart <addr>` — DEX candles when there's no CEX pair
64
+ - `vike perp funding` / `vike perp spreads` — pair candle context with funding/spread arb
65
+ - `vike options flow` — overlay options positioning on the underlying's candles
@@ -14,7 +14,8 @@ Route the user's question to the right `vike-*` skill.
14
14
  |---|---|
15
15
  | Token by symbol/name → address | `vike-token-search` |
16
16
  | Token holders / who bought / sold | `vike-token-transfers` |
17
- | Token price chart / OHLCV | `vike-token-research` |
17
+ | Token price chart / DEX OHLCV by contract address | `vike-token-research` |
18
+ | CEX candles by ticker/pair, any timeframe (BTC, BTCUSDT) | `vike-ohlcv` |
18
19
  | Generic token research (everything) | `vike-token-research` |
19
20
  | Single wallet's metrics | `vike-wallet-summary` |
20
21
  | Top wallets / leaderboard | `vike-wallet-discover` |
@@ -34,6 +35,7 @@ Route the user's question to the right `vike-*` skill.
34
35
 
35
36
  ```
36
37
  vike token search | transfers | chart
38
+ vike ohlcv <symbol> # CEX candles, any timeframe (BTC, BTCUSDT)
37
39
  vike wallet summary | discover
38
40
  vike perp funding | spreads | top-traders
39
41
  vike options flow
package/skills.sh.json CHANGED
@@ -17,6 +17,7 @@
17
17
  "skills": [
18
18
  "vike-token-search",
19
19
  "vike-token-research",
20
+ "vike-ohlcv",
20
21
  "vike-token-transfers",
21
22
  "vike-token-holders",
22
23
  "vike-token-screener",
@@ -0,0 +1,33 @@
1
+ import { callTool } from '../mcp-client.js';
2
+ import { emit, emitError } from '../format.js';
3
+ import { parseInt10 } from '../util.js';
4
+
5
+ export function registerOhlcv(program) {
6
+ program
7
+ .command('ohlcv <symbol>')
8
+ .description('Historical CEX candles for a ticker (BTC) or pair (BTCUSDT) across any timeframe')
9
+ .option('--interval <i>', '1m | 3m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 8h | 12h | 1d | 1w', '1h')
10
+ .option('--exchange <e>', 'Pin one venue: binance | bybit | okx | gate | kucoin | coinbase | mexc | pyth. Omit for merged best-source.')
11
+ .option('--market <m>', 'spot | perp', 'spot')
12
+ .option('--start <t>', 'ISO-8601 UTC or epoch ms (inclusive)')
13
+ .option('--end <t>', 'ISO-8601 UTC or epoch ms (exclusive)')
14
+ .option('--limit <n>', 'Max candles (default 500, max 5000)', '500')
15
+ .option('--cursor <c>', 'Opaque paging cursor from a previous call')
16
+ .option('--json', 'Emit JSON')
17
+ .action(async (symbol, opts) => {
18
+ try {
19
+ const args = {
20
+ symbol,
21
+ interval: opts.interval,
22
+ market: opts.market,
23
+ limit: parseInt10(opts.limit, 500),
24
+ };
25
+ if (opts.exchange !== undefined) args.exchange = opts.exchange;
26
+ if (opts.start !== undefined) args.start = opts.start;
27
+ if (opts.end !== undefined) args.end = opts.end;
28
+ if (opts.cursor !== undefined) args.cursor = opts.cursor;
29
+ const r = await callTool('ohlcv', args);
30
+ emit(r, opts);
31
+ } catch (err) { emitError(err, opts); }
32
+ });
33
+ }
package/src/index.js CHANGED
@@ -8,6 +8,7 @@ import { registerAlerts } from './commands/alerts.js';
8
8
  import { registerPolymarket } from './commands/polymarket.js';
9
9
  import { registerLabels } from './commands/labels.js';
10
10
  import { registerWeb } from './commands/web.js';
11
+ import { registerOhlcv } from './commands/ohlcv.js';
11
12
  // Note: registerLabels also registers `vike funds` and `vike defi` top-level
12
13
  // commands. New wallet subcommands (counterparties, pnl-history, balances,
13
14
  // ens) are added under registerWallet.
@@ -67,6 +68,7 @@ registerAlerts(program);
67
68
  registerPolymarket(program);
68
69
  registerLabels(program);
69
70
  registerWeb(program);
71
+ registerOhlcv(program);
70
72
 
71
73
  const _parseT0 = Date.now();
72
74
  program.parseAsync(process.argv)