Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

tongstock-clitongstock CLI 搜索

Agent Skill

tongstock-cli 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

279

周安装

12

GitHub Stars

22

下载量

98
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tongstock-cli(tongstock CLI 搜索)
来源仓库:https://github.com/sjzsdu/tongstock
仓库路径:skills/tongstock-cli
安装命令:
npx skills add https://github.com/sjzsdu/tongstock --skill tongstock-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sjzsdu/tongstock --skill tongstock-cli

简介

tongstock-cli 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。
  • 可结合原始 README 文档进一步核验具体用法和功能边界。

SKILL.md

TongStock CLI & HTTP API Reference

TDX (通达信) protocol client for Chinese A-share market data (Shanghai, Shenzhen, Beijing exchanges).

Prerequisites

# Build from source
git clone https://github.com/sjzsdu/tongstock.git
cd tongstock
go build -o tongstock-cli ./cmd/cli
go build -o tongstock-server ./cmd/server

# Verify
./tongstock-cli --help

CLI Commands

quote — Real-time Quotes (五档行情)

tongstock-cli quote <code> [code2 ...]

Returns: price, open, high, low, volume, amount, last close, bid/ask 5 levels, inner/outer volume.

tongstock-cli quote 000001              # 平安银行
tongstock-cli quote 000001 600000       # Multiple stocks
tongstock-cli quote 600519              # 贵州茅台

codes — Stock Code List (股票代码)

tongstock-cli codes <subcommand> [flags]

Subcommands

SubcommandDescription
list列出证券代码 (默认)
stats显示各分类统计信息

Flags

FlagDefaultDescription
--exchange, -eszExchange: sz, sh, bj
--category, -callFilter by category
--sort, -sfalseSort by count

Categories

CategoryDescription
all全部 (默认)
stock股票
gem创业板
fund基金
etfETF
bond债券
index指数

Examples

# 默认列出深圳市场所有证券
tongstock-cli codes list

# 上海市场
tongstock-cli codes list -e sh

# 北京市场
tongstock-cli codes list -e bj

# 按分类过滤 - 只显示股票
tongstock-cli codes list -e sz -c stock

# 按分类过滤 - 只显示ETF
tongstock-cli codes list -e sz -c etf

# 查看统计信息
tongstock-cli codes stats

# 查看所有交易所统计
tongstock-cli codes stats --all

# 按交易所过滤
tongstock-cli codes stats -e sh

kline — K-line (Candlestick) Data

tongstock-cli kline --code <code> --type <type> [--all]
FlagDefaultDescription
--code, -crequiredStock code
--type, -tdayK-line type (see table below)
--all, -afalseFetch ALL historical data

K-line types:

TypeDescription
1m, minute1-minute
5m5-minute
15m15-minute
30m30-minute
60m60-minute
dayDaily
weekWeekly
monthMonthly
quarterQuarterly
yearYearly
tongstock-cli kline -c 000001 -t day
tongstock-cli kline -c 600519 -t week
tongstock-cli kline -c 000001 -t 5m
tongstock-cli kline -c 000001 -t day --all   # Full history

index — Index K-line (指数K线)

tongstock-cli index --code <code> --type <type>

Same flags as kline. Returns additional fields: UpCount (上涨家数), DownCount (下跌家数).

Common index codes:

  • 999999 — 上证指数
  • 399001 — 深证成指
  • 399006 — 创业板指
  • 399300 — 沪深300
tongstock-cli index -c 999999 -t day     # 上证指数 daily
tongstock-cli index -c 399300 -t 5m      # 沪深300 5-minute

minute — Intraday Minute Data (分时数据)

tongstock-cli minute <code>
tongstock-cli minute 000001

trade — Tick-by-tick Trades (分笔成交)

tongstock-cli trade <code> [--history] [--date <YYYYMMDD>]
FlagDefaultDescription
--date, -d-Date for history mode (YYYYMMDD)
--history, -HfalseQuery historical trades
--start, -s0Start offset
--count, -c100Number of records
tongstock-cli trade 000001                              # Today
tongstock-cli trade 000001 --history --date 20250314    # Historical

xdxr — Ex-rights & Dividends (除权除息)

tongstock-cli xdxr <code>

Returns history of: dividends (分红), bonus shares (送股), rights issue (配股), share capital changes (股本变动).

tongstock-cli xdxr 000001
tongstock-cli xdxr 600519

finance — Financial Data (财务数据)

tongstock-cli finance <code>

Returns: total shares, float shares, total assets, net assets, revenue, net profit, NAV per share, shareholder count, IPO date, etc.

tongstock-cli finance 000001
tongstock-cli finance 600519

company — Company Info / F10 (公司信息)

tongstock-cli company <code>

Lists available F10 document categories (latest tips, company profile, financial analysis, shareholder research, etc).

tongstock-cli company 000001

company-content — Company Info Content / F10 (公司信息内容)

tongstock-cli company-content <code> [filename] [--block <name>] [--start <offset>] [--length <length>]
FlagDefaultDescription
--block, -b-Block name (e.g., "公司概况")
--start, -s0Start offset
--length, -l10000Content length

Available F10 blocks:

Block NameDescription
最新提示公司最新动态、公告、报道等
公司概况公司基本信息、主营业务等
财务分析财务指标、报表分析等
股本结构股本构成、股东持股情况等
股东研究主要股东、股东变化等
机构持股机构投资者持股情况
分红融资分红历史、融资情况等
高管治理公司管理层信息
资金动向资金流入流出情况
资本运作并购、重组等资本活动
热点题材公司涉及的热点概念
公司公告公司发布的正式公告
公司报道媒体对公司的报道
经营分析业务经营情况分析
行业分析所属行业情况分析
研报评级分析师研究报告和评级
tongstock-cli company-content 000001                          # Basic usage
tongstock-cli company-content 000001 --block "公司概况"       # By block name
tongstock-cli company-content 000001 --block "财务分析"       # Financial analysis
tongstock-cli company-content 000001 --start 30744 --length 9560  # By range

block — Sector Classification (板块分类)

tongstock-cli block <subcommand> [flags]

Subcommands

SubcommandDescription
files列出所有可用的板块文件
list列出所有板块 [type, 编码, 名称, 成分股数]
show显示指定板块的成分股

Flags

FlagDefaultDescription
--file, -fblock_zs.datBlock file
--type, -t-Filter by type (e.g., 2)
--sort, -sfalseSort by stock count
--code, -c-Query blocks containing this stock

Available Block Files

FileNameDescription
block.dat综合板块综合分类
block_zs.dat指数板块主要指数成分股
block_fg.dat行业板块行业分类
block_gn.dat概念板块概念主题

Examples

# 列出所有板块文件
tongstock-cli block files

# 列出指数板块(默认)
tongstock-cli block list -f block_zs.dat

# 按Type过滤(2=标准板块)
tongstock-cli block list -f block.dat -t 2

# 按成分股数量排序
tongstock-cli block list -f block_fg.dat -s

# 显示板块成分股
tongstock-cli block show "沪深300" -f block_zs.dat

# 模糊搜索板块
tongstock-cli block show "银行" -f block_fg.dat

# 按股票代码查询所属板块
tongstock-cli block show --code 600519

indicator — Technical Indicators (技术指标)

tongstock-cli indicator --code <code> --type <type> [--all] [--count <n>] [--json]

Computes MACD, KDJ, MA(5/10/20/60/120), BOLL, RSI(6/12/24), Volume Ratio indicators with signal detection.

FlagDefaultDescription
--code, -crequiredStock code
--type, -tdayK-line type
--all, -afalseFetch ALL historical data
--count, -n250Number of K-lines
--json, -jfalseJSON format output
--days, -d1Number of days to return in JSON output
--config-Custom parameter config file

Supported Indicators:

  • MA: 5, 10, 20, 60, 120 day moving averages
  • MACD: DIF, DEA, Histogram (default: 12/26/9)
  • KDJ: K, D, J values (default: 9/3/3)
  • BOLL: Upper, Middle, Lower bands (default: 20/2.0)
  • RSI: RSI6, RSI12, RSI24 (relative strength)
  • Volume Ratio: Current volume / 5-day average volume
# Basic usage (table output)
tongstock-cli indicator -c 000001 -t day

# Full history
tongstock-cli indicator -c 000001 -t day --all

# Custom K-line count
tongstock-cli indicator -c 000001 -t day --count 500

# JSON output (for program parsing)
tongstock-cli indicator -c 000001 -t day --json

JSON Output Format:

{
  "code": "000001",
  "name": "平安银行",
  "timestamp": "2026-03-29",
  "price": { "current": 12.58, "change": 0.45, "change_pct": 3.71 },
  "ma": { "ma5": 12.32, "ma10": 12.18, "ma20": 11.95, "ma60": 11.50, "ma120": 11.20, "trend": "bullish" },
  "macd": { "dif": 0.35, "dea": 0.22, "hist": 0.26, "signal": "golden_cross" },
  "kdj": { "k": 72.5, "d": 68.2, "j": 81.1, "signal": "overbought" },
  "rsi": { "rsi6": 65.2, "rsi12": 62.8, "rsi24": 58.4, "signal": "neutral" },
  "boll": { "upper": 13.20, "middle": 12.50, "lower": 11.80, "position": 0.65, "signal": "normal" },
  "volume": { "current": 1250000, "avg5": 980000, "ratio": 1.28, "signal": "active" },
  "signals": ["golden_cross", "overbought", "多头排列"],
  "summary": { "trend": "上升趋势", "signal": "持有", "strength": 72 }
}

screen — Signal Screening (信号筛选)

tongstock-cli screen --codes <codes> --type <type> --signal <signal>
FlagDefaultDescription
--codes, -c-Comma-separated stock codes
--file, -f-File with one code per line
--type, -tdayK-line type
--signal, -srequiredSignal type
--pool, -p10Concurrency pool size

Available Signals:

  • golden_cross - 金叉 (DIF crosses above DEA, or K crosses above D)
  • death_cross - 死叉 (DIF crosses below DEA, or K crosses below D)
  • overbought - 超买 (J > 100 or RSI > 80)
  • oversold - 超卖 (J < 0 or RSI < 20)
tongstock-cli screen -c "000001,600519" -t day -s golden_cross
tongstock-cli screen -f codes.txt -t day -s oversold

count — Securities Count (证券数量)

tongstock-cli count [--exchange <sz|sh|bj>]
tongstock-cli count
tongstock-cli count -e sh
tongstock-cli count -e bj

auction — Call Auction (集合竞价)

tongstock-cli auction <code>
tongstock-cli auction 000001

HTTP API

Start server: tongstock-server (listens on :8080)

Core APIs

EndpointParamsDescription
GET /health-Health check
GET /api/quotecodeReal-time quote
GET /api/codesexchangeStock code list (legacy)
GET /api/codes/listexchange, categoryStock code list with filter
GET /api/codes/statsexchange, allCode statistics
GET /api/klinecode, type, start, countK-line data
GET /api/indexcode, typeIndex K-line
GET /api/minutecode, date, historyIntraday minute
GET /api/tradecode, start, count, date, historyTick trades
GET /api/xdxrcodeEx-rights/dividends
GET /api/financecodeFinancial data
GET /api/companycodeF10 category list
GET /api/company/contentcode, filenameF10 content
GET /api/blockfileSector classification (legacy)
GET /api/block/files-List available block files
GET /api/block/listfile, type, sortStructured block list
GET /api/block/showname, code, fileBlock stocks or query by stock
GET /api/indicatorcode, type, daysTechnical indicators (MA/MACD/KDJ/BOLL/RSI/VolumeRatio), days param limits K-line count
GET /api/screencodes, type, signalSignal screening
GET /api/countexchangeSecurities count
GET /api/auctioncodeCall auction

API Examples

# 查询行情
curl "http://localhost:8080/api/quote?code=000001"

# 股票代码列表(带分类)
curl "http://localhost:8080/api/codes/list?exchange=sz&category=stock"
curl "http://localhost:8080/api/codes/list?exchange=sz&category=etf"

# 股票代码统计
curl "http://localhost:8080/api/codes/stats?exchange=sz"
curl "http://localhost:8080/api/codes/stats?all=true"

# 查询K线
curl "http://localhost:8080/api/kline?code=000001&type=day"

# 板块文件列表
curl "http://localhost:8080/api/block/files"

# 板块列表(过滤+排序)
curl "http://localhost:8080/api/block/list?file=block_zs.dat&type=2&sort=true"

# 板块成分股
curl "http://localhost:8080/api/block/show?name=沪深300&file=block_zs.dat"

# 按股票代码查询所属板块
curl "http://localhost:8080/api/block/show?code=600519"

# 查询财务数据
curl "http://localhost:8080/api/finance?code=600519"

# 查询除权除息
curl "http://localhost:8080/api/xdxr?code=000001"

# 技术指标
curl "http://localhost:8080/api/indicator?code=000001&type=day"

Caching

Codes and Block APIs are cached in SQLite for 24 hours:

  • codes.db - codes cache
  • blocks.db - blocks cache

Stock Code Conventions

PrefixExchangeExamples
6xxxxxShanghai (SH)600000, 601318, 688xxx (科创板)
0xxxxxShenzhen (SZ)000001, 002xxx
3xxxxxShenzhen (SZ)300xxx (创业板), 399xxx (深证指数)
8xxxxxBeijing (BJ)830xxx, 831xxx
9xxxxxShanghai (SH)999999 (上证指数)

Codes can be passed as 6-digit (auto-detected) or 8-digit with prefix (sh600000, sz000001, bj830001).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.15%
按下载量换算32

Claude

30.94%
按下载量换算30

Cursor

18.23%
按下载量换算18

Gemini CLI

9.58%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills