diff --git a/skills/gmgn-cooking/SKILL.md b/skills/gmgn-cooking/SKILL.md index ac133fd..d22a18d 100644 --- a/skills/gmgn-cooking/SKILL.md +++ b/skills/gmgn-cooking/SKILL.md @@ -9,10 +9,10 @@ metadata: **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:** ```bash -PRIVATE_KEY=$(awk '/-----BEGIN PRIVATE KEY-----/{p=1} p{printf "%s\\n", $0} /-----END PRIVATE KEY-----/{p=0}' ~/.config/gmgn/keypair.pem) +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 -echo "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -echo "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /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 ``` diff --git a/skills/gmgn-market/SKILL.md b/skills/gmgn-market/SKILL.md index abcf4f5..442ccf4 100644 --- a/skills/gmgn-market/SKILL.md +++ b/skills/gmgn-market/SKILL.md @@ -9,10 +9,10 @@ metadata: **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:** ```bash -PRIVATE_KEY=$(awk '/-----BEGIN PRIVATE KEY-----/{p=1} p{printf "%s\\n", $0} /-----END PRIVATE KEY-----/{p=0}' ~/.config/gmgn/keypair.pem) +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 -echo "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -echo "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /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 ``` diff --git a/skills/gmgn-portfolio/SKILL.md b/skills/gmgn-portfolio/SKILL.md index a2fa8fd..921bd98 100644 --- a/skills/gmgn-portfolio/SKILL.md +++ b/skills/gmgn-portfolio/SKILL.md @@ -9,10 +9,10 @@ metadata: **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:** ```bash -PRIVATE_KEY=$(awk '/-----BEGIN PRIVATE KEY-----/{p=1} p{printf "%s\\n", $0} /-----END PRIVATE KEY-----/{p=0}' ~/.config/gmgn/keypair.pem) +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 -echo "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -echo "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /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 ``` diff --git a/skills/gmgn-swap/SKILL.md b/skills/gmgn-swap/SKILL.md index 53ebb03..6aecba6 100644 --- a/skills/gmgn-swap/SKILL.md +++ b/skills/gmgn-swap/SKILL.md @@ -9,10 +9,10 @@ metadata: **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:** ```bash -PRIVATE_KEY=$(awk '/-----BEGIN PRIVATE KEY-----/{p=1} p{printf "%s\\n", $0} /-----END PRIVATE KEY-----/{p=0}' ~/.config/gmgn/keypair.pem) +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 -echo "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -echo "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /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 ``` diff --git a/skills/gmgn-token/SKILL.md b/skills/gmgn-token/SKILL.md index 57c61f5..c08c707 100644 --- a/skills/gmgn-token/SKILL.md +++ b/skills/gmgn-token/SKILL.md @@ -9,10 +9,10 @@ metadata: **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:** ```bash -PRIVATE_KEY=$(awk '/-----BEGIN PRIVATE KEY-----/{p=1} p{printf "%s\\n", $0} /-----END PRIVATE KEY-----/{p=0}' ~/.config/gmgn/keypair.pem) +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 -echo "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -echo "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /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 ``` diff --git a/skills/gmgn-track/SKILL.md b/skills/gmgn-track/SKILL.md index 5f32903..b16f469 100644 --- a/skills/gmgn-track/SKILL.md +++ b/skills/gmgn-track/SKILL.md @@ -9,10 +9,10 @@ metadata: **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:** ```bash -PRIVATE_KEY=$(awk '/-----BEGIN PRIVATE KEY-----/{p=1} p{printf "%s\\n", $0} /-----END PRIVATE KEY-----/{p=0}' ~/.config/gmgn/keypair.pem) +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 -echo "GMGN_API_KEY=" >> /tmp/gmgn_env_tmp -echo "GMGN_PRIVATE_KEY=$PRIVATE_KEY" >> /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 ```