cloudflare-dns
17
总安装量
14
周安装量
#20475
全站排名
安装命令
npx skills add https://github.com/jackiexiao/jackie-skills-starter --skill cloudflare-dns
Agent 安装分布
openclaw
14
gemini-cli
14
github-copilot
14
codex
14
kimi-cli
14
cursor
14
Skill 文档
Cloudflare DNS
Quick Start
- Clarify target:
- domain/host (
skills.01mvp.com) - record type (
A/AAAA/CNAME/TXT) - target value
- proxied on/off
- domain/host (
- Run an auth precheck before any write action.
- Execute idempotent change (query existing record first, then create/update).
- Verify with DNS lookup + HTTP check + (if needed) Pages domain status.
First-Use Auth Gate (Required)
Before first DNS write, check token:
zsh -lic 'echo ${CLOUDFLARE_API_TOKEN:+SET}'
If empty, stop and prompt user to configure token first.
Use this prompt style:
- æå å¸®ä½ é ç½®ï¼ä½éè¦ä½ å æä¾ Cloudflare API Tokenï¼ä¸æ¯ wrangler OAuthï¼ã
- Token æå°æéï¼
Zone -> DNS -> EditZone -> Zone -> Read- å¦æè¦æ¥ Pages ååç¶æï¼åå ï¼
Account -> Cloudflare Pages -> Edit
- Zone Resources åªéç®æ ååï¼æå°æéååï¼ã
- é ç½®å®æåæ§è¡ï¼
export CLOUDFLARE_API_TOKEN='YOUR_TOKEN'
Optional persistent setup:
echo "export CLOUDFLARE_API_TOKEN='YOUR_TOKEN'" >> ~/.zshrc
source ~/.zshrc
Standard Execution Pattern
1) Read current DNS record
python - <<'PY'
import json, os, urllib.request
token = os.environ['CLOUDFLARE_API_TOKEN']
zone_id = '<ZONE_ID>'
name = 'skills.01mvp.com'
url = f'https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records?name={name}'
req = urllib.request.Request(url, headers={'Authorization': f'Bearer {token}'})
print(json.dumps(json.load(urllib.request.urlopen(req)), ensure_ascii=False, indent=2))
PY
2) Create/Update record
- If record not found: create.
- If record exists but value/proxy mismatch: update.
- If already correct: report “no-op”.
3) Pages custom domain binding (if required)
- Ensure domain is added to the Pages project.
- If not added, create binding first, then ensure DNS points to
<project>.pages.dev.
4) Verification
dig +short CNAME skills.01mvp.com
dig +short skills.01mvp.com
curl -I https://skills.01mvp.com
For Pages validation, also check domain status via Pages API/wrangler.
Safety Rules
- Always query before write (no blind overwrite).
- Prefer least-privilege token scope.
- Never print full token in output.
- Report exact record changed: name, type, content, proxied, timestamp.
- If API returns auth error, explicitly tell user missing scope instead of retrying blindly.