Package Exports
- @openfinclaw/cli
- @openfinclaw/cli/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@openfinclaw/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@openfinclaw/cli
One-stop quant-trading AI agent for any coding assistant — MCP server + CLI
Market data · analysis · deep reports · strategy generation · backtest · paper trading — all via DeepAgent, across 20+ AI agent platforms.
Try DeepAgent online · Get an API Key · Quick Start · Supported Platforms · GitHub
🧪 Try DeepAgent in your browser first → https://hub.openfinclaw.ai/en/chat — no install required.
What is it?
OpenFinClaw plugs a one-stop quant-trading agent into any MCP-compatible coding assistant. Its core is DeepAgent: a remote multi-agent service that fetches market data, analyses it, writes deep reports, generates strategies, backtests them and proposes paper-trade plans — from a single natural-language prompt. Reach it from Claude Code, Claude Desktop, Cursor, VS Code Copilot, Hermes, and 20+ other platforms. Also runs as a standalone terminal CLI.
Tool groups
| Group | Tools | Tokens | Purpose |
|---|---|---|---|
deepagent |
fin_deepagent_* (14 tools) |
~1,400 | One-stop quant agent — research · analysis · reports · strategy gen · backtest · paper trade |
strategy |
skill_publish · skill_validate · skill_fork · skill_leaderboard · skill_get_info · skill_list_local · skill_publish_verify |
~1,000 | Advanced local FEP v2.0 workflow: publish / fork / validate strategy packages, query Hub leaderboards |
Load only what you need with --tools=deepagent,strategy (either subset).
Quick Start
💡 Not ready to install? Try DeepAgent online and decide after.
1. Interactive setup (recommended)
npx @openfinclaw/cli initThe wizard will:
- Ask for your DeepAgent API Key (required for the
deepagentgroup) - Optionally ask for a Hub API Key (
fch_..., only if you enable thestrategygroup) - Let you pick tool groups
- Auto-detect installed platforms (by app bundles, user data dirs, CLI on
PATH, or existing MCP config) - Write MCP config to each selected platform
- Save keys to
~/.openfinclaw/config.json(chmod 600 on Unix) so the terminal CLI works withoutexport
init also supports scripted, non-interactive use (useful on Windows / CI where raw-mode prompts don't work):
npx @openfinclaw/cli init --yes \
--platforms cursor,claude-code \
--tool-groups deepagent,strategy \
--api-key fch_xxx2. Manual MCP configuration
Drop this into your agent platform's MCP config file (path varies per platform — see below):
{
"mcpServers": {
"openfinclaw": {
"command": "npx",
"args": ["@openfinclaw/cli", "serve"],
"env": {
"OPENFINCLAW_API_KEY": "fch_..."
}
}
}
}单把 fch_ 即可同时驱动 strategy 和 deepagent 两个工具组——deepagent 经 Hub Gateway 鉴权,strategy 直接打 commons-hub。
3. Terminal CLI
For repeated terminal use, install globally so you can call openfinclaw directly instead of prefixing every command with npx:
npm install -g @openfinclaw/cli # or: pnpm add -g @openfinclaw/cli
openfinclaw doctor # confirms the install + keysNot installing globally? Every example below also works prefixed with
npx -y @openfinclaw/cli(slower first run).
# DeepAgent — real token-by-token streaming in the terminal, covers the whole quant flow
openfinclaw deepagent research "Research NVDA last 90 days, propose a momentum strategy, backtest 1y, paper-trade plan"
openfinclaw deepagent skills
openfinclaw deepagent backtests
openfinclaw deepagent packages
openfinclaw deepagent download <package_id>
# Strategy management (Hub key required)
openfinclaw leaderboard --limit 10
openfinclaw strategy-info <uuid>
openfinclaw fork <uuid>
openfinclaw validate ./my-strategy
openfinclaw publish ./my-strategy.zip
# Diagnostics (works with any subset of keys)
openfinclaw doctorOne unified
fch_key. Both DeepAgent and Hub strategy commands shareOPENFINCLAW_API_KEY. DeepAgent traffic is routed through the Hub Gateway which enforces fch_ key auth + multi-tenant isolation.doctorstill renders diagnostics if the key is absent.
Supported Platforms
| Category | Platforms |
|---|---|
| Chat | Claude Desktop, ChatGPT, Chatbox, LM Studio |
| IDEs | Claude Code, VS Code (Copilot), Cursor, Windsurf, JetBrains Junie, Zed, Cline, Continue.dev, Roo Code |
| CLI Agents | Codex (OpenAI), OpenCode, Amazon Q CLI |
| Frameworks | Hermes Agent, BeeAI, Swarms |
| AI Agents | OpenClaw, NanoClaw |
| Other | v0 (Vercel), Postman, Amp (Sourcegraph) |
Platform config snippets
Claude Code — ~/.claude/settings.json
{
"mcpServers": {
"openfinclaw": {
"command": "npx",
"args": ["@openfinclaw/cli", "serve"],
"env": {
"OPENFINCLAW_API_KEY": "fch_..."
}
}
}
}Cursor — .cursor/mcp.json
{
"mcpServers": {
"openfinclaw": {
"command": "npx",
"args": ["@openfinclaw/cli", "serve"],
"env": {
"OPENFINCLAW_API_KEY": "fch_..."
}
}
}
}VS Code (Copilot) — .vscode/mcp.json
{
"servers": {
"openfinclaw": {
"command": "npx",
"args": ["@openfinclaw/cli", "serve"],
"env": {
"OPENFINCLAW_API_KEY": "fch_..."
}
}
}
}Hermes Agent — ~/.hermes/config.yaml
mcp_servers:
openfinclaw:
command: "npx"
args: ["@openfinclaw/cli", "serve"]
env:
OPENFINCLAW_API_KEY: "fch_..."OpenCode — ~/.config/opencode/opencode.json
{
"mcp": {
"openfinclaw": {
"type": "local",
"command": ["npx", "@openfinclaw/cli", "serve"],
"environment": {
"OPENFINCLAW_API_KEY": "fch_..."
},
"enabled": true
}
}
}Configuration
API Key (one unified fch_...)
| Env var | Used by |
|---|---|
OPENFINCLAW_API_KEY (fch_..., 68 chars) |
Both strategy (commons-hub /api/v1/skill/*) and deepagent (Hub Gateway /api/v1/agent/*) |
doctor renders diagnostics even when the key is absent; every other subcommand requires the key.
Resolution order (highest first):
- CLI flag:
--api-key <key> - Environment variable:
OPENFINCLAW_API_KEY ~/.openfinclaw/config.json(written byopenfinclaw init)
Get a key at hub.openfinclaw.ai, or trial DeepAgent online at https://hub.openfinclaw.ai/en/chat.
Environment variables
| Variable | Description | Default |
|---|---|---|
OPENFINCLAW_API_KEY |
Unified fch_ API key |
(required for every authenticated tool) |
OPENFINCLAW_CONFIG_PATH |
Override config file path | ~/.openfinclaw/config.json |
HUB_API_URL |
Hub base URL | https://hub.openfinclaw.ai |
DEEPAGENT_API_URL |
DeepAgent base URL (Hub Gateway) | https://gateway.openfinclaw.ai/api/v1/agent |
REQUEST_TIMEOUT_MS |
HTTP timeout (ms) | 60000 |
DEEPAGENT_SSE_TIMEOUT_MS |
SSE stream timeout (ms) | 900000 (15 min) |
Streaming & long-running tools
DeepAgent research runs can take 3–10 minutes. Two access patterns:
- Terminal CLI (
openfinclaw deepagent research "..."): true token-by-token streaming directly to stdout - MCP clients: the
researchworkflow is split into three calls —fin_deepagent_research_submit(returns ataskIdimmediately),fin_deepagent_research_poll(every 30–60 s for progress),fin_deepagent_research_finalize(fetch full result). The agent drives this loop itself — works consistently across Claude Desktop, Cursor, Hermes, Windsurf, and other MCP clients.
Related
- @openfinclaw/core — Platform-independent library core. Use directly only if you are building a custom MCP wrapper.
- DeepAgent online chat — try it in a browser first.
- GitHub — source, issues, Chinese README.
License
MIT