echopai
v2.8.0
Published
Command-line interface for the EchoPai Open Platform: stock-market data, news, analyst views, sentiment, signals, backtests.
Maintainers
Readme
echopai
Command-line interface for the EchoPai Open Platform.
Programmatic access to A-share stock-market data, news, analyst views,
sentiment, financials, concepts, limit-up board, announcements, and digest
fan-out over https://api.echopai.com.
AI-first: JSON envelope on stdout, JSON error envelope on stderr, three-state exit codes — suitable for scripts, CI pipelines, Claude Desktop / Cursor / Claude Code MCP integration, and agent loops.
Install
Two ways — pick whichever fits.
A. npm (Node.js 20+)
npm install -g echopai
echopai --versionOr run without installing:
npx -y echopai market statusB. Standalone binary (no Node required) — 一键安装
自带 Bun runtime,无需 Node。安装器自动判平台(AVX2→baseline / musl / Rosetta)并 强制 sha256 校验:
curl -fsSL https://downloads.echopai.com/echopai-cli-releases/install.sh | bash
# 指定版本:
curl -fsSL https://downloads.echopai.com/echopai-cli-releases/install.sh | bash -s -- 2.4.0默认装到 ~/.local/bin/echopai(可用 ECHOPAI_INSTALL_DIR 改)。Windows 用户手动下载
echopai-windows-x64.exe。平台矩阵、CDN 布局与发布流程见
docs/CLI_RELEASE_AND_DISTRIBUTION.md。
Auth
# Save key to ~/.config/echopai/config.toml (mode 0600)
echopai login --key eps_live_<lookup>_<secret>
# Or pass per-invocation via env (CI / agent)
ECHOPAI_KEY=eps_live_xxx echopai market statusGet a key at the EchoPai admin console.
Highlights
echopai lookup --text 贵州茅台 # 中文名 → canonical_code
echopai digest --code SSE:600519 # 一键研究摘要(A 股 6 桶 fan-out)
echopai digest --code HK:00700 # 港股/中概 digest(仅 views+news)
echopai quote --codes SSE:600519,SZSE:000001 # 1-200 只实时报价
echopai market movers --sort speed --top 20 # 3-min 涨速榜
echopai sentiment overview --date 2026-05-20 # 任意历史日的情绪聚合
echopai concepts alerts # 概念异动 (big_move / limit_up_cluster)
echopai limit-up summary # 涨停数 / 炸板数 / 连板梯队
echopai financials quote-snapshot --code SSE:600519 # PE/PB/PS/换手率/股息率 14 字段估值快照
echopai mcp serve # 起 MCP stdio 服务给 Claude/Cursorechopai welcome 显示完整命令面板 + 鉴权状态。
Documentation
📖 docs/CLI.md —— install / auth / persona / verb 总览 / MCP / I/O 约定 / pagination / write safety / 设计原则 / 版本号约定 全在这里。
📋 docs/partner-api/cli-reference.md —— 自动生成的完整 endpoint 参数表,每个 op 的 inputSchema / scopes / 示例 / 输出 schema。
📝 CHANGELOG.md —— 版本变更记录。
Self-update
echopai upgrade # cache 命中即打印 npm i 命令(24h cache)
echopai upgrade --check # 强制刷 npm registry
echopai upgrade --exec # 真跑 npm i -g echopai@latestCLI 启动时后台 detached 子进程检查 npm registry,下次启动若有新版本会在
stderr 打一行 dim banner。ECHOPAI_DISABLE_UPDATE_CHECK=1 / CI=1 关掉。
Development
工具链是 Bun(install / test / build / compile 全用 bun;
codegen 仍是 Python)。npm 包产物 dist/bin.js 仍 node ≥20 兼容。
bun install # 装依赖(bun.lock)
bun run dev -- --help # 直接跑 TS 源(含 codegen)
bun test # 跑测试(bun:test)
bun run typecheck # tsc --noEmit(仅 src)
bun run build # 产 node 兼容 dist/bin.js(bun build --target=node)
bun run compile # 产各平台 standalone 二进制到 dist/bin/License
MIT
