diff --git a/Readme.md b/Readme.md index 7718ac8..d6623ec 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,16 @@ -# gmgn-cli +
-> 中文文档:[Readme.zh.md](Readme.zh.md) +GMGN Agent Skills -GMGN AI skills for on-chain operations — token research, market data, wallet analysis, and swap. +[![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) + +English | [简体中文](Readme.zh.md) + +
+ +## GMGN Agent Skills + +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. --- @@ -15,50 +23,127 @@ GMGN AI skills for on-chain operations — token research, market data, wallet a | [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | Wallet holdings, activity, stats | [SKILL.md](skills/gmgn-portfolio/SKILL.md) | | [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | Swap submission + order query | [SKILL.md](skills/gmgn-swap/SKILL.md) | ---- +> For detailed CLI commands, parameters, and recommended values, see the [Wiki documentation](https://github.com/GMGNAI/gmgn-skills/wiki). -## Usage Examples +### Quick Start -Natural language prompts you can send to any AI assistant with gmgn-cli skills installed: - -``` -buy 0.1 SOL of -sell 50% of on BSC -check order status -is safe to buy on solana? -show top holders of -show my wallet holdings on SOL -query token details for 0x1234... -show trading stats for wallet on BSC -``` +Ready to install skills? [Jump to Installation →](#get-started) --- -## Setup +## Demo Cases -### 0. Prepare +### Trending Token Rankings -Before applying for an API Key, get two things ready: +Send this prompt to your AI Agent: -**Generate an Ed25519 key pair** +``` +Fetch Solana 1h trending, filter for pump.fun tokens created within 6h, sort by volume descending. +``` -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). +![Trending Token Rankings](static/market-rank-1h-Pumpfun-en.png) -**Get your public egress IP** (for the IP whitelist) +### Real-Time Token Trading Analysis + +Send this prompt to your AI Agent: + +``` +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. +``` + +![Token Analysis 1](static/market-tokenanalysis-en01.png) +![Token Analysis 2](static/market-tokenanalysis-en02.png) + +--- + +## Get Started + +Before installing, create your API Key at **https://gmgn.ai/ai**. The API key is used for: + +1. Read data: tokens, trending lists, K-line, and featured on-chain metrics +2. Submit trades: market orders, limit orders, strategy orders, and more + +--- + +## 1. Installation + +Choose one of the following methods: + +### 1.1 Via Agent (recommended) + +Send this to your AI agent: + +```bash +npx skills add GMGNAI/gmgn-skills +``` + +### 1.2 npm Global Install + +```bash +npm install -g gmgn-cli@1.0.1 +``` + +### 1.3 Local Development + +```bash +npm install +npm run build +node dist/index.js [options] +``` + +## 2. Verify Connection + +### Option 1: Via AI Agent + +Send this prompt to your AI Agent: + +``` +Run this CLI command: GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3 +``` + +### Option 2: Via CLI + +Test with the public API key — no registration required: + +```bash +GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3 +``` + +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). + +## 3. Get Your Own API Key + +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: + +### 3.1 Generate an Ed25519 Key Pair + +**Option 1 — Ask your AI agent (recommended)** + +Send this prompt to your agent: + +``` +Generate an Ed25519 key pair for me using OpenSSL and show me: +1. The public key (I need to fill it in the GMGN API Key application form) +2. The private key in PEM format (I need to set it as GMGN_PRIVATE_KEY in my .env) +``` + +**Option 2 — Binance Key Generator** + +Download and run the [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases). + +Enter the **public key** in the application form. + +### 3.2 Get Your Public Egress IP + +For the IP whitelist (required when enabling swap capability on your API key): ```bash curl ip.me ``` -Or visit **https://ip.me** in your browser. +## 4. Configure Your API Key -### 1. Get an API Key - -Apply at **https://gmgn.ai/ai** — enter the public key and your IP address from the step above. - -### 2. Configure - -**Option A — Global config (recommended)** +### Option 1: Global config (recommended) Create `~/.config/gmgn/.env` once — works from any directory: @@ -67,12 +152,12 @@ mkdir -p ~/.config/gmgn cat > ~/.config/gmgn/.env << 'EOF' GMGN_API_KEY=your_api_key_here -# Required for swap / order (private key from step 0): +# Required for swap / order only: GMGN_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n\n-----END PRIVATE KEY-----\n" EOF ``` -**Option B — Project `.env`** +### Option 2: Project `.env` ```bash cp .env.example .env @@ -81,24 +166,16 @@ cp .env.example .env Config lookup order: `~/.config/gmgn/.env` → project `.env` (project takes precedence). -### 3. CLI Install +## 5. Try in AI Clients -Install a pinned version to avoid pulling untrusted updates at runtime: +#### OpenClaw + +Send the following prompt directly to test the query capabilities: -```bash -npm install -g gmgn-cli@1.0.1 ``` - -Local development: - -```bash -npm install -npm run build -node dist/index.js [options] +Show me the trending tokens on Solana in the last 1 hour. ``` -### 4. Connect to Your AI Tool - #### Claude Code Skills are automatically discovered when the package is installed as a plugin. @@ -107,19 +184,17 @@ Skills are automatically discovered when the package is installed as a plugin. Skills are automatically discovered via the `.cursor-plugin/` configuration. -1. Complete steps 1–3 above -2. Configure credentials in `~/.config/gmgn/.env` -3. Restart Cursor — skills will be available in Agent mode via `/gmgn-*` commands +1. Complete the installation and configuration steps above +2. Restart Cursor — skills will be available in Agent mode via `/gmgn-*` commands #### Cline -1. Complete steps 1–3 above +1. Complete the installation and configuration steps above 2. In Cline settings → **Skills directory**: point to the installed package's `skills/` folder: ```bash echo "$(npm root -g)/gmgn-skills/skills" ``` -3. Configure credentials in `~/.config/gmgn/.env` -4. Restart Cline — `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-swap` will be available +3. Restart Cline — `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-swap` will be available #### Codex CLI @@ -143,7 +218,24 @@ See [.opencode/INSTALL.md](.opencode/INSTALL.md) for full instructions. --- -## Typical Workflows +## 6. Usage + +### Examples + +Natural language prompts you can send to any AI assistant with gmgn-cli skills installed: + +``` +buy 0.1 SOL of +sell 50% of on BSC +check order status +is safe to buy on solana? +show top holders of +show my wallet holdings on SOL +query token details for 0x1234... +show trading stats for wallet on BSC +``` + +### Typical Workflows **Research a token:** ``` @@ -167,9 +259,9 @@ market trending (top 50) → AI selects top 5 by multi-factor analysis → u --- -## CLI Reference +## 7. CLI Reference -Full parameter reference: [docs/cli-usage.md](docs/cli-usage.md) +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'`). ### Token @@ -209,9 +301,7 @@ npx gmgn-cli swap \ npx gmgn-cli order get --chain sol --order-id ``` ---- - -## Supported Chains +## 8. Supported Chains | Commands | Chains | Chain Currencies | |----------|--------|-----------------| @@ -220,17 +310,7 @@ npx gmgn-cli order get --chain sol --order-id --- -## Output Format - -Default: formatted JSON. Use `--raw` for single-line JSON (pipe-friendly): - -```bash -npx gmgn-cli token info --chain sol --address --raw | jq '.price' -``` - ---- - -## Security & Disclaimer +## 9. Security & Disclaimer **About `GMGN_PRIVATE_KEY`** diff --git a/Readme.zh.md b/Readme.zh.md index 2f48990..18ad684 100644 --- a/Readme.zh.md +++ b/Readme.zh.md @@ -1,8 +1,16 @@ -# gmgn-cli +
-> English: [Readme.md](Readme.md) +GMGN Agent Skills -GMGN 链上操作 AI 技能套件 — Token 研究、行情数据、钱包分析和交易。 +[![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) + +[English](Readme.md) | 简体中文 + +
+ +## GMGN Agent Skills + +使用 GMGN Agent Skills,你可以通过 AI Agent 实时查询多个链上热门代币排行榜,代币基础信息,社交媒体信息,实时交易动态,实时战壕新币,报持仓大户(Top Holder),交易大户(Top Trader),聪明钱持仓占比,KOL持仓占比,老鼠仓持仓,捆绑持仓占比,等代币专业数据分析数据,以及支持代币市价单交易、限价单交易、高级止盈止损策略单交易,以及钱包资产管理相关功能,例如查询钱包实时持仓、钱包最近盈亏、钱包交易动态等,全部通过自然语言与 AI Agent 交互即可完成。 --- @@ -15,50 +23,127 @@ GMGN 链上操作 AI 技能套件 — Token 研究、行情数据、钱包分析 | [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | 钱包持仓、活动、统计 | [SKILL.md](skills/gmgn-portfolio/SKILL.md) | | [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | 兑换提交 + 订单查询 | [SKILL.md](skills/gmgn-swap/SKILL.md) | ---- +> 如需查看详细的 CLI 接口说明、传参格式和推荐值,请参阅 [Wiki 文档](https://github.com/GMGNAI/gmgn-skills/wiki/Home-Chinese)。 -## 用法示例 +### 快速开始安装 -安装技能后,向 AI 助手直接发送自然语言指令: - -``` -buy 0.1 SOL of -sell 50% of on BSC -check order status -is safe to buy on solana? -show top holders of -show my wallet holdings on SOL -query token details for 0x1234... -show trading stats for wallet on BSC -``` +已准备好?[点击这里开始安装 Skills →](#开始安装-skills) --- -## 安装配置 +## 使用案例 -### 0. 准备工作 +### 查询热门代币榜 -申请 API Key 前,需要先准备两件事: +发送下面提示词给 AI Agent: -**生成 Ed25519 密钥对** +``` +查 Solana 1h 热门榜,筛出 6 小时内创建的新币,并且platforms是pump.fun的代币,然后按交易量从高到低排列。 +``` -下载并运行 [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases)。申请 API Key 时需要填入**公钥**,**私钥**稍后配置到 `.env`(swap / order 接口使用)。 +![查询热门代币榜](static/market-rank-1h-Pumpfun-cn.png) -**获取本机出口 IP**(用于填写 IP 白名单) +### 实时分析代币交易走势 + +发送下面提示词给 AI Agent: + +``` +查看第一个代币的 K 线,分析入场时机,并提供社交媒体链接以及聪明资金 / KOL 的交易分析。 +``` + +![代币分析 1](static/market-tokenanalysis-cn01.png) +![代币分析 2](static/market-tokenanalysis-cn02.png) + +--- + +## 开始安装 Skills + +安装前,请先在 **https://gmgn.ai/ai** 创建 API Key,用于: + +1. 读取数据:代币、榜单、K 线、特色数据指标 +2. 提交交易:市价立即交易、创建限价单、策略单等 + +--- + +## 1. 安装 + +选择以下任意一种方式: + +### 1.1 通过 Agent 安装(推荐) + +发送给你的 AI Agent: + +```bash +npx skills add GMGNAI/gmgn-skills +``` + +### 1.2 npm 全局安装 + +```bash +npm install -g gmgn-cli@1.0.1 +``` + +### 1.3 本地开发 + +```bash +npm install +npm run build +node dist/index.js [options] +``` + +## 2. 验证连通性 + +### 方式一:通过 AI Agent 验证 + +发送以下提示词给你的 AI Agent: + +``` +执行这个cli命令:GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3 +``` + +### 方式二:通过 CLI 验证 + +使用公共 API Key 测试,无需注册: + +```bash +GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3 +``` + +看到 JSON 输出即表示 CLI 正常工作。公共 Key 支持所有只读接口(token / market / portfolio),公共 Key 仅用于测试,正式使用任何接口均需申请个人 API Key(见第 3 步)。 + +## 3. 申请个人 API Key + +第 2 步的公共 Key 仅用于测试。正式使用(只读接口和 swap)均需在 https://gmgn.ai/ai 申请个人 API Key,需要准备: + +### 3.1 生成 Ed25519 密钥对 + +**方式一:输入提示词(推荐)** + +将以下提示词发送给你的 AI Agent: + +``` +帮我用 OpenSSL 生成一个 Ed25519 密钥对,并分别显示给我: +1. 公钥(我需要填写到GMGN网站上的 API Key 创建表单中) +2. PEM 格式的私钥(我需要将它设置为 .env 中的 GMGN_PRIVATE_KEY) +``` + +**方式二:Binance Key Generator** + +下载并运行 [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases)。 + +申请时填入**公钥**。 + +### 3.2 获取本机出口 IP + +用于填写 IP 白名单(开通 API Key 的交易能力时需要): ```bash curl ip.me ``` -或在浏览器访问 **https://ip.me**。 +## 4. 配置个人 API Key -### 1. 获取 API Key - -申请地址:**https://gmgn.ai/ai** — 填入上一步准备好的公钥和 IP 地址。 - -### 2. 配置 - -**方式 A — 全局配置(推荐)** +### 方式一:全局配置(推荐) 创建 `~/.config/gmgn/.env`,配置一次,所有目录均生效: @@ -67,12 +152,12 @@ mkdir -p ~/.config/gmgn cat > ~/.config/gmgn/.env << 'EOF' GMGN_API_KEY=your_api_key_here -# swap / order 接口额外需要(第 0 步生成的私钥): +# 仅 swap / order 接口需要: GMGN_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n\n-----END PRIVATE KEY-----\n" EOF ``` -**方式 B — 项目 `.env`** +### 方式二:项目 `.env` ```bash cp .env.example .env @@ -81,24 +166,16 @@ cp .env.example .env 配置加载顺序:`~/.config/gmgn/.env` → 项目 `.env`(项目级优先)。 -### 3. CLI 安装 +## 5. 在 AI 客户端中使用 -安装固定版本,避免运行时拉取未经验证的更新: +#### OpenClaw + +直接发送以下提示词,测试查询能力: -```bash -npm install -g gmgn-cli@1.0.1 ``` - -本地开发: - -```bash -npm install -npm run build -node dist/index.js [options] +查询 Solana 链 1 小时热门代币 ``` -### 4. 接入 AI 工具 - #### Claude Code 安装包后通过插件机制自动发现技能。 @@ -107,19 +184,17 @@ node dist/index.js [options] 技能通过 `.cursor-plugin/` 配置自动发现。 -1. 完成上方步骤 1–3 -2. 配置凭证:`~/.config/gmgn/.env` -3. 重启 Cursor — Agent 模式下可通过 `/gmgn-*` 命令使用技能 +1. 完成上方安装和配置步骤 +2. 重启 Cursor — Agent 模式下可通过 `/gmgn-*` 命令使用技能 #### Cline -1. 完成上方步骤 1–3 +1. 完成上方安装和配置步骤 2. 在 Cline 设置 → **Skills directory**:填入已安装包的 `skills/` 目录路径: ```bash echo "$(npm root -g)/gmgn-skills/skills" ``` -3. 配置凭证:`~/.config/gmgn/.env` -4. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-swap` 即可使用 +3. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-swap` 即可使用 #### Codex CLI @@ -143,33 +218,50 @@ ln -s ~/.opencode/gmgn-cli/skills ~/.agents/skills/gmgn-cli --- -## 典型使用场景 +## 6. 使用示例 + +### 常用指令 + +安装技能后,向 AI 助手直接发送自然语言指令: + +``` +用 0.1 SOL 买入 +卖出 BSC 上 的 50% +查询订单状态 +solana 上的 安全吗,值得买入吗? +查看 的前十大持有者 +查看我在 SOL 上的钱包持仓 +查询 0x1234... 的代币详情 +查看 BSC 上钱包 的交易统计 +``` + +### 典型使用场景 **研究 Token:** ``` -token info → token security → token pool → token holders +查询代币信息 → 查询安全指标 → 查询流动池 → 查询持有者 ``` **分析钱包:** ``` -portfolio holdings → portfolio stats → portfolio activity +查询钱包持仓 → 查询交易统计 → 查询交易记录 ``` **执行交易:** ``` -token info(确认 Token) → portfolio token-balance(检查余额) → swap → order get(轮询状态) +确认代币信息 → 检查余额 → 提交兑换 → 轮询订单状态 ``` -**通过 Trending 发现交易机会:** +**通过热门榜单发现交易机会:** ``` -market trending(取 50 条) → AI 多维度分析选出 top 5 → 用户确认 → token info / token security → swap +获取热门代币(50 条) → AI 多维度分析选出 top 5 → 用户确认 → 查询代币信息 / 安全指标 → 提交兑换 ``` --- -## CLI 参考 +## 7. CLI 参考 -完整参数说明:[docs/cli-usage.md](docs/cli-usage.md) +完整参数说明:[docs/cli-usage.md](docs/cli-usage.md)。所有命令均支持 `--raw` 输出单行 JSON(方便 `jq` 等工具处理)。 ### Token @@ -209,9 +301,7 @@ npx gmgn-cli swap \ npx gmgn-cli order get --chain sol --order-id ``` ---- - -## 支持的链 +## 8. 支持的链 | 接口类型 | 支持的链 | 链原生货币 | |----------|----------|-----------| @@ -220,17 +310,7 @@ npx gmgn-cli order get --chain sol --order-id --- -## 输出格式 - -默认输出格式化 JSON。使用 `--raw` 输出单行 JSON(方便 jq 等工具处理): - -```bash -npx gmgn-cli token info --chain sol --address --raw | jq '.price' -``` - ---- - -## 安全与免责 +## 9. 安全与免责 **关于 `GMGN_PRIVATE_KEY`** diff --git a/static/gmgnagentskills.png b/static/gmgnagentskills.png new file mode 100644 index 0000000..121cbff Binary files /dev/null and b/static/gmgnagentskills.png differ diff --git a/static/market-rank-1h-Pumpfun-cn.png b/static/market-rank-1h-Pumpfun-cn.png new file mode 100644 index 0000000..c180c6c Binary files /dev/null and b/static/market-rank-1h-Pumpfun-cn.png differ diff --git a/static/market-rank-1h-Pumpfun-en.png b/static/market-rank-1h-Pumpfun-en.png new file mode 100644 index 0000000..a92ad95 Binary files /dev/null and b/static/market-rank-1h-Pumpfun-en.png differ diff --git a/static/market-tokenanalysis-cn01.png b/static/market-tokenanalysis-cn01.png new file mode 100644 index 0000000..42836a8 Binary files /dev/null and b/static/market-tokenanalysis-cn01.png differ diff --git a/static/market-tokenanalysis-cn02.png b/static/market-tokenanalysis-cn02.png new file mode 100644 index 0000000..ef4b94a Binary files /dev/null and b/static/market-tokenanalysis-cn02.png differ diff --git a/static/market-tokenanalysis-en01.png b/static/market-tokenanalysis-en01.png new file mode 100644 index 0000000..d687628 Binary files /dev/null and b/static/market-tokenanalysis-en01.png differ diff --git a/static/market-tokenanalysis-en02.png b/static/market-tokenanalysis-en02.png new file mode 100644 index 0000000..95f4afe Binary files /dev/null and b/static/market-tokenanalysis-en02.png differ