From cc2fc0ed00957a3051205a31c63c531424a4f6ce Mon Sep 17 00:00:00 2001 From: gina888666 Date: Wed, 24 Jun 2026 19:08:27 +0800 Subject: [PATCH] fix(skills): replace python3/awk with node for .env config in all SKILL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use node -e to write GMGN_API_KEY and GMGN_PRIVATE_KEY into .env — node is guaranteed to be present since gmgn-cli requires Node.js. Also clarify that the same config step applies when the user explicitly runs gmgn-cli config and sends back an API Key. Co-Authored-By: Claude Sonnet 4.6 --- skills/gmgn-cooking/SKILL.md | 9 ++------- skills/gmgn-market/SKILL.md | 9 ++------- skills/gmgn-portfolio/SKILL.md | 9 ++------- skills/gmgn-swap/SKILL.md | 9 ++------- skills/gmgn-token/SKILL.md | 9 ++------- skills/gmgn-track/SKILL.md | 9 ++------- 6 files changed, 12 insertions(+), 42 deletions(-) diff --git a/skills/gmgn-cooking/SKILL.md b/skills/gmgn-cooking/SKILL.md index d22a18d..680f2df 100644 --- a/skills/gmgn-cooking/SKILL.md +++ b/skills/gmgn-cooking/SKILL.md @@ -6,15 +6,10 @@ metadata: cliHelp: "gmgn-cli cooking --help" --- -**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following commands, then proceed:** +**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following command, then proceed. Also apply this same configuration step whenever the user explicitly runs `gmgn-cli config` and sends back an API Key.** ```bash -PRIVATE_KEY=$(python3 -c "import re; c=open('$HOME/.config/gmgn/keypair.pem').read(); m=re.search(r'(-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)', c, re.DOTALL); print(m.group(1).replace('\n', '\\\\n') if m else '', end='')") -grep -v "^GMGN_API_KEY=\|^GMGN_PRIVATE_KEY=" ~/.config/gmgn/.env 2>/dev/null > /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /tmp/gmgn_env_tmp -mv /tmp/gmgn_env_tmp ~/.config/gmgn/.env -chmod 600 ~/.config/gmgn/.env +node -e "const fs=require('fs'),os=require('os');const envPath=os.homedir()+'/.config/gmgn/.env';const pemPath=os.homedir()+'/.config/gmgn/keypair.pem';const pem=fs.readFileSync(pemPath,'utf8');const m=pem.match(/(-----BEGIN PRIVATE KEY-----[\s\S]+?-----END PRIVATE KEY-----)/);const pk=m?m[1].replace(/\r?\n/g,'\\\\n'):'';let env=fs.existsSync(envPath)?fs.readFileSync(envPath,'utf8'):'';env=env.split('\n').filter(function(l){return!/^GMGN_API_KEY=|^GMGN_PRIVATE_KEY=/.test(l)}).join('\n').trim();const content=(env?env+'\n':'')+'GMGN_API_KEY=\n'+'GMGN_PRIVATE_KEY='+pk+'\n';fs.writeFileSync(envPath,content,{mode:0o600});" ``` **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai — all token creation operations must go through the CLI. The CLI handles signing and submission automatically.** diff --git a/skills/gmgn-market/SKILL.md b/skills/gmgn-market/SKILL.md index 442ccf4..64a68c4 100644 --- a/skills/gmgn-market/SKILL.md +++ b/skills/gmgn-market/SKILL.md @@ -6,15 +6,10 @@ metadata: cliHelp: "gmgn-cli market --help" --- -**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following commands, then proceed:** +**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following command, then proceed. Also apply this same configuration step whenever the user explicitly runs `gmgn-cli config` and sends back an API Key.** ```bash -PRIVATE_KEY=$(python3 -c "import re; c=open('$HOME/.config/gmgn/keypair.pem').read(); m=re.search(r'(-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)', c, re.DOTALL); print(m.group(1).replace('\n', '\\\\n') if m else '', end='')") -grep -v "^GMGN_API_KEY=\|^GMGN_PRIVATE_KEY=" ~/.config/gmgn/.env 2>/dev/null > /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /tmp/gmgn_env_tmp -mv /tmp/gmgn_env_tmp ~/.config/gmgn/.env -chmod 600 ~/.config/gmgn/.env +node -e "const fs=require('fs'),os=require('os');const envPath=os.homedir()+'/.config/gmgn/.env';const pemPath=os.homedir()+'/.config/gmgn/keypair.pem';const pem=fs.readFileSync(pemPath,'utf8');const m=pem.match(/(-----BEGIN PRIVATE KEY-----[\s\S]+?-----END PRIVATE KEY-----)/);const pk=m?m[1].replace(/\r?\n/g,'\\\\n'):'';let env=fs.existsSync(envPath)?fs.readFileSync(envPath,'utf8'):'';env=env.split('\n').filter(function(l){return!/^GMGN_API_KEY=|^GMGN_PRIVATE_KEY=/.test(l)}).join('\n').trim();const content=(env?env+'\n':'')+'GMGN_API_KEY=\n'+'GMGN_PRIVATE_KEY='+pk+'\n';fs.writeFileSync(envPath,content,{mode:0o600});" ``` **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai to fetch this data — the website requires login and will not return structured data. The CLI is the only correct method.** diff --git a/skills/gmgn-portfolio/SKILL.md b/skills/gmgn-portfolio/SKILL.md index 921bd98..b103600 100644 --- a/skills/gmgn-portfolio/SKILL.md +++ b/skills/gmgn-portfolio/SKILL.md @@ -6,15 +6,10 @@ metadata: cliHelp: "gmgn-cli portfolio --help" --- -**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following commands, then proceed:** +**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following command, then proceed. Also apply this same configuration step whenever the user explicitly runs `gmgn-cli config` and sends back an API Key.** ```bash -PRIVATE_KEY=$(python3 -c "import re; c=open('$HOME/.config/gmgn/keypair.pem').read(); m=re.search(r'(-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)', c, re.DOTALL); print(m.group(1).replace('\n', '\\\\n') if m else '', end='')") -grep -v "^GMGN_API_KEY=\|^GMGN_PRIVATE_KEY=" ~/.config/gmgn/.env 2>/dev/null > /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /tmp/gmgn_env_tmp -mv /tmp/gmgn_env_tmp ~/.config/gmgn/.env -chmod 600 ~/.config/gmgn/.env +node -e "const fs=require('fs'),os=require('os');const envPath=os.homedir()+'/.config/gmgn/.env';const pemPath=os.homedir()+'/.config/gmgn/keypair.pem';const pem=fs.readFileSync(pemPath,'utf8');const m=pem.match(/(-----BEGIN PRIVATE KEY-----[\s\S]+?-----END PRIVATE KEY-----)/);const pk=m?m[1].replace(/\r?\n/g,'\\\\n'):'';let env=fs.existsSync(envPath)?fs.readFileSync(envPath,'utf8'):'';env=env.split('\n').filter(function(l){return!/^GMGN_API_KEY=|^GMGN_PRIVATE_KEY=/.test(l)}).join('\n').trim();const content=(env?env+'\n':'')+'GMGN_API_KEY=\n'+'GMGN_PRIVATE_KEY='+pk+'\n';fs.writeFileSync(envPath,content,{mode:0o600});" ``` **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai to fetch this data — the website requires login and will not return structured data. The CLI is the only correct method.** diff --git a/skills/gmgn-swap/SKILL.md b/skills/gmgn-swap/SKILL.md index 6aecba6..8c08c32 100644 --- a/skills/gmgn-swap/SKILL.md +++ b/skills/gmgn-swap/SKILL.md @@ -6,15 +6,10 @@ metadata: cliHelp: "gmgn-cli swap --help" --- -**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following commands, then proceed:** +**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following command, then proceed. Also apply this same configuration step whenever the user explicitly runs `gmgn-cli config` and sends back an API Key.** ```bash -PRIVATE_KEY=$(python3 -c "import re; c=open('$HOME/.config/gmgn/keypair.pem').read(); m=re.search(r'(-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)', c, re.DOTALL); print(m.group(1).replace('\n', '\\\\n') if m else '', end='')") -grep -v "^GMGN_API_KEY=\|^GMGN_PRIVATE_KEY=" ~/.config/gmgn/.env 2>/dev/null > /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /tmp/gmgn_env_tmp -mv /tmp/gmgn_env_tmp ~/.config/gmgn/.env -chmod 600 ~/.config/gmgn/.env +node -e "const fs=require('fs'),os=require('os');const envPath=os.homedir()+'/.config/gmgn/.env';const pemPath=os.homedir()+'/.config/gmgn/keypair.pem';const pem=fs.readFileSync(pemPath,'utf8');const m=pem.match(/(-----BEGIN PRIVATE KEY-----[\s\S]+?-----END PRIVATE KEY-----)/);const pk=m?m[1].replace(/\r?\n/g,'\\\\n'):'';let env=fs.existsSync(envPath)?fs.readFileSync(envPath,'utf8'):'';env=env.split('\n').filter(function(l){return!/^GMGN_API_KEY=|^GMGN_PRIVATE_KEY=/.test(l)}).join('\n').trim();const content=(env?env+'\n':'')+'GMGN_API_KEY=\n'+'GMGN_PRIVATE_KEY='+pk+'\n';fs.writeFileSync(envPath,content,{mode:0o600});" ``` **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai — all swap operations must go through the CLI. The CLI handles signing and submission automatically.** diff --git a/skills/gmgn-token/SKILL.md b/skills/gmgn-token/SKILL.md index c08c707..2c633ad 100644 --- a/skills/gmgn-token/SKILL.md +++ b/skills/gmgn-token/SKILL.md @@ -6,15 +6,10 @@ metadata: cliHelp: "gmgn-cli token --help" --- -**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following commands, then proceed:** +**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following command, then proceed. Also apply this same configuration step whenever the user explicitly runs `gmgn-cli config` and sends back an API Key.** ```bash -PRIVATE_KEY=$(python3 -c "import re; c=open('$HOME/.config/gmgn/keypair.pem').read(); m=re.search(r'(-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)', c, re.DOTALL); print(m.group(1).replace('\n', '\\\\n') if m else '', end='')") -grep -v "^GMGN_API_KEY=\|^GMGN_PRIVATE_KEY=" ~/.config/gmgn/.env 2>/dev/null > /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /tmp/gmgn_env_tmp -mv /tmp/gmgn_env_tmp ~/.config/gmgn/.env -chmod 600 ~/.config/gmgn/.env +node -e "const fs=require('fs'),os=require('os');const envPath=os.homedir()+'/.config/gmgn/.env';const pemPath=os.homedir()+'/.config/gmgn/keypair.pem';const pem=fs.readFileSync(pemPath,'utf8');const m=pem.match(/(-----BEGIN PRIVATE KEY-----[\s\S]+?-----END PRIVATE KEY-----)/);const pk=m?m[1].replace(/\r?\n/g,'\\\\n'):'';let env=fs.existsSync(envPath)?fs.readFileSync(envPath,'utf8'):'';env=env.split('\n').filter(function(l){return!/^GMGN_API_KEY=|^GMGN_PRIVATE_KEY=/.test(l)}).join('\n').trim();const content=(env?env+'\n':'')+'GMGN_API_KEY=\n'+'GMGN_PRIVATE_KEY='+pk+'\n';fs.writeFileSync(envPath,content,{mode:0o600});" ``` **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai to fetch this data — the website requires login and will not return structured data. The CLI is the only correct method.** diff --git a/skills/gmgn-track/SKILL.md b/skills/gmgn-track/SKILL.md index b16f469..065ad74 100644 --- a/skills/gmgn-track/SKILL.md +++ b/skills/gmgn-track/SKILL.md @@ -6,15 +6,10 @@ metadata: cliHelp: "gmgn-cli track --help" --- -**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following commands, then proceed:** +**BEFORE RUNNING ANY COMMAND: Check whether `GMGN_API_KEY` exists in `/.env` or `~/.config/gmgn/.env`. If found in either location, proceed normally. If not found in either location, stop and run `gmgn-cli config` first — this generates an Ed25519 key pair and outputs a pre-filled link. Show the link to the user and ask them to create their API Key. Once the user sends back the API Key, write `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` together into `~/.config/gmgn/.env` using the following command, then proceed. Also apply this same configuration step whenever the user explicitly runs `gmgn-cli config` and sends back an API Key.** ```bash -PRIVATE_KEY=$(python3 -c "import re; c=open('$HOME/.config/gmgn/keypair.pem').read(); m=re.search(r'(-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)', c, re.DOTALL); print(m.group(1).replace('\n', '\\\\n') if m else '', end='')") -grep -v "^GMGN_API_KEY=\|^GMGN_PRIVATE_KEY=" ~/.config/gmgn/.env 2>/dev/null > /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -printf '%s\n' "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /tmp/gmgn_env_tmp -mv /tmp/gmgn_env_tmp ~/.config/gmgn/.env -chmod 600 ~/.config/gmgn/.env +node -e "const fs=require('fs'),os=require('os');const envPath=os.homedir()+'/.config/gmgn/.env';const pemPath=os.homedir()+'/.config/gmgn/keypair.pem';const pem=fs.readFileSync(pemPath,'utf8');const m=pem.match(/(-----BEGIN PRIVATE KEY-----[\s\S]+?-----END PRIVATE KEY-----)/);const pk=m?m[1].replace(/\r?\n/g,'\\\\n'):'';let env=fs.existsSync(envPath)?fs.readFileSync(envPath,'utf8'):'';env=env.split('\n').filter(function(l){return!/^GMGN_API_KEY=|^GMGN_PRIVATE_KEY=/.test(l)}).join('\n').trim();const content=(env?env+'\n':'')+'GMGN_API_KEY=\n'+'GMGN_PRIVATE_KEY='+pk+'\n';fs.writeFileSync(envPath,content,{mode:0o600});" ``` **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai to fetch this data — the website requires login and will not return structured data. The CLI is the only correct method.**