gmgn-cli 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -14,6 +14,73 @@ With GMGN Agent Skills, you can use AI agents to query real-time trending token
14
14
 
15
15
  ---
16
16
 
17
+ ## Why GMGN Skills
18
+
19
+ > Built for AI agents to query and trade multi-chain Meme tokens at high speed in real time. gmgn-skills gives AI agents direct access to GMGN's trending tokens, Trenches new token listings, and professional on-chain data — including Smart Money, KOL, rat trader, and bundler analytics.
20
+ >
21
+ > With 500+ professional data dimensions, you can turn your AI agent into a 24/7 real-time chain-scanning trading tool — monitoring multi-chain token momentum, placing orders instantly, and managing exits with take-profit / stop-loss, all on autopilot.
22
+
23
+ ### 1. Real-time on-chain data — faster
24
+
25
+ Data across SOL / BSC / Base is live on every query. Supports multi-parameter customization, no snapshot cache — built for AI agent real-time decision-making (including but not limited to):
26
+
27
+ | Data | Granularity |
28
+ |------|-------------|
29
+ | New token discovery (Trenches) | Real-time, filtered by launchpad, dev holdings, KOL entry, rat trader ratio |
30
+ | Trending tokens | Real-time, `1m` / `5m` / `1h` / `6h` / `24h` — minimum **1-minute** window |
31
+ | Token info | Real-time — trade activity / price / volume / market cap |
32
+ | Token security | Real-time — open source, renounced, honeypot detection, etc. |
33
+ | Token analytics | Real-time — Dev / KOL / Smart Money / rat trader / bundler wallet holdings |
34
+ | Monitoring & tracking | Real-time — KOL / Smart Money / followed wallet trade activity |
35
+ | K-line (OHLCV) | Real-time, `1m` / `5m` / `15m` / `1h` / `4h` / `1d` — minimum **1-minute** candles |
36
+ | Wallet holdings | Real-time — holdings / P&L / trade activity |
37
+
38
+ ### 2. Trade faster
39
+
40
+ - Same RPC routing as GMGN's web trading interface, multi-region deployment, millisecond response — order submission under **0.3 seconds** end-to-end.
41
+ - Automatic best-route selection, the same routing engine as GMGN web.
42
+ - Market orders, limit orders, and strategy orders (take-profit / stop-loss) in a single command.
43
+ - Sell by position percentage (`--percent 50`) without calculating exact amounts.
44
+
45
+ ### 3. More comprehensive token data
46
+
47
+ No more scraping web pages or getting blocked by Cloudflare. Query all the professional analytics needed for high-frequency Meme token trading, with high concurrency in real time (including but not limited to):
48
+
49
+ - **Smart money count** (`smart_degen_count`) and **KOL holders** (`renowned_wallets`) — live
50
+ - **Rat trader ratio** (`rat_trader_amount_rate`) — volume share from insider/sneak wallets
51
+ - **Bundler bot exposure** (`bundler_trader_amount_rate`) — volume from bot-bundled buys
52
+ - **Sniper wallets** (`sniper_count`) — wallets that bought at the exact moment of launch
53
+ - **Suspected insider hold rate** (`suspected_insider_hold_rate`)
54
+ - **Fresh wallet ratio** (`fresh_wallet_rate`)
55
+ - **Rug ratio score** (0–1) + honeypot detection + wash-trade flag
56
+ - **Bonding curve status** (`is_on_curve`) — whether the token has graduated to open DEX
57
+
58
+ ### 4. What you can do with GMGN Skills
59
+
60
+ **Real-time chain scanning**
61
+ - Scan Trenches for new tokens, filtered by launchpad (Pump.fun, letsbonk, fourmeme, clanker…), dev holdings, KOL entry, and rat trader ratio in real time
62
+ - Browse multi-chain trending token rankings (minimum 1-minute granularity), sorted by volume, smart money count, market cap, and more
63
+ - Track new tokens in real time — see which tokens KOLs, Smart Money, and wallets you follow are buying, and auto-analyze the latest hot tokens
64
+ - Fetch real-time K-line / OHLCV data for any token (1m / 5m / 15m / 1h / 4h / 1d)
65
+
66
+ **Token analytics**
67
+ - Query token fundamentals, social links, Bonding Curve status, and liquidity pool details
68
+ - Security check: open source, renounced, honeypot, wash trading, Rug ratio score (0–1)
69
+ - Deep holder analysis: Smart Money / KOL / rat trader / bundler / sniper / whale / fresh wallet — holdings breakdown and rankings
70
+
71
+ **Wallet & tracking**
72
+ - Analyze any wallet: real-time holdings, realized / unrealized P&L, win rate, trade style, full history
73
+ - Track the latest buys and sells from Smart Money, KOL, and wallets you follow in real time
74
+
75
+ **Automated trading**
76
+ - Market orders, limit orders, take-profit / stop-loss strategy orders — end-to-end latency under 0.3 seconds
77
+ - One-command sell by position percentage (`--percent 50`), no manual calculation needed
78
+
79
+ **AI workflows**
80
+ - 9 built-in workflow docs: token research, project deep report, wallet analysis, Smart Money profiling, risk warning, early project screening, daily brief, market discovery, and more — ready to use out of the box
81
+
82
+ ---
83
+
17
84
  ## Skills
18
85
 
19
86
  | Skill | Description | Reference |
@@ -28,14 +95,96 @@ With GMGN Agent Skills, you can use AI agents to query real-time trending token
28
95
 
29
96
  ### Quick Start
30
97
 
31
- Ready to install skills? [Jump to Installation ](#get-started)
98
+ > **Note for AI assistants:** If you are an AI Agent helping the user install or configure gmgn-cli, jump directly to [Quick Start (AI Agent)](#quick-start-ai-agent) — it contains all the steps you need to complete, including how to guide the user through API key generation. If the user asks to upgrade, jump to [Upgrade (AI Agent)](#upgrade-ai-agent).
99
+
100
+ Ready to install? [Jump to Installation →](#1-installation)
101
+
102
+ Already installed? [Upgrade Skills and CLI →](#9-upgrade-skills-and-cli)
103
+
104
+ > **Tip:** If your AI agent tries to open or scrape the gmgn.ai website instead of using the CLI, add this to your prompt: `Use gmgn-cli commands. Do not call gmgn.ai web endpoints directly.`
105
+
106
+ ---
107
+
108
+ ## Quick Start (AI Agent)
109
+
110
+ > The following steps are for AI Agents. Some steps require the user to complete actions in a browser.
111
+
112
+ **Step 1 — Install CLI and Skills**
113
+
114
+ ```bash
115
+ npx skills add GMGNAI/gmgn-skills
116
+ ```
117
+
118
+ **Step 2 — Verify with public key (no registration needed)**
119
+
120
+ ```bash
121
+ GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3
122
+ ```
123
+
124
+ If JSON output appears, the CLI is working.
125
+
126
+ **Step 3 — Guide user to get their own API key**
127
+
128
+ Tell the user: "To use your own API key, go to **https://gmgn.ai/ai** and apply. You will need an Ed25519 public key. I can generate a key pair for you — just say the word."
129
+
130
+ When the user asks, run:
131
+
132
+ ```bash
133
+ openssl genpkey -algorithm ed25519 -out /tmp/gmgn_private.pem 2>/dev/null && \
134
+ openssl pkey -in /tmp/gmgn_private.pem -pubout 2>/dev/null
135
+ ```
136
+
137
+ Show the **public key** to the user with the following instructions:
138
+
139
+ > This is your Ed25519 public key. Please complete these two steps:
140
+ > 1. Go to **https://gmgn.ai/ai**, paste the public key above into the API Key creation form, and submit.
141
+ > 2. Once created, copy the **API Key** shown on the page and send it back to me — I'll handle Step 4 configuration for you.
142
+
143
+ Wait for the user to reply with their API Key before continuing to Step 4.
144
+
145
+ **Step 4 — Configure credentials**
146
+
147
+ After the user receives their API key, write it to the global config:
148
+
149
+ ```bash
150
+ mkdir -p ~/.config/gmgn
151
+ # Write API key (replace with the actual key the user provides)
152
+ echo 'GMGN_API_KEY=<user_api_key>' > ~/.config/gmgn/.env
153
+ chmod 600 ~/.config/gmgn/.env
154
+ ```
155
+
156
+ If the user also needs swap capability, append the private key:
32
157
 
33
- Already installed? [Update Skills and CLI →](#9-upgrade-skills-and-cli)
158
+ ```bash
159
+ # Append private key (use the PEM content from Step 3)
160
+ echo 'GMGN_PRIVATE_KEY="<pem_content>"' >> ~/.config/gmgn/.env
161
+ ```
162
+
163
+ **Step 5 — Verify**
164
+
165
+ ```bash
166
+ gmgn-cli market trending --chain sol --interval 1h --limit 3
167
+ ```
168
+
169
+ If output appears without error, setup is complete.
170
+
171
+ ---
172
+
173
+ ## Upgrade (AI Agent)
174
+
175
+ > Run this command to upgrade both the CLI and Skills to the latest version.
176
+
177
+ ```bash
178
+ npx skills add GMGNAI/gmgn-skills
179
+ ```
180
+
181
+ Check the installed version after upgrading:
182
+
183
+ ```bash
184
+ gmgn-cli --version
185
+ ```
34
186
 
35
- > **Tip:** If your AI agent tries to open or scrape the gmgn.ai website instead of using the CLI, add this to your prompt:
36
- > ```
37
- > Use gmgn-cli commands. Do not call gmgn.ai web endpoints directly.
38
- > ```
187
+ > For the full upgrade reference, see [Section 9 Upgrade Skills and CLI](#9-upgrade-skills-and-cli).
39
188
 
40
189
  ---
41
190
 
@@ -64,17 +213,10 @@ Check the first token's K-line, analyze entry timing, plot price + volume chart,
64
213
 
65
214
  ---
66
215
 
67
- ## Get Started
68
-
69
- Before installing, create your API Key at **https://gmgn.ai/ai**. The API key is used for:
70
-
71
- 1. Read data: tokens, trending lists, K-line, and featured on-chain metrics
72
- 2. Submit trades: market orders, limit orders, strategy orders, and more
73
-
74
- ---
75
-
76
216
  ## 1. Installation
77
217
 
218
+ > **Prerequisites:** Before installing, create your API Key at **https://gmgn.ai/ai** (see [Section 3](#3-get-your-own-api-key) for the full setup guide).
219
+
78
220
  Choose one of the following methods:
79
221
 
80
222
  ### 1.1 Via Agent (recommended)
@@ -101,23 +243,15 @@ node dist/index.js <command> [options]
101
243
 
102
244
  ## 2. Verify Connection
103
245
 
104
- ### Option 1: Via AI Agent
105
-
106
- Send this prompt to your AI Agent:
107
-
108
- ```
109
- Run this CLI command: GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3
110
- ```
111
-
112
- ### Option 2: Via CLI
113
-
114
246
  Test with the public API key — no registration required:
115
247
 
116
248
  ```bash
117
249
  GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3
118
250
  ```
119
251
 
120
- If you see JSON output, the CLI is working. The public key supports all read-only commands (token / market / portfolio). The public key is for testing only — apply for your own API key to use any feature (see step 3).
252
+ If you see JSON output, the CLI is working. The public key supports all read-only commands (token / market / portfolio) and is for testing only — apply for your own API key to use any feature (see step 3).
253
+
254
+ > **Troubleshooting — 401 / 403 errors:** If the command fails with `401` or `403` and credentials look correct, your outbound traffic may be going via IPv6 (not supported). Check immediately: (1) run `ifconfig | grep inet6` (macOS) or `ip addr show | grep inet6` (Linux) to list all network interfaces and their IPv6 addresses; (2) run `curl -s https://ipv6.icanhazip.com` — if it returns an IPv6 address, your traffic is going via IPv6. **Disable IPv6 on your network interface — gmgn-cli commands only work over IPv4.**
121
255
 
122
256
  ## 3. Get Your Own API Key
123
257
 
@@ -267,7 +401,23 @@ market trending (top 50) → AI selects top 5 by multi-factor analysis → u
267
401
 
268
402
  ---
269
403
 
270
- ## 7. CLI Reference
404
+ ## 7. Workflow Docs
405
+
406
+ Step-by-step guides for common analysis tasks:
407
+
408
+ | Workflow | When to use |
409
+ |----------|-------------|
410
+ | [workflow-token-research.md](docs/workflow-token-research.md) | Pre-buy token due diligence (address → buy/watch/skip) |
411
+ | [workflow-project-deep-report.md](docs/workflow-project-deep-report.md) | Comprehensive project analysis with scored dimensions and full written report |
412
+ | [workflow-wallet-analysis.md](docs/workflow-wallet-analysis.md) | Wallet quality assessment (address → follow/skip) |
413
+ | [workflow-smart-money-profile.md](docs/workflow-smart-money-profile.md) | Trading style analysis, copy-trade ROI estimate, smart money leaderboard |
414
+ | [workflow-risk-warning.md](docs/workflow-risk-warning.md) | Active risk monitoring for held positions (whale exit, liquidity, dev dump) |
415
+ | [workflow-early-project-screening.md](docs/workflow-early-project-screening.md) | Screen newly launched launchpad tokens for smart money entry |
416
+ | [workflow-daily-brief.md](docs/workflow-daily-brief.md) | Daily market overview: trending + smart money moves + early watch + risk scan |
417
+ | [workflow-market-opportunities.md](docs/workflow-market-opportunities.md) | Discover trading opportunities from trending data |
418
+ | [workflow-token-due-diligence.md](docs/workflow-token-due-diligence.md) | 4-step token due diligence checklist |
419
+
420
+ ## 8. CLI Reference
271
421
 
272
422
  Full parameter reference: [docs/cli-usage.md](docs/cli-usage.md). All commands support `--raw` for single-line JSON output (pipe-friendly, e.g. `| jq '.price'`).
273
423
 
@@ -351,37 +501,21 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
351
501
 
352
502
  ## 9. Upgrade Skills and CLI
353
503
 
354
- To upgrade `gmgn-cli` and Skills to the latest version:
355
-
356
- **Via AI Agent (recommended)**
357
-
358
- Send this to your AI agent:
359
-
360
- ```
361
- Run these two commands to update gmgn-cli and the skills:
362
- 1. npm install -g gmgn-cli
363
- 2. npx skills add GMGNAI/gmgn-skills
364
- ```
365
-
366
- **Via CLI**
367
-
368
504
  ```bash
369
- # Upgrade gmgn-cli
370
- npm install -g gmgn-cli
371
-
372
- # Upgrade Skills
505
+ # Upgrade CLI and Skills
373
506
  npx skills add GMGNAI/gmgn-skills
374
- ```
375
-
376
- **Check the current version**
377
507
 
378
- ```bash
508
+ # Check current version
379
509
  gmgn-cli --version
380
510
  ```
381
511
 
512
+ > **Via AI Agent:** Tell your agent — "Upgrade gmgn-cli and the skills to the latest version." See also [Upgrade (AI Agent)](#upgrade-ai-agent).
513
+
382
514
  ---
383
515
 
384
- ## 10. Security & Disclaimer
516
+ ## 10. Security & Disclaimer (Read Before Use)
517
+
518
+ This tool can be invoked by an AI Agent to submit real on-chain transactions automatically. It carries inherent risks including model hallucination, uncontrolled execution, and prompt injection. Once authorized, the AI Agent will submit transactions on behalf of your linked wallet address — **on-chain transactions are irreversible once confirmed** and may result in financial loss. Use with caution.
385
519
 
386
520
  **About `GMGN_PRIVATE_KEY`**
387
521
 
@@ -392,11 +526,13 @@ gmgn-cli --version
392
526
  - Restrict config file permissions: `chmod 600 ~/.config/gmgn/.env`
393
527
  - Never commit your `.env` file to version control — add it to `.gitignore`
394
528
  - Do not share `GMGN_API_KEY` or `GMGN_PRIVATE_KEY` in logs, screenshots, or chat messages
529
+ - Before every swap, carefully review the trade summary presented by the AI (chain, wallet, token addresses, amount) and confirm only when it matches your intent
530
+ - Test with small amounts first before executing larger trades
395
531
  - Always use the latest version of gmgn-cli (`npm install -g gmgn-cli`). To check your current version: `gmgn-cli --version`
396
532
 
397
533
  **Disclaimer**
398
534
 
399
- Use of this tool and any financial decisions made based on its output are entirely at your own risk. GMGN is not liable for any trading losses, errors, or unauthorized access resulting from improper credential management.
535
+ Use of this tool and any financial decisions made based on its output are entirely at your own risk. GMGN is not liable for any trading losses, errors, or unauthorized access resulting from model hallucination, prompt injection, improper credential management, or user confirmation errors. By using this tool, you acknowledge that you have fully understood the above risks and voluntarily accept all responsibility.
400
536
 
401
537
  The npm package is published with provenance attestation, linking each release to a specific git commit and CI pipeline run. Verify with:
402
538
  ```bash
package/Readme.zh.md CHANGED
@@ -14,6 +14,76 @@
14
14
 
15
15
  ---
16
16
 
17
+ ## 为什么选择 GMGN Skills
18
+
19
+ > 专为 AI Agent 高速实时查询、交易多链 Meme 代币而生。GMGN Skills 让 AI Agent 可以实时批量查询 GMGN 网站展示的热门代币、Trenches新创建代币,以及聪明钱、KOL、老鼠仓等专业顶级交易数据。
20
+ >
21
+ > 凭借 500+ 专业数据分析维度,你可以将自己的 AI Agent 打造成 7×24 小时全天候托管的实时扫链交易工具——实时监控多链代币热点、实时下单、实时止盈止损,实现全自动化交易。
22
+
23
+ ### 1. 链上实时数据查询快
24
+
25
+ SOL / BSC / Base 多链数据每次查询均为实时,支持多参数个性化调用,无快照缓存,方便AI Agent实时决策(包括不限于下表)。
26
+
27
+ | 数据类型 | 粒度 |
28
+ |---------|------|
29
+ | 新币发现(战壕) | 实时,按 Launchpad 平台,dev持仓,KOL持仓,老鼠仓持仓分类 |
30
+ | 热门代币榜单 | 实时,`1m` / `5m` / `1h` / `6h` / `24h`,最低支持 **1 分钟**窗口 |
31
+ | 代币信息 |实时,交易动态 / 代币价格 / 交易量 / 市值 等|
32
+ |代币安全 |实时,是否开源,弃权,貔貅检测等 |
33
+ |代币数据分析|实时,Dev / KOL / 聪明钱 / 老鼠仓 / 捆绑钱包等持仓占比 等|
34
+ |监控追踪|实时,KOL / 聪明钱 / 关注的钱包交易动态 / 天眼信号(开发中) 等|
35
+ | K 线(OHLCV) | 实时,`1m` / `5m` / `15m` / `1h` / `4h` / `1d`,最低支持 **1 分钟** |
36
+ |资产持仓|实时,持仓/盈亏/交易动态 等|
37
+
38
+
39
+
40
+
41
+ ### 2. 交易更快
42
+
43
+ - 与 GMGN 网页端共享同一套 RPC 路由,多区域部署,毫秒级响应,从下单到上链延时小于 **0.3 秒**。
44
+ - 交易自动找最佳路由,与 GMGN 网页端同一套
45
+ - 单条命令支持市价单、限价单、策略单(止盈 / 止损)。
46
+ - 支持按仓位比例卖出(`--percent 50`),无需手动计算数量。
47
+
48
+ ### 3. 特色数据更全
49
+
50
+ 不用再爬网页,不会被Claudeflare拦截,现在就可以快速/多并发实时查询多链的 Meme 代币高频交易所需的所有专业分析指标数据 (包括不限于):
51
+
52
+ - **聪明钱数量**(`smart_degen_count`)和 **KOL 持仓**(`renowned_wallets`)— 实时
53
+ - **老鼠仓占比**(`rat_trader_amount_rate`)— 内幕 / 偷跑钱包的交易量份额
54
+ - **捆绑钱包暴露度**(`bundler_trader_amount_rate`)— 机器人捆绑买入的交易量占比
55
+ - **狙击钱包数**(`sniper_count`)— 在代币刚开盘瞬间买入的钱包数量
56
+ - **疑似内幕持仓比**(`suspected_insider_hold_rate`)
57
+ - **新钱包占比**(`fresh_wallet_rate`)
58
+ - **Rug 风险评分**(0–1)+ 貔貅检测 + 对倒洗盘识别
59
+ - **Bonding Curve 状态**(`is_on_curve`)— 代币是否已毕业到开放 DEX
60
+
61
+ ### 4. 可以用 GMGN Skills 做什么
62
+
63
+ **实时查链**
64
+ - 扫描战壕新币,按 Launchpad(Pump.fun、letsbonk、fourmeme、clanker……)、dev 持仓、KOL 进场、老鼠仓占比实时过滤
65
+ - 浏览多链热门代币榜单(最低 1 分钟粒度),按交易量、聪明钱数量、市值等多维排序
66
+ - 实时追踪新币,追踪KOL/聪明/已关注的钱包最近在买哪些新币,自动分析最新热门代币
67
+ - 获取任意代币的实时 K 线 / OHLCV 数据(1m / 5m / 15m / 1h / 4h / 1d)
68
+
69
+ **代币数据分析**
70
+ - 查询代币基础信息、社交链接、Bonding Curve 状态、流动性池详情
71
+ - 安全核查:是否开源、弃权、貔貅、对倒洗盘、Rug 风险评分(0–1)
72
+ - 深度持仓分析:聪明钱 / KOL / 老鼠仓 / 捆绑钱包 / 狙击手 / 巨鲸 / 新钱包 各类持仓占比及排名
73
+
74
+ **钱包与追踪**
75
+ - 分析任意钱包:实时持仓、已实现 / 未实现盈亏、胜率、交易风格、历史流水
76
+ - 实时追踪聪明钱、KOL 和关注钱包的最新买卖动态
77
+
78
+ **自动化交易**
79
+ - 市价单、限价单、止盈止损策略单,从下单到上链延时 < 0.3 秒
80
+ - 按仓位比例一键卖出(`--percent 50`),无需手动计算数量
81
+
82
+ **AI 工作流**
83
+ - 9 个内置工作流文档:代币研究、项目深度报告、钱包分析、聪明钱画像、风险预警、早期项目筛选、每日简报、市场发现等,开箱即用
84
+
85
+ ---
86
+
17
87
  ## 技能
18
88
 
19
89
  | 技能 | 说明 | 参考 |
@@ -28,8 +98,12 @@
28
98
 
29
99
  ### 快速开始安装
30
100
 
101
+ > **AI Agent 注意:** 如果你是正在协助用户安装或配置 gmgn-cli 的 AI Agent,请直接跳转到 [AI Agent 快速开始](#ai-agent-快速开始) — 其中包含你需要完成的所有步骤,包括如何引导用户完成 API Key 申请。如果用户要求升级,请跳转到 [AI Agent 升级](#ai-agent-升级)。
102
+
31
103
  已准备好?[点击这里开始安装 Skills →](#开始安装-skills)
32
104
 
105
+ 已安装?[升级 Skills 和 CLI →](#9-升级-skills-和-cli)
106
+
33
107
  > **提示:** 如果你的 AI Agent 尝试直接打开 gmgn.ai 网站而不是使用 CLI,请在提示词中加上:
34
108
  > ```
35
109
  > 用 gmgn-cli 命令,不要直接请求gmgn.ai网页接口。
@@ -37,6 +111,89 @@
37
111
 
38
112
  ---
39
113
 
114
+ ## AI Agent 快速开始
115
+
116
+ > 以下步骤面向 AI Agent。部分步骤需要用户在浏览器中配合完成。
117
+
118
+ **第 1 步 — 安装 CLI 和 Skills**
119
+
120
+ ```bash
121
+ npx skills add GMGNAI/gmgn-skills
122
+ ```
123
+
124
+ **第 2 步 — 用公共 Key 验证(无需注册)**
125
+
126
+ ```bash
127
+ GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3
128
+ ```
129
+
130
+ 看到 JSON 输出即表示 CLI 正常工作。
131
+
132
+ **第 3 步 — 引导用户申请个人 API Key**
133
+
134
+ 告知用户:"需要个人 API Key,请前往 **https://gmgn.ai/ai** 申请。申请时需要一个 Ed25519 公钥,我可以帮你生成密钥对,告诉我一声就行。"
135
+
136
+ 用户确认后运行:
137
+
138
+ ```bash
139
+ openssl genpkey -algorithm ed25519 -out /tmp/gmgn_private.pem 2>/dev/null && \
140
+ openssl pkey -in /tmp/gmgn_private.pem -pubout 2>/dev/null
141
+ ```
142
+
143
+ 将**公钥**展示给用户,并附上以下说明:
144
+
145
+ > 以上是你的 Ed25519 公钥。接下来请你完成以下两步:
146
+ > 1. 打开 **https://gmgn.ai/ai**,将上方公钥填入 API Key 生成表单,完成创建。
147
+ > 2. 创建完成后,将页面上显示的 **API Key** 复制并发送给我,我来帮你完成第 4 步配置。
148
+
149
+ 等用户回复 API Key 后,再继续第 4 步。
150
+
151
+ **第 4 步 — 配置凭证**
152
+
153
+ 用户收到 API Key 后,写入全局配置:
154
+
155
+ ```bash
156
+ mkdir -p ~/.config/gmgn
157
+ # 写入 API Key(替换为用户提供的实际 Key)
158
+ echo 'GMGN_API_KEY=<user_api_key>' > ~/.config/gmgn/.env
159
+ chmod 600 ~/.config/gmgn/.env
160
+ ```
161
+
162
+ 如果用户需要 swap 能力,追加私钥:
163
+
164
+ ```bash
165
+ # 追加私钥(使用第 3 步输出的 PEM 内容)
166
+ echo 'GMGN_PRIVATE_KEY="<pem_content>"' >> ~/.config/gmgn/.env
167
+ ```
168
+
169
+ **第 5 步 — 验证**
170
+
171
+ ```bash
172
+ gmgn-cli market trending --chain sol --interval 1h --limit 3
173
+ ```
174
+
175
+ 有输出且无报错即配置完成。
176
+
177
+ ---
178
+
179
+ ## AI Agent 升级
180
+
181
+ > 运行以下命令,将 CLI 和 Skills 同时升级到最新版本。
182
+
183
+ ```bash
184
+ npx skills add GMGNAI/gmgn-skills
185
+ ```
186
+
187
+ 升级后检查版本:
188
+
189
+ ```bash
190
+ gmgn-cli --version
191
+ ```
192
+
193
+ > 完整升级说明请参阅[第 9 节 — 升级 Skills 和 CLI](#9-升级-skills-和-cli)。
194
+
195
+ ---
196
+
40
197
  ## 使用案例
41
198
 
42
199
  ### 查询热门代币榜
@@ -117,6 +274,8 @@ GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain so
117
274
 
118
275
  看到 JSON 输出即表示 CLI 正常工作。公共 Key 支持所有只读接口(token / market / portfolio),公共 Key 仅用于测试,正式使用任何接口均需申请个人 API Key(见第 3 步)。
119
276
 
277
+ > **排查 401 / 403 错误:** 如果命令返回 `401` 或 `403` 且凭证看起来正确,出口请求可能走了 IPv6(GMGN API 不支持)。立即排查:(1) 运行 `ifconfig | grep inet6`(macOS)或 `ip addr show | grep inet6`(Linux)列出所有网络接口及其 IPv6 地址;(2) 运行 `curl -s https://ipv6.icanhazip.com`——如果返回 IPv6 地址,说明流量走了 IPv6。**请立即关闭 IPv6,gmgn-cli 命令只能通过 IPv4 请求。**
278
+
120
279
  ## 3. 申请个人 API Key
121
280
 
122
281
  第 2 步的公共 Key 仅用于测试。正式使用(只读接口和 swap)均需在 https://gmgn.ai/ai 申请个人 API Key,需要准备:
@@ -276,7 +435,23 @@ solana 上的 <token_address> 安全吗,值得买入吗?
276
435
 
277
436
  ---
278
437
 
279
- ## 7. CLI 参考
438
+ ## 7. 工作流文档
439
+
440
+ 常用分析任务的分步指引:
441
+
442
+ | 工作流 | 适用场景 |
443
+ |--------|---------|
444
+ | [workflow-token-research.md](docs/workflow-token-research.md) | 买入前 Token 尽调(地址 → 买入/观望/跳过) |
445
+ | [workflow-project-deep-report.md](docs/workflow-project-deep-report.md) | 多维度评分的深度项目报告 |
446
+ | [workflow-wallet-analysis.md](docs/workflow-wallet-analysis.md) | 钱包质量评估(地址 → 是否值得跟随) |
447
+ | [workflow-smart-money-profile.md](docs/workflow-smart-money-profile.md) | 聪明钱行为画像、跟单收益估算、排行榜对比 |
448
+ | [workflow-risk-warning.md](docs/workflow-risk-warning.md) | 持仓风险预警(巨鲸出货、流动性、开发者跑路) |
449
+ | [workflow-early-project-screening.md](docs/workflow-early-project-screening.md) | 筛选新发 Launchpad Token,识别聪明钱早入信号 |
450
+ | [workflow-daily-brief.md](docs/workflow-daily-brief.md) | 每日市场简报:热门趋势 + 聪明钱动向 + 早期机会 + 风险扫描 |
451
+ | [workflow-market-opportunities.md](docs/workflow-market-opportunities.md) | 从趋势数据中发现交易机会 |
452
+ | [workflow-token-due-diligence.md](docs/workflow-token-due-diligence.md) | 4 步 Token 尽调清单 |
453
+
454
+ ## 8. CLI 参考
280
455
 
281
456
  完整参数说明:[docs/cli-usage.md](docs/cli-usage.md)。所有命令均支持 `--raw` 输出单行 JSON(方便 `jq` 等工具处理)。
282
457
 
@@ -284,23 +459,23 @@ solana 上的 <token_address> 安全吗,值得买入吗?
284
459
 
285
460
  ```bash
286
461
  # 基本信息 + 实时价格
287
- npx gmgn-cli token info --chain sol --address <addr>
462
+ gmgn-cli token info --chain sol --address <addr>
288
463
 
289
464
  # 安全指标(蜜罐、税率、集中度、rug 风险)
290
- npx gmgn-cli token security --chain sol --address <addr>
465
+ gmgn-cli token security --chain sol --address <addr>
291
466
 
292
467
  # 流动池信息(DEX、储备量、深度)
293
- npx gmgn-cli token pool --chain sol --address <addr>
468
+ gmgn-cli token pool --chain sol --address <addr>
294
469
 
295
470
  # 持仓大户(按持仓比例排序)
296
- npx gmgn-cli token holders --chain sol --address <addr> --limit 50
471
+ gmgn-cli token holders --chain sol --address <addr> --limit 50
297
472
 
298
473
  # 聪明钱持仓大户(按买入量排序)
299
- npx gmgn-cli token holders --chain sol --address <addr> \
474
+ gmgn-cli token holders --chain sol --address <addr> \
300
475
  --tag smart_degen --order-by buy_volume_cur --limit 20
301
476
 
302
477
  # 交易大户(KOL,按已实现盈利排序)
303
- npx gmgn-cli token traders --chain sol --address <addr> \
478
+ gmgn-cli token traders --chain sol --address <addr> \
304
479
  --tag renowned --order-by profit --limit 20
305
480
  ```
306
481
 
@@ -309,21 +484,21 @@ npx gmgn-cli token traders --chain sol --address <addr> \
309
484
  ```bash
310
485
  # K 线数据(1h 周期,最近 24 小时)
311
486
  # macOS:
312
- npx gmgn-cli market kline \
487
+ gmgn-cli market kline \
313
488
  --chain sol --address <addr> \
314
489
  --resolution 1h \
315
490
  --from $(date -v-24H +%s) --to $(date +%s)
316
491
  # Linux: $(date -d '24 hours ago' +%s)
317
492
 
318
493
  # 热门代币榜(SOL,1h,按交易量排序)
319
- npx gmgn-cli market trending \
494
+ gmgn-cli market trending \
320
495
  --chain sol \
321
496
  --interval 1h \
322
497
  --order-by volume --limit 20 \
323
498
  --filter not_risk --filter not_honeypot
324
499
 
325
500
  # 战壕新币列表
326
- npx gmgn-cli market trenches \
501
+ gmgn-cli market trenches \
327
502
  --chain sol \
328
503
  --type new_creation --type near_completion --type completed \
329
504
  --launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform letsbonk \
@@ -334,42 +509,42 @@ npx gmgn-cli market trenches \
334
509
 
335
510
  ```bash
336
511
  # 钱包持仓
337
- npx gmgn-cli portfolio holdings --chain sol --wallet <addr>
512
+ gmgn-cli portfolio holdings --chain sol --wallet <addr>
338
513
 
339
514
  # 交易记录
340
- npx gmgn-cli portfolio activity --chain sol --wallet <addr>
515
+ gmgn-cli portfolio activity --chain sol --wallet <addr>
341
516
 
342
517
  # 交易统计(支持多钱包)
343
- npx gmgn-cli portfolio stats --chain sol --wallet <addr1> --wallet <addr2>
518
+ gmgn-cli portfolio stats --chain sol --wallet <addr1> --wallet <addr2>
344
519
 
345
520
  # API Key 绑定的钱包及主币余额
346
- npx gmgn-cli portfolio info
521
+ gmgn-cli portfolio info
347
522
 
348
523
  # 单个 token 余额
349
- npx gmgn-cli portfolio token-balance --chain sol --wallet <addr> --token <token_addr>
524
+ gmgn-cli portfolio token-balance --chain sol --wallet <addr> --token <token_addr>
350
525
  ```
351
526
 
352
527
  ### Track
353
528
 
354
529
  ```bash
355
530
  # 追踪关注钱包的交易动态(需要 GMGN_PRIVATE_KEY)
356
- npx gmgn-cli track follow-wallet --chain sol
357
- npx gmgn-cli track follow-wallet --chain sol --wallet <wallet_address> --side buy
531
+ gmgn-cli track follow-wallet --chain sol
532
+ gmgn-cli track follow-wallet --chain sol --wallet <wallet_address> --side buy
358
533
 
359
534
  # KOL 交易动态
360
- npx gmgn-cli track kol --limit 100 --raw
361
- npx gmgn-cli track kol --chain sol --side buy --limit 50 --raw
535
+ gmgn-cli track kol --limit 100 --raw
536
+ gmgn-cli track kol --chain sol --side buy --limit 50 --raw
362
537
 
363
538
  # 聪明钱交易动态
364
- npx gmgn-cli track smartmoney --limit 100 --raw
365
- npx gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
539
+ gmgn-cli track smartmoney --limit 100 --raw
540
+ gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
366
541
  ```
367
542
 
368
543
  ### Swap(需要私钥)
369
544
 
370
545
  ```bash
371
546
  # 提交兑换(固定滑点)
372
- npx gmgn-cli swap \
547
+ gmgn-cli swap \
373
548
  --chain sol \
374
549
  --from <wallet-address> \
375
550
  --input-token <input-token-addr> \
@@ -378,7 +553,7 @@ npx gmgn-cli swap \
378
553
  --slippage 0.01
379
554
 
380
555
  # 提交兑换(自动滑点)
381
- npx gmgn-cli swap \
556
+ gmgn-cli swap \
382
557
  --chain sol \
383
558
  --from <wallet-address> \
384
559
  --input-token <input-token-addr> \
@@ -387,7 +562,7 @@ npx gmgn-cli swap \
387
562
  --auto-slippage
388
563
 
389
564
  # 按持仓比例卖出(例:卖出 50%)
390
- npx gmgn-cli swap \
565
+ gmgn-cli swap \
391
566
  --chain sol \
392
567
  --from <wallet-address> \
393
568
  --input-token <token-addr> \
@@ -396,7 +571,7 @@ npx gmgn-cli swap \
396
571
  --auto-slippage
397
572
 
398
573
  # 获取报价(不提交交易)
399
- npx gmgn-cli order quote \
574
+ gmgn-cli order quote \
400
575
  --chain sol \
401
576
  --from <wallet-address> \
402
577
  --input-token <input-token-addr> \
@@ -405,7 +580,7 @@ npx gmgn-cli order quote \
405
580
  --slippage 0.01
406
581
 
407
582
  # 查询订单状态
408
- npx gmgn-cli order get --chain sol --order-id <order-id>
583
+ gmgn-cli order get --chain sol --order-id <order-id>
409
584
  ```
410
585
 
411
586
  ## 8. 支持的链
@@ -449,7 +624,9 @@ gmgn-cli --version
449
624
 
450
625
  ---
451
626
 
452
- ## 10. 安全与免责
627
+ ## 10. 安全与免责(使用前必读)
628
+
629
+ 本工具可供 AI Agent 调用以自动执行链上交易,存在模型幻觉、执行不可控、提示词注入等固有风险。AI Agent 在获得授权后,将以您绑定的钱包地址提交真实的链上交易,**交易一经上链即不可撤销**,可能导致资金损失,请您谨慎使用。
453
630
 
454
631
  **关于 `GMGN_PRIVATE_KEY`**
455
632
 
@@ -460,8 +637,10 @@ gmgn-cli --version
460
637
  - 限制配置文件权限:`chmod 600 ~/.config/gmgn/.env`
461
638
  - 不要将 `.env` 文件提交到版本控制系统,请将其加入 `.gitignore`
462
639
  - 不要在日志、截图或聊天中泄露 `GMGN_API_KEY` 或 `GMGN_PRIVATE_KEY`
463
- - 请使用最新的 gmgn-cli(`npm install -g gmgn-cli`),查看当前版本请使用 `gmgn-cli --version`。
640
+ - 每次 swap 前,仔细核对 AI 呈现的交易摘要(链、钱包、代币地址、金额),确认无误后再回复确认
641
+ - 建议先用小额资金验证配置后再进行大额操作
642
+ - 请使用最新的 gmgn-cli(`npm install -g gmgn-cli`),查看当前版本请使用 `gmgn-cli --version`
464
643
 
465
644
  **免责声明**
466
645
 
467
- 使用本工具及根据其输出做出的任何财务决策,风险由用户自行承担。GMGN 对因凭证管理不当导致的任何交易损失、错误或未授权访问不承担责任。
646
+ 使用本工具及根据其输出做出的任何财务决策,风险由用户自行承担。GMGN 对因模型幻觉、提示词注入、凭证管理不当或用户操作失误导致的任何交易损失、错误或未授权访问不承担责任。使用本工具即视为您已充分知悉上述风险并自愿承担全部责任。