gmgn-cli 1.0.0 → 1.0.2

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
@@ -1,8 +1,16 @@
1
- # gmgn-cli
1
+ <div align="center">
2
2
 
3
- > 中文文档:[Readme.zh.md](Readme.zh.md)
3
+ <img src="static/gmgnagentskills.png" alt="GMGN Agent Skills" />
4
4
 
5
- GMGN AI skills for on-chain operations — token research, market data, wallet analysis, and swap.
5
+ [![X](https://img.shields.io/badge/Follow-%40gmgnai-black?logo=x&logoColor=white)](https://x.com/gmgnai) [![Telegram](https://img.shields.io/badge/Telegram-gmgnagentapi-2CA5E0?logo=telegram&logoColor=white)](https://t.me/gmgnagentapi) [![Discord](https://img.shields.io/badge/Discord-gmgnai-5865F2?logo=discord&logoColor=white)](https://discord.gg/gmgnai)
6
+
7
+ English | [简体中文](Readme.zh.md)
8
+
9
+ </div>
10
+
11
+ ## GMGN Agent Skills
12
+
13
+ With GMGN Agent Skills, you can use AI agents to query real-time trending token rankings across multiple chains, token fundamentals, social media signals, live trading activity, new tokens in Trenches, top holders, top traders, smart money positions, KOL holdings, insider wallets, bundled wallet exposure, and other professional on-chain analytics. It also supports market orders, limit orders, advanced take-profit/stop-loss strategy orders, and wallet management — including real-time holdings, recent P&L, and transaction history — all through natural language.
6
14
 
7
15
  ---
8
16
 
@@ -15,50 +23,127 @@ GMGN AI skills for on-chain operations — token research, market data, wallet a
15
23
  | [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | Wallet holdings, activity, stats | [SKILL.md](skills/gmgn-portfolio/SKILL.md) |
16
24
  | [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | Swap submission + order query | [SKILL.md](skills/gmgn-swap/SKILL.md) |
17
25
 
26
+ > For detailed CLI commands, parameters, and recommended values, see the [Wiki documentation](https://github.com/GMGNAI/gmgn-skills/wiki).
27
+
28
+ ### Quick Start
29
+
30
+ Ready to install skills? [Jump to Installation →](#get-started)
31
+
18
32
  ---
19
33
 
20
- ## Usage Examples
34
+ ## Demo Cases
21
35
 
22
- Natural language prompts you can send to any AI assistant with gmgn-cli skills installed:
36
+ ### Trending Token Rankings
37
+
38
+ Send this prompt to your AI Agent:
23
39
 
24
40
  ```
25
- buy 0.1 SOL of <token_address>
26
- sell 50% of <token_address> on BSC
27
- check order status <order_id>
28
- is <token_address> safe to buy on solana?
29
- show top holders of <token_address>
30
- show my wallet holdings on SOL
31
- query token details for 0x1234...
32
- show trading stats for wallet <wallet_address> on BSC
41
+ Fetch Solana 1h trending, filter for pump.fun tokens created within 6h, sort by volume descending.
42
+ ```
43
+
44
+ ![Trending Token Rankings](static/market-rank-1h-Pumpfun-en.png)
45
+
46
+ ### Real-Time Token Trading Analysis
47
+
48
+ Send this prompt to your AI Agent:
49
+
33
50
  ```
51
+ Check the first token's K-line, analyze entry timing, plot price + volume chart, and provide social media links and smart money/KOL trading analysis.
52
+ ```
53
+
54
+ ![Token Analysis 1](static/market-tokenanalysis-en01.png)
55
+ ![Token Analysis 2](static/market-tokenanalysis-en02.png)
34
56
 
35
57
  ---
36
58
 
37
- ## Setup
59
+ ## Get Started
38
60
 
39
- ### 0. Prepare
61
+ Before installing, create your API Key at **https://gmgn.ai/ai**. The API key is used for:
40
62
 
41
- Before applying for an API Key, get two things ready:
63
+ 1. Read data: tokens, trending lists, K-line, and featured on-chain metrics
64
+ 2. Submit trades: market orders, limit orders, strategy orders, and more
42
65
 
43
- **Generate an Ed25519 key pair**
66
+ ---
44
67
 
45
- Download and run the [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases). You will need the **public key** when filling out the API Key application, and the **private key** in your `.env` later (for swap / order).
68
+ ## 1. Installation
46
69
 
47
- **Get your public egress IP** (for the IP whitelist)
70
+ Choose one of the following methods:
71
+
72
+ ### 1.1 Via Agent (recommended)
73
+
74
+ Send this to your AI agent:
48
75
 
49
76
  ```bash
50
- curl ip.me
77
+ npx skills add GMGNAI/gmgn-skills
78
+ ```
79
+
80
+ ### 1.2 npm Global Install
81
+
82
+ ```bash
83
+ npm install -g gmgn-cli@1.0.2
84
+ ```
85
+
86
+ ### 1.3 Local Development
87
+
88
+ ```bash
89
+ npm install
90
+ npm run build
91
+ node dist/index.js <command> [options]
92
+ ```
93
+
94
+ ## 2. Verify Connection
95
+
96
+ ### Option 1: Via AI Agent
97
+
98
+ Send this prompt to your AI Agent:
99
+
100
+ ```
101
+ Run this CLI command: GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3
51
102
  ```
52
103
 
53
- Or visit **https://ip.me** in your browser.
104
+ ### Option 2: Via CLI
105
+
106
+ Test with the public API key — no registration required:
107
+
108
+ ```bash
109
+ GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3
110
+ ```
54
111
 
55
- ### 1. Get an API Key
112
+ 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).
56
113
 
57
- Apply at **https://gmgn.ai/ai** enter the public key and your IP address from the step above.
114
+ ## 3. Get Your Own API Key
58
115
 
59
- ### 2. Configure
116
+ The public key in step 2 is for testing only. Apply for your own API key at **https://gmgn.ai/ai** — required for all actual use (read-only and swap). You will need:
60
117
 
61
- **Option A Global config (recommended)**
118
+ ### 3.1 Generate an Ed25519 Key Pair
119
+
120
+ **Option 1 — Ask your AI agent (recommended)**
121
+
122
+ Send this prompt to your agent:
123
+
124
+ ```
125
+ Generate an Ed25519 key pair for me using OpenSSL and show me:
126
+ 1. The public key (I need to fill it in the GMGN API Key application form)
127
+ 2. The private key in PEM format (I need to set it as GMGN_PRIVATE_KEY in my .env)
128
+ ```
129
+
130
+ **Option 2 — Binance Key Generator**
131
+
132
+ Download and run the [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases).
133
+
134
+ Enter the **public key** in the application form.
135
+
136
+ ### 3.2 Get Your Public Egress IP
137
+
138
+ For the IP whitelist (required when enabling swap capability on your API key):
139
+
140
+ ```bash
141
+ curl ip.me
142
+ ```
143
+
144
+ ## 4. Configure Your API Key
145
+
146
+ ### Option 1: Global config (recommended)
62
147
 
63
148
  Create `~/.config/gmgn/.env` once — works from any directory:
64
149
 
@@ -67,12 +152,12 @@ mkdir -p ~/.config/gmgn
67
152
  cat > ~/.config/gmgn/.env << 'EOF'
68
153
  GMGN_API_KEY=your_api_key_here
69
154
 
70
- # Required for swap / order (private key from step 0):
155
+ # Required for swap / order only:
71
156
  GMGN_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n<base64>\n-----END PRIVATE KEY-----\n"
72
157
  EOF
73
158
  ```
74
159
 
75
- **Option B Project `.env`**
160
+ ### Option 2: Project `.env`
76
161
 
77
162
  ```bash
78
163
  cp .env.example .env
@@ -81,21 +166,15 @@ cp .env.example .env
81
166
 
82
167
  Config lookup order: `~/.config/gmgn/.env` → project `.env` (project takes precedence).
83
168
 
84
- ### 3. CLI Install
169
+ ## 5. Try in AI Clients
85
170
 
86
- ```bash
87
- npm install -g gmgn-cli
88
- ```
171
+ #### OpenClaw
89
172
 
90
- Local development:
173
+ Send the following prompt directly to test the query capabilities:
91
174
 
92
- ```bash
93
- npm install
94
- npm run build
95
- node dist/index.js <command> [options]
96
175
  ```
97
-
98
- ### 4. Connect to Your AI Tool
176
+ Show me the trending tokens on Solana in the last 1 hour.
177
+ ```
99
178
 
100
179
  #### Claude Code
101
180
 
@@ -105,19 +184,17 @@ Skills are automatically discovered when the package is installed as a plugin.
105
184
 
106
185
  Skills are automatically discovered via the `.cursor-plugin/` configuration.
107
186
 
108
- 1. Complete steps 1–3 above
109
- 2. Configure credentials in `~/.config/gmgn/.env`
110
- 3. Restart Cursor — skills will be available in Agent mode via `/gmgn-*` commands
187
+ 1. Complete the installation and configuration steps above
188
+ 2. Restart Cursor — skills will be available in Agent mode via `/gmgn-*` commands
111
189
 
112
190
  #### Cline
113
191
 
114
- 1. Complete steps 1–3 above
192
+ 1. Complete the installation and configuration steps above
115
193
  2. In Cline settings → **Skills directory**: point to the installed package's `skills/` folder:
116
194
  ```bash
117
195
  echo "$(npm root -g)/gmgn-skills/skills"
118
196
  ```
119
- 3. Configure credentials in `~/.config/gmgn/.env`
120
- 4. Restart Cline — `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-swap` will be available
197
+ 3. Restart Cline `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-swap` will be available
121
198
 
122
199
  #### Codex CLI
123
200
 
@@ -141,7 +218,24 @@ See [.opencode/INSTALL.md](.opencode/INSTALL.md) for full instructions.
141
218
 
142
219
  ---
143
220
 
144
- ## Typical Workflows
221
+ ## 6. Usage
222
+
223
+ ### Examples
224
+
225
+ Natural language prompts you can send to any AI assistant with gmgn-cli skills installed:
226
+
227
+ ```
228
+ buy 0.1 SOL of <token_address>
229
+ sell 50% of <token_address> on BSC
230
+ check order status <order_id>
231
+ is <token_address> safe to buy on solana?
232
+ show top holders of <token_address>
233
+ show my wallet holdings on SOL
234
+ query token details for 0x1234...
235
+ show trading stats for wallet <wallet_address> on BSC
236
+ ```
237
+
238
+ ### Typical Workflows
145
239
 
146
240
  **Research a token:**
147
241
  ```
@@ -160,14 +254,14 @@ token info (confirm token) → portfolio token-balance (check funds) → swa
160
254
 
161
255
  **Discover trading opportunities via trending:**
162
256
  ```
163
- market trending (top 50, score-ranked) → AI selects top 5 by multi-factor analysis → user reviews → token info / token security → swap
257
+ market trending (top 50) → AI selects top 5 by multi-factor analysis → user reviews → token info / token security → swap
164
258
  ```
165
259
 
166
260
  ---
167
261
 
168
- ## CLI Reference
262
+ ## 7. CLI Reference
169
263
 
170
- Full parameter reference: [docs/cli-usage.md](docs/cli-usage.md)
264
+ 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'`).
171
265
 
172
266
  ### Token
173
267
 
@@ -181,7 +275,7 @@ npx gmgn-cli token info --chain sol --address <addr>
181
275
  npx gmgn-cli market trending \
182
276
  --chain sol \
183
277
  --interval 1h \
184
- --orderby volume --limit 20 \
278
+ --order-by volume --limit 20 \
185
279
  --filter not_risk --filter not_honeypot
186
280
  ```
187
281
 
@@ -207,9 +301,7 @@ npx gmgn-cli swap \
207
301
  npx gmgn-cli order get --chain sol --order-id <order-id>
208
302
  ```
209
303
 
210
- ---
211
-
212
- ## Supported Chains
304
+ ## 8. Supported Chains
213
305
 
214
306
  | Commands | Chains | Chain Currencies |
215
307
  |----------|--------|-----------------|
@@ -218,19 +310,24 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
218
310
 
219
311
  ---
220
312
 
221
- ## Output Format
313
+ ## 9. Security & Disclaimer
222
314
 
223
- Default: formatted JSON. Use `--raw` for single-line JSON (pipe-friendly):
315
+ **About `GMGN_PRIVATE_KEY`**
224
316
 
225
- ```bash
226
- npx gmgn-cli token info --chain sol --address <addr> --raw | jq '.price'
227
- ```
317
+ `GMGN_PRIVATE_KEY` is a **request-signing key** used to authenticate API calls to the GMGN OpenAPI service. It is not a blockchain wallet private key and does not directly control on-chain assets. If compromised, an attacker could forge authenticated API requests on your behalf — rotate it immediately via the GMGN dashboard if you suspect exposure.
228
318
 
229
- ---
319
+ **Best practices**
320
+
321
+ - Restrict config file permissions: `chmod 600 ~/.config/gmgn/.env`
322
+ - Never commit your `.env` file to version control — add it to `.gitignore`
323
+ - Do not share `GMGN_API_KEY` or `GMGN_PRIVATE_KEY` in logs, screenshots, or chat messages
324
+ - Use a pinned install (`npm install -g gmgn-cli@1.0.2`) rather than `npx gmgn-cli` to avoid executing unintended package updates alongside your credentials
230
325
 
231
- ## Security & Disclaimer
326
+ **Disclaimer**
232
327
 
233
- - Never commit your `.env` file or private key to version control add them to `.gitignore`
234
- - Keep your `GMGN_API_KEY` and private key confidential; do not share them in logs, screenshots, or chat messages
235
- - The private key used for swap/order must correspond to the wallet bound to your API Key
236
- - **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.**
328
+ 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.
329
+
330
+ The npm package is published with provenance attestation, linking each release to a specific git commit and CI pipeline run. Verify with:
331
+ ```bash
332
+ npm audit signatures gmgn-cli
333
+ ```
package/Readme.zh.md CHANGED
@@ -1,8 +1,16 @@
1
- # gmgn-cli
1
+ <div align="center">
2
2
 
3
- > English: [Readme.md](Readme.md)
3
+ <img src="static/gmgnagentskills.png" alt="GMGN Agent Skills" />
4
4
 
5
- GMGN 链上操作 AI 技能套件 — Token 研究、行情数据、钱包分析和交易。
5
+ [![X](https://img.shields.io/badge/关注-%40gmgnai-black?logo=x&logoColor=white)](https://x.com/gmgnai) [![Telegram](https://img.shields.io/badge/Telegram-gmgnagentapi-2CA5E0?logo=telegram&logoColor=white)](https://t.me/gmgnagentapi) [![Discord](https://img.shields.io/badge/Discord-gmgnai-5865F2?logo=discord&logoColor=white)](https://discord.gg/gmgnai)
6
+
7
+ [English](Readme.md) | 简体中文
8
+
9
+ </div>
10
+
11
+ ## GMGN Agent Skills
12
+
13
+ 使用 GMGN Agent Skills,你可以通过 AI Agent 实时查询多个链上热门代币排行榜,代币基础信息,社交媒体信息,实时交易动态,实时战壕新币,报持仓大户(Top Holder),交易大户(Top Trader),聪明钱持仓占比,KOL持仓占比,老鼠仓持仓,捆绑持仓占比,等代币专业数据分析数据,以及支持代币市价单交易、限价单交易、高级止盈止损策略单交易,以及钱包资产管理相关功能,例如查询钱包实时持仓、钱包最近盈亏、钱包交易动态等,全部通过自然语言与 AI Agent 交互即可完成。
6
14
 
7
15
  ---
8
16
 
@@ -15,50 +23,127 @@ GMGN 链上操作 AI 技能套件 — Token 研究、行情数据、钱包分析
15
23
  | [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | 钱包持仓、活动、统计 | [SKILL.md](skills/gmgn-portfolio/SKILL.md) |
16
24
  | [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | 兑换提交 + 订单查询 | [SKILL.md](skills/gmgn-swap/SKILL.md) |
17
25
 
26
+ > 如需查看详细的 CLI 接口说明、传参格式和推荐值,请参阅 [Wiki 文档](https://github.com/GMGNAI/gmgn-skills/wiki/Home-Chinese)。
27
+
28
+ ### 快速开始安装
29
+
30
+ 已准备好?[点击这里开始安装 Skills →](#开始安装-skills)
31
+
18
32
  ---
19
33
 
20
- ## 用法示例
34
+ ## 使用案例
21
35
 
22
- 安装技能后,向 AI 助手直接发送自然语言指令:
36
+ ### 查询热门代币榜
37
+
38
+ 发送下面提示词给 AI Agent:
39
+
40
+ ```
41
+ 查 Solana 1h 热门榜,筛出 6 小时内创建的新币,并且platforms是pump.fun的代币,然后按交易量从高到低排列。
42
+ ```
43
+
44
+ ![查询热门代币榜](static/market-rank-1h-Pumpfun-cn.png)
45
+
46
+ ### 实时分析代币交易走势
47
+
48
+ 发送下面提示词给 AI Agent:
23
49
 
24
50
  ```
25
- buy 0.1 SOL of <token_address>
26
- sell 50% of <token_address> on BSC
27
- check order status <order_id>
28
- is <token_address> safe to buy on solana?
29
- show top holders of <token_address>
30
- show my wallet holdings on SOL
31
- query token details for 0x1234...
32
- show trading stats for wallet <wallet_address> on BSC
51
+ 查看第一个代币的 K 线,分析入场时机,并提供社交媒体链接以及聪明资金 / KOL 的交易分析。
33
52
  ```
34
53
 
54
+ ![代币分析 1](static/market-tokenanalysis-cn01.png)
55
+ ![代币分析 2](static/market-tokenanalysis-cn02.png)
56
+
35
57
  ---
36
58
 
37
- ## 安装配置
59
+ ## 开始安装 Skills
60
+
61
+ 安装前,请先在 **https://gmgn.ai/ai** 创建 API Key,用于:
38
62
 
39
- ### 0. 准备工作
63
+ 1. 读取数据:代币、榜单、K 线、特色数据指标
64
+ 2. 提交交易:市价立即交易、创建限价单、策略单等
40
65
 
41
- 申请 API Key 前,需要先准备两件事:
66
+ ---
42
67
 
43
- **生成 Ed25519 密钥对**
68
+ ## 1. 安装
44
69
 
45
- 下载并运行 [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases)。申请 API Key 时需要填入**公钥**,**私钥**稍后配置到 `.env`(swap / order 接口使用)。
70
+ 选择以下任意一种方式:
46
71
 
47
- **获取本机出口 IP**(用于填写 IP 白名单)
72
+ ### 1.1 通过 Agent 安装(推荐)
73
+
74
+ 发送给你的 AI Agent:
48
75
 
49
76
  ```bash
50
- curl ip.me
77
+ npx skills add GMGNAI/gmgn-skills
78
+ ```
79
+
80
+ ### 1.2 npm 全局安装
81
+
82
+ ```bash
83
+ npm install -g gmgn-cli@1.0.2
84
+ ```
85
+
86
+ ### 1.3 本地开发
87
+
88
+ ```bash
89
+ npm install
90
+ npm run build
91
+ node dist/index.js <command> [options]
92
+ ```
93
+
94
+ ## 2. 验证连通性
95
+
96
+ ### 方式一:通过 AI Agent 验证
97
+
98
+ 发送以下提示词给你的 AI Agent:
99
+
100
+ ```
101
+ 执行这个cli命令:GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3
102
+ ```
103
+
104
+ ### 方式二:通过 CLI 验证
105
+
106
+ 使用公共 API Key 测试,无需注册:
107
+
108
+ ```bash
109
+ GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3
110
+ ```
111
+
112
+ 看到 JSON 输出即表示 CLI 正常工作。公共 Key 支持所有只读接口(token / market / portfolio),公共 Key 仅用于测试,正式使用任何接口均需申请个人 API Key(见第 3 步)。
113
+
114
+ ## 3. 申请个人 API Key
115
+
116
+ 第 2 步的公共 Key 仅用于测试。正式使用(只读接口和 swap)均需在 https://gmgn.ai/ai 申请个人 API Key,需要准备:
117
+
118
+ ### 3.1 生成 Ed25519 密钥对
119
+
120
+ **方式一:输入提示词(推荐)**
121
+
122
+ 将以下提示词发送给你的 AI Agent:
123
+
124
+ ```
125
+ 帮我用 OpenSSL 生成一个 Ed25519 密钥对,并分别显示给我:
126
+ 1. 公钥(我需要填写到GMGN网站上的 API Key 创建表单中)
127
+ 2. PEM 格式的私钥(我需要将它设置为 .env 中的 GMGN_PRIVATE_KEY)
51
128
  ```
52
129
 
53
- 或在浏览器访问 **https://ip.me**。
130
+ **方式二:Binance Key Generator**
131
+
132
+ 下载并运行 [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases)。
133
+
134
+ 申请时填入**公钥**。
135
+
136
+ ### 3.2 获取本机出口 IP
54
137
 
55
- ### 1. 获取 API Key
138
+ 用于填写 IP 白名单(开通 API Key 的交易能力时需要):
56
139
 
57
- 申请地址:**https://gmgn.ai/ai** — 填入上一步准备好的公钥和 IP 地址。
140
+ ```bash
141
+ curl ip.me
142
+ ```
58
143
 
59
- ### 2. 配置
144
+ ## 4. 配置个人 API Key
60
145
 
61
- **方式 A — 全局配置(推荐)**
146
+ ### 方式一:全局配置(推荐)
62
147
 
63
148
  创建 `~/.config/gmgn/.env`,配置一次,所有目录均生效:
64
149
 
@@ -67,12 +152,12 @@ mkdir -p ~/.config/gmgn
67
152
  cat > ~/.config/gmgn/.env << 'EOF'
68
153
  GMGN_API_KEY=your_api_key_here
69
154
 
70
- # swap / order 接口额外需要(第 0 步生成的私钥):
155
+ # swap / order 接口需要:
71
156
  GMGN_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n<base64>\n-----END PRIVATE KEY-----\n"
72
157
  EOF
73
158
  ```
74
159
 
75
- **方式 B — 项目 `.env`**
160
+ ### 方式二:项目 `.env`
76
161
 
77
162
  ```bash
78
163
  cp .env.example .env
@@ -81,21 +166,15 @@ cp .env.example .env
81
166
 
82
167
  配置加载顺序:`~/.config/gmgn/.env` → 项目 `.env`(项目级优先)。
83
168
 
84
- ### 3. CLI 安装
169
+ ## 5. AI 客户端中使用
85
170
 
86
- ```bash
87
- npm install -g gmgn-cli
88
- ```
171
+ #### OpenClaw
89
172
 
90
- 本地开发:
173
+ 直接发送以下提示词,测试查询能力:
91
174
 
92
- ```bash
93
- npm install
94
- npm run build
95
- node dist/index.js <command> [options]
96
175
  ```
97
-
98
- ### 4. 接入 AI 工具
176
+ 查询 Solana 链 1 小时热门代币
177
+ ```
99
178
 
100
179
  #### Claude Code
101
180
 
@@ -105,19 +184,17 @@ node dist/index.js <command> [options]
105
184
 
106
185
  技能通过 `.cursor-plugin/` 配置自动发现。
107
186
 
108
- 1. 完成上方步骤 1–3
109
- 2. 配置凭证:`~/.config/gmgn/.env`
110
- 3. 重启 Cursor — Agent 模式下可通过 `/gmgn-*` 命令使用技能
187
+ 1. 完成上方安装和配置步骤
188
+ 2. 重启 Cursor — Agent 模式下可通过 `/gmgn-*` 命令使用技能
111
189
 
112
190
  #### Cline
113
191
 
114
- 1. 完成上方步骤 1–3
192
+ 1. 完成上方安装和配置步骤
115
193
  2. 在 Cline 设置 → **Skills directory**:填入已安装包的 `skills/` 目录路径:
116
194
  ```bash
117
195
  echo "$(npm root -g)/gmgn-skills/skills"
118
196
  ```
119
- 3. 配置凭证:`~/.config/gmgn/.env`
120
- 4. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-swap` 即可使用
197
+ 3. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-swap` 即可使用
121
198
 
122
199
  #### Codex CLI
123
200
 
@@ -141,33 +218,50 @@ ln -s ~/.opencode/gmgn-cli/skills ~/.agents/skills/gmgn-cli
141
218
 
142
219
  ---
143
220
 
144
- ## 典型使用场景
221
+ ## 6. 使用示例
222
+
223
+ ### 常用指令
224
+
225
+ 安装技能后,向 AI 助手直接发送自然语言指令:
226
+
227
+ ```
228
+ 用 0.1 SOL 买入 <token_address>
229
+ 卖出 BSC 上 <token_address> 的 50%
230
+ 查询订单状态 <order_id>
231
+ solana 上的 <token_address> 安全吗,值得买入吗?
232
+ 查看 <token_address> 的前十大持有者
233
+ 查看我在 SOL 上的钱包持仓
234
+ 查询 0x1234... 的代币详情
235
+ 查看 BSC 上钱包 <wallet_address> 的交易统计
236
+ ```
237
+
238
+ ### 典型使用场景
145
239
 
146
240
  **研究 Token:**
147
241
  ```
148
- token infotoken securitytoken pooltoken holders
242
+ 查询代币信息查询安全指标查询流动池查询持有者
149
243
  ```
150
244
 
151
245
  **分析钱包:**
152
246
  ```
153
- portfolio holdingsportfolio statsportfolio activity
247
+ 查询钱包持仓查询交易统计查询交易记录
154
248
  ```
155
249
 
156
250
  **执行交易:**
157
251
  ```
158
- token info(确认 Token)portfolio token-balance(检查余额)swaporder get(轮询状态)
252
+ 确认代币信息检查余额提交兑换轮询订单状态
159
253
  ```
160
254
 
161
- **通过 Trending 发现交易机会:**
255
+ **通过热门榜单发现交易机会:**
162
256
  ```
163
- market trending(取 50 条,按 score 排序) → AI 多维度分析选出 top 5 → 用户确认 → token info / token securityswap
257
+ 获取热门代币(50 条) → AI 多维度分析选出 top 5 → 用户确认 → 查询代币信息 / 安全指标提交兑换
164
258
  ```
165
259
 
166
260
  ---
167
261
 
168
- ## CLI 参考
262
+ ## 7. CLI 参考
169
263
 
170
- 完整参数说明:[docs/cli-usage.md](docs/cli-usage.md)
264
+ 完整参数说明:[docs/cli-usage.md](docs/cli-usage.md)。所有命令均支持 `--raw` 输出单行 JSON(方便 `jq` 等工具处理)。
171
265
 
172
266
  ### Token
173
267
 
@@ -181,7 +275,7 @@ npx gmgn-cli token info --chain sol --address <addr>
181
275
  npx gmgn-cli market trending \
182
276
  --chain sol \
183
277
  --interval 1h \
184
- --orderby volume --limit 20 \
278
+ --order-by volume --limit 20 \
185
279
  --filter not_risk --filter not_honeypot
186
280
  ```
187
281
 
@@ -207,9 +301,7 @@ npx gmgn-cli swap \
207
301
  npx gmgn-cli order get --chain sol --order-id <order-id>
208
302
  ```
209
303
 
210
- ---
211
-
212
- ## 支持的链
304
+ ## 8. 支持的链
213
305
 
214
306
  | 接口类型 | 支持的链 | 链原生货币 |
215
307
  |----------|----------|-----------|
@@ -218,19 +310,19 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
218
310
 
219
311
  ---
220
312
 
221
- ## 输出格式
313
+ ## 9. 安全与免责
222
314
 
223
- 默认输出格式化 JSON。使用 `--raw` 输出单行 JSON(方便 jq 等工具处理):
315
+ **关于 `GMGN_PRIVATE_KEY`**
224
316
 
225
- ```bash
226
- npx gmgn-cli token info --chain sol --address <addr> --raw | jq '.price'
227
- ```
317
+ `GMGN_PRIVATE_KEY` 是用于对 GMGN OpenAPI 请求进行签名认证的**签名密钥**,不是区块链钱包私钥,不直接控制链上资产。若泄露,攻击者可以伪造经过认证的 API 请求——请立即通过 GMGN 控制台轮换密钥。
228
318
 
229
- ---
319
+ **最佳实践**
320
+
321
+ - 限制配置文件权限:`chmod 600 ~/.config/gmgn/.env`
322
+ - 不要将 `.env` 文件提交到版本控制系统,请将其加入 `.gitignore`
323
+ - 不要在日志、截图或聊天中泄露 `GMGN_API_KEY` 或 `GMGN_PRIVATE_KEY`
324
+ - 使用固定版本安装(`npm install -g gmgn-cli@1.0.2`),而非 `npx gmgn-cli`,以避免在持有凭证的环境中执行未预期的包更新
230
325
 
231
- ## 安全与免责
326
+ **免责声明**
232
327
 
233
- - 不要将 `.env` 文件或私钥提交到版本控制系统,请将其加入 `.gitignore`
234
- - 请妥善保管 `GMGN_API_KEY` 和私钥,不要在日志、截图或聊天中泄露
235
- - swap/order 使用的私钥必须与绑定该 API Key 的钱包一致
236
- - **使用本工具及根据其输出做出的任何财务决策,风险由用户自行承担。GMGN 对因凭证管理不当导致的任何交易损失、错误或未授权访问不承担责任。**
328
+ 使用本工具及根据其输出做出的任何财务决策,风险由用户自行承担。GMGN 对因凭证管理不当导致的任何交易损失、错误或未授权访问不承担责任。