复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-stocks-ba27cb8718ab ,按照其中的说明把「stocks」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Read-only market data via Yahoo Finance. Five commands: quote, search,
history, compare, crypto. Python stdlib only — no API key, no pip
installs. Yahoo's endpoint is unofficial and may rate-limit or change.
Python 3.8+ stdlib only. Optional: set ALPHA_VANTAGE_KEY to enrich
market_cap, pe_ratio, and 52-week levels when Yahoo's crumb-protected
fields come back null. Free key: https://www.alphavantage.co/support/#api-key
Invoke through the terminal tool. Once installed:
SCRIPT=~/.hermes/skills/finance/stocks/scripts/stocks_client.py
python $SCRIPT quote AAPL
All output is JSON on stdout — pipe through jq if you want to slice it.
python $SCRIPT quote AAPL
python $SCRIPT quote AAPL MSFT GOOGL TSLA
python $SCRIPT search "Tesla"
python $SCRIPT history NVDA --range 6mo
python $SCRIPT compare AAPL MSFT GOOGL
python $SCRIPT crypto BTC ETH SOL
quote SYMBOL [SYMBOL2 ...]Current price, change, change%, volume, 52-week high/low.
search QUERYFind tickers by company name. Returns top 5: symbol, name, exchange, type.
history SYMBOL [--range RANGE]Daily OHLCV plus stats (min, max, avg, total return %). Ranges: 1mo,
3mo, 6mo, 1y, 5y. Default: 1mo.
compare SYMBOL1 SYMBOL2 [...]Side-by-side: price, change%, 52-week performance.
crypto SYMBOL [SYMBOL2 ...]Crypto prices. Pass BTC (the script appends -USD automatically).
market_cap and pe_ratio may return null on quote when Yahoo's
crumb session isn't established. Set ALPHA_VANTAGE_KEY to backfill.python ~/.hermes/skills/finance/stocks/scripts/stocks_client.py quote AAPL
Returns a JSON object with symbol: "AAPL" and a numeric price field.