@vike-io/cli 0.8.0 → 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
@@ -5,13 +5,26 @@
5
5
  [![npm version](https://img.shields.io/npm/v/@vike-io/cli.svg)](https://www.npmjs.com/package/@vike-io/cli)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Node](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
8
+ [![skills.sh](https://skills.sh/b/vike-io/vike-cli)](https://skills.sh/vike-io/vike-cli)
8
9
 
9
10
  > **Command-line interface for the [vike.io](https://vike.io) API.** On-chain analytics, perpetuals, options flow, and prediction-market data across 11 chains — designed to be driven by AI agents (Claude Code, OpenClaw) as well as humans.
10
11
 
11
12
  ## Install
12
13
 
13
14
  ```bash
15
+ # Standard install — gives you the `vike` binary
14
16
  npm install -g @vike-io/cli
17
+
18
+ # OR install just the skill playbooks into your AI agent (Claude Code, Cursor,
19
+ # Codex, Copilot, OpenCode and 50+ more — auto-detected):
20
+ npx skills add vike-io/vike-cli
21
+ ```
22
+
23
+ After `npm install`, you can also drop the skill into AI agents from the CLI itself:
24
+
25
+ ```bash
26
+ vike install --all # writes to ~/.claude/skills/vike/, .cursorrules,
27
+ # .github/copilot-instructions.md, AGENTS.md
15
28
  ```
16
29
 
17
30
  ## Quick start
@@ -22,12 +35,13 @@ vike doctor # confirm everything works
22
35
  vike token search BTC # your first query
23
36
  ```
24
37
 
25
- Get an API key at [vike.io/api/keys](https://vike.io/api/keys).
38
+ Get an API key at [vike.io/account?tab=api-keys](https://vike.io/account?tab=api-keys).
26
39
 
27
40
  ## Commands at a glance
28
41
 
29
42
  ```
30
43
  vike token search | transfers | chart
44
+ vike ohlcv <symbol> # CEX candles, any timeframe (BTC, BTCUSDT)
31
45
  vike wallet summary | discover
32
46
  vike perp funding | spreads | top-traders
33
47
  vike options flow
@@ -50,15 +64,24 @@ Run `vike schema --pretty` for the full command + flag reference.
50
64
 
51
65
  ## For AI agents
52
66
 
53
- This package ships **skill playbooks** under [`skills/`](skills/) — markdown files designed to be loaded by AI coding agents (Claude Code, OpenClaw, Cursor) so they know when and how to invoke each command.
67
+ This package ships **41 skill playbooks** under [`skills/`](skills/) — markdown files designed to be loaded by AI coding agents (Claude Code, Cursor, Codex, Copilot, OpenCode, …) so they know when and how to invoke each command. They are grouped in [`skills.sh.json`](skills.sh.json) by domain (Tokens / Wallets / CEX perps / Hyperliquid / Options / Polymarket / Alerts / Web research).
54
68
 
55
- Skill entry points:
56
- - `vike-core` — install + auth + conventions (read first)
57
- - `vike-router` — decide which skill applies
58
- - `vike-token-research`, `vike-smart-money-discovery`, `vike-perp-funding-arb`, `vike-perp-screener`, `vike-hl-top-traders`, `vike-hl-trader-profile`, `vike-cross-venue-perps`, `vike-options-flow`, `vike-alerts-setup` — task playbooks
59
- - Per-tool skills for each command
69
+ Three install paths, pick whichever fits your stack:
70
+
71
+ ```bash
72
+ # 1. Install just the skill files for your agent (no Node binary needed):
73
+ npx skills add vike-io/vike-cli # auto-detects the agent
74
+ npx skills add vike-io/vike-cli -a claude-code # explicit target
75
+ npx skills add vike-io/vike-cli --list # list all 41 first
76
+
77
+ # 2. Use the CLI itself to install the umbrella skill into multiple agents:
78
+ vike install --claude --cursor --copilot --agents
79
+
80
+ # 3. Manual: point your agent at the skills/ folder of this npm package
81
+ # (lives at node_modules/@vike-io/cli/skills/ after install).
82
+ ```
60
83
 
61
- In Claude Code, the bundled skills are auto-discovered after `npm install -g @vike-io/cli`. In other harnesses, point the agent at the `skills/` folder of this package.
84
+ Entry-point skill: `vike` (the umbrella) — auto-routes the user's question to the right specialized skill below. Bypass it and pick a specialized one if you know exactly which you need (e.g. `vike-hl-position-match` for reverse-lookup of an HL share card).
62
85
 
63
86
  ## Auth
64
87
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.8.0",
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",
@@ -14,7 +14,7 @@
14
14
  "src/**/*.js",
15
15
  "scripts/postinstall.js",
16
16
  "skills/**",
17
- "SKILL.md",
17
+ "skills.sh.json",
18
18
  "CHANGELOG.md"
19
19
  ],
20
20
  "scripts": {
@@ -47,7 +47,7 @@ If the user has no API key yet, tell them:
47
47
 
48
48
  > **To use vike, you'll need a free API key:**
49
49
  >
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_`).
50
+ > 1. Visit https://vike.io/account?tab=api-keys&utm_source=skill&utm_medium=ai&utm_campaign=cli_skill, sign in, and copy a key (starts with `vk_`).
51
51
  > 2. Save it: `vike login --api-key vk_...` (or `export VIKE_API_KEY=vk_...`).
52
52
  > 3. Verify: `vike doctor`.
53
53
  >
@@ -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
 
@@ -32,7 +32,7 @@ vike login --api-key vk_... # non-interactive
32
32
  export VIKE_API_KEY=vk_... # env (wins over saved config)
33
33
  ```
34
34
 
35
- Get an API key at https://vike.io/api/keys
35
+ Get an API key at https://vike.io/account?tab=api-keys
36
36
 
37
37
  ## Verify
38
38
 
@@ -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
@@ -68,6 +68,16 @@ Tool credits = 4 per call (heavier than other graph-less tools). Graph explodes
68
68
  - Don't depth-5 by default. Graph blows up; results become noise.
69
69
  - Don't ignore `min_usd` — without it, dust transfers create false-positive edges.
70
70
 
71
+ ## Visual graph (web UI)
72
+
73
+ When the user wants to *see* the network rather than read JSON, surface the URL:
74
+
75
+ ```
76
+ https://vike.io/spot/wallet/<address>
77
+ ```
78
+
79
+ Tell them to click the **Graph** tab. It renders the same trace data as a force-directed graph (nodes coloured by hop depth, sized by USD volume, animated directional particles on edges). Clicking any non-root node navigates to that wallet's graph. Use this in chat replies when the user says "show me", "visualize", or pastes a wallet address asking for an exploration view — JSON is for downstream pipelines, the URL is for humans.
80
+
71
81
  ## Pairs well with
72
82
 
73
83
  - `vike labels <addr>` — identify any interesting node
package/skills.sh.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "https://skills.sh/schemas/skills.sh.schema.json",
3
+ "notGrouped": "bottom",
4
+ "groupings": [
5
+ {
6
+ "title": "Quick start",
7
+ "description": "Start here. The umbrella skill auto-routes user questions to the right specialized skill below.",
8
+ "skills": [
9
+ "vike",
10
+ "vike-router",
11
+ "vike-core"
12
+ ]
13
+ },
14
+ {
15
+ "title": "Tokens",
16
+ "description": "Resolve, screen, and research tokens across 11 chains. Smart-money inflow, holders, recent transfers, OHLCV.",
17
+ "skills": [
18
+ "vike-token-search",
19
+ "vike-token-research",
20
+ "vike-ohlcv",
21
+ "vike-token-transfers",
22
+ "vike-token-holders",
23
+ "vike-token-screener",
24
+ "vike-smart-money-discovery"
25
+ ]
26
+ },
27
+ {
28
+ "title": "Wallets",
29
+ "description": "Per-wallet profile, PnL, counterparty graphs, ENS, batch labelling, fund affiliation, DeFi positions.",
30
+ "skills": [
31
+ "vike-wallet-summary",
32
+ "vike-wallet-portfolio",
33
+ "vike-wallet-discover",
34
+ "vike-wallet-transactions",
35
+ "vike-wallet-counterparties",
36
+ "vike-wallet-trace",
37
+ "vike-wallet-compare",
38
+ "vike-wallet-batch",
39
+ "vike-wallet-pnl-history",
40
+ "vike-wallet-balances",
41
+ "vike-wallet-ens",
42
+ "vike-wallet-label-provenance",
43
+ "vike-fund-holdings",
44
+ "vike-defi-positions"
45
+ ]
46
+ },
47
+ {
48
+ "title": "CEX perps",
49
+ "description": "Funding-rate arb + cross-venue mark-price spreads across Binance, Bybit, OKX, Aster, Hyperliquid.",
50
+ "skills": [
51
+ "vike-perp-funding-arb",
52
+ "vike-perp-spread-arb",
53
+ "vike-perp-screener",
54
+ "vike-cross-venue-perps"
55
+ ]
56
+ },
57
+ {
58
+ "title": "Hyperliquid perps",
59
+ "description": "Deep on-chain HL coverage: top traders, full trader profiles, and share-card reverse-lookup.",
60
+ "skills": [
61
+ "vike-hl-top-traders",
62
+ "vike-hl-trader-profile",
63
+ "vike-hl-position-match"
64
+ ]
65
+ },
66
+ {
67
+ "title": "Options",
68
+ "description": "Deribit BTC/ETH options flow + put-call ratios.",
69
+ "skills": [
70
+ "vike-options-flow"
71
+ ]
72
+ },
73
+ {
74
+ "title": "Polymarket",
75
+ "description": "Prediction-market discovery, single-market deep-dives, trader profiles, and smart-money leaderboards.",
76
+ "skills": [
77
+ "vike-polymarket-markets",
78
+ "vike-polymarket-market-detail",
79
+ "vike-polymarket-trader",
80
+ "vike-polymarket-smart-money",
81
+ "vike-polymarket-screener"
82
+ ]
83
+ },
84
+ {
85
+ "title": "Alerts",
86
+ "description": "Create, list, edit, delete price + flow alerts; register HTTPS webhooks with HMAC delivery.",
87
+ "skills": [
88
+ "vike-alerts-setup",
89
+ "vike-alerts-webhook"
90
+ ]
91
+ },
92
+ {
93
+ "title": "Web research",
94
+ "description": "Off-chain context: general web search and AI-summarized URL fetch for news, docs, and social.",
95
+ "skills": [
96
+ "vike-web-search",
97
+ "vike-web-fetch",
98
+ "vike-web-research"
99
+ ]
100
+ }
101
+ ]
102
+ }
package/src/auth.js CHANGED
@@ -48,7 +48,7 @@ export function requireApiKey() {
48
48
  if (!key) {
49
49
  throw new Error(
50
50
  'No API key. Run `vike login --api-key <key>` or set VIKE_API_KEY. ' +
51
- 'Get a key at https://vike.io/api/keys',
51
+ 'Get a key at https://vike.io/account?tab=api-keys',
52
52
  );
53
53
  }
54
54
  return key;
@@ -8,7 +8,7 @@ export function registerLogin(program) {
8
8
  .option('--api-key <key>', 'API key (vk_...)')
9
9
  .action(async (opts) => {
10
10
  if (!opts.apiKey) {
11
- console.error('Pass --api-key <vk_...>. Get a key at https://vike.io/api/keys');
11
+ console.error('Pass --api-key <vk_...>. Get a key at https://vike.io/account?tab=api-keys');
12
12
  process.exitCode = 1;
13
13
  return;
14
14
  }
@@ -15,7 +15,7 @@ export function registerInit(program) {
15
15
  if (!key) {
16
16
  const rl = createInterface({ input: stdin, output: stdout });
17
17
  try {
18
- console.log('Get your API key at https://vike.io/api/keys');
18
+ console.log('Get your API key at https://vike.io/account?tab=api-keys');
19
19
  key = (await rl.question('Paste your API key (vk_...): ')).trim();
20
20
  } finally {
21
21
  rl.close();
@@ -22,14 +22,17 @@ const BEGIN = '<!-- vike-skill:begin -->';
22
22
  const END = '<!-- vike-skill:end -->';
23
23
 
24
24
  function readSkillSource() {
25
- // SKILL.md ships at the root of the npm package, two levels up from
26
- // src/commands/install.js.
25
+ // Umbrella SKILL.md lives at skills/vike/SKILL.md (moved from the repo
26
+ // root so the skills-CLI auto-discovers all 40 nested skills instead of
27
+ // stopping at the root one). Fallback to the old root path keeps older
28
+ // installs working until they upgrade.
27
29
  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.`);
30
+ const root = resolve(dirname(here), '..', '..');
31
+ for (const rel of ['skills/vike/SKILL.md', 'SKILL.md']) {
32
+ const candidate = resolve(root, rel);
33
+ if (existsSync(candidate)) return readFileSync(candidate, 'utf8');
31
34
  }
32
- return readFileSync(candidate, 'utf8');
35
+ throw new Error(`SKILL.md not found under ${root}. Reinstall @vike-io/cli.`);
33
36
  }
34
37
 
35
38
  function writeStandalone(path, skill) {
@@ -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)