一键导入
coingecko-cli
Use for CoinGecko/cg CLI crypto market data: prices, market cap, trending coins, top gainers/losers, coin search, historical data, or OHLC.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for CoinGecko/cg CLI crypto market data: prices, market cap, trending coins, top gainers/losers, coin search, historical data, or OHLC.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use only when explicitly asked to archive/prune/compact/roll over checked tasks from TODO.md into `.ai/todos/TODO_UNTIL_YYYY_MM_DD.md`, leaving unchecked tasks.
Use only when explicitly invoked for Git commit workflows: stage intended changes, craft Conventional Prefix Format messages by default, Natural Language messages with --natural or configured repos, commit, and optionally --all, --staged, --deep, --close, or --push.
Use for dependency updates: update/bump deps, npm/pnpm/yarn/bun package upgrades, outdated checks, package.json updates, or taze.
Use for release versioning: bump/cut/tag a release, bump version, create a release, changelog updates, or version tagging.
Use for GitHub PR/issue/discussion workflows: create/update PRs or issues, post comments, start discussions; triggers include create/open PR, file/update issue, yeet.
Use to polish recently changed code: simplify for readability/maintainability and run a risk-profiled review that autonomously applies fixes. Default runs both passes; pass --simplify or --review for one. Covers code/PR review, audits, bug/security checks, reviewing diffs or changes, cleanup, refactoring, and reducing complexity.
| disable-model-invocation | false |
| name | coingecko-cli |
| user-invocable | false |
| description | Use for CoinGecko/cg CLI crypto market data: prices, market cap, trending coins, top gainers/losers, coin search, historical data, or OHLC. |
Query cryptocurrency market data using the official CoinGecko CLI (cg). The CLI wraps the CoinGecko V3 API with structured JSON output, a dry-run mode, and a self-describing command catalog — designed to be driven by agents.
Key capabilities:
cg price)cg markets)cg search)cg trending)cg history)cg top-gainers-losers, paid)Out of scope — cg does not support contract-address price lookups, global market stats (total market cap, BTC/ETH dominance), NFT detail endpoints, GeckoTerminal on-chain DEX queries, or token logo metadata. Fall back to WebFetch against docs.coingecko.com/llms.txt for those.
Verify the CLI is installed:
command -v cg || { echo "cg not on PATH; install via: brew install coingecko/coingecko-cli/cg"; exit 1; }
Check authentication and tier without running interactive setup:
cg status -o json
The CLI reads CG_API_KEY and CG_API_TIER (demo or paid) from the environment. If cg status shows no key, ask the user before invoking cg auth — that command is interactive and writes config to disk.
| Tier | Rate Limit | Monthly Cap | History | Paid-Only Commands |
|---|---|---|---|---|
| Demo (free) | ~30 req/min | ~10,000 | 1 year | — |
| Analyst | ~500 req/min | ~500,000 | Deeper | top-gainers-losers |
| Lite / Pro | 500–1000 req/min | 1M–3M | Deeper | top-gainers-losers |
Detect feature gating up front by reading the paid_only field in cg commands -o json.
-o json for any output that needs to be parsed by the agent. The default table format is for humans.--dry-run to preview the underlying API request as JSON without executing it. Useful when validating an unfamiliar flag combination before spending a quota.--export <file.csv> only when the user explicitly asks for CSV (cg markets, cg history, cg top-gainers-losers support this).CoinGecko identifies coins by string ID (e.g. bitcoin, ethereum), not symbol. Many IDs diverge from the coin's common name.
Resolution order:
cg price --symbols btc,eth ... works but symbols are non-unique. Only the top-market-cap coin per symbol is returned.cg search <term> -o json to resolve the ID first, then re-issue the real query.| Coin | ID | Symbol |
|---|---|---|
| Bitcoin | bitcoin | BTC |
| Ethereum | ethereum | ETH |
| Solana | solana | SOL |
| BNB | binancecoin | BNB |
| XRP | ripple | XRP |
| Cardano | cardano | ADA |
| Dogecoin | dogecoin | DOGE |
| Chainlink | chainlink | LINK |
| Avalanche | avalanche-2 | AVAX |
| Polygon | polygon-ecosystem-token | POL |
| Uniswap | uniswap | UNI |
| Aave | aave | AAVE |
| Maker | maker | MKR |
| USDC | usd-coin | USDC |
| USDT | tether | USDT |
| DAI | dai | DAI |
| Wrapped BTC | wrapped-bitcoin | WBTC |
cg price --ids bitcoin,ethereum --vs usd -o json
cg price --symbols btc,eth --vs eur -o json
Returns { "<id>": { "<currency>": <price>, "<currency>_24h_change": <pct> } }.
# Top 50 by market cap in USD
cg markets --total 50 --vs usd -o json
# Layer-1 category, sorted by volume, exported to CSV
cg markets --category layer-1 --order volume_desc --export l1.csv
--order enum: market_cap_desc (default), market_cap_asc, volume_desc, volume_asc, id_asc, id_desc. Category IDs come from cg commands -o json or /coins/categories/list.
cg search ethereum --limit 5 -o json
Returns an array of { id, name, symbol, market_cap_rank }. Use this first whenever the user gives only a name or symbol.
cg trending -o json
Returns trending coins, nfts, and categories from the last 24h. --show-max coins,nfts,categories increases the per-section limit (paid only).
cg history <coin> has three mutually exclusive query modes:
# Snapshot on a single date
cg history bitcoin --date 2024-01-01 -o json
# Last N days, auto-granularity
cg history ethereum --days 30 -o json
# Explicit date range; --to covers the full day up to 23:59:59 UTC
cg history solana --from 2024-01-01 --to 2024-03-01 -o json
Modifiers:
--ohlc — switch from price series to candlesticks. In --days mode, only 1, 7, 14, 30, 90, 180, 365, max are accepted.--interval daily|hourly — override auto-granularity for --days or --from/--to. Large ranges auto-batch into multiple API requests.--vs <currency> — quote currency (default usd).--export <file.csv> — write to CSV.Returned JSON in price mode: { "prices": [[ts_ms, price], ...], "market_caps": [...], "total_volumes": [...] }. In OHLC mode the response is a bare array of [ts_ms, open, high, low, close] tuples.
cg top-gainers-losers --duration 24h --top-coins 1000 -o json
cg top-gainers-losers --losers --duration 7d --price-change-percentage 1h,7d,30d -o json
--duration enum: 1h, 24h, 7d, 14d, 30d, 60d, 1y. --top-coins enum: 300, 500, 1000, all. Returns 401 on demo tier — check paid_only via cg commands before calling.
Default to a Markdown table when presenting results to the user. Honour explicit format requests (JSON, CSV, plain text).
Number formatting:
$67,187.34)$0.4523)$0.000001234)$1.32T, $415.2B, $8.5M)+3.64%, -1.23%)When the inline examples don't cover what's needed, query the CLI's own machine-readable catalog:
cg commands -o json
Each entry includes name, description, examples, flags (with type, default, enum), output_formats, api_endpoint, oas_operation_id, requires_auth, and paid_only. Use it to detect tier gating before issuing a command, or to find the exact enum values for a flag.
For one-off flag lookups:
cg <subcommand> --help
--ids a,b,c) wherever the command allows.cg status -o json surfaces it. Prompt the user; do not run cg auth non-interactively.paid_only field in cg commands -o json before invoking. The CLI will otherwise return an API error.WebFetch for endpoints cg does not expose (contract-address prices, NFT details, GeckoTerminal on-chain DEX data).