Manage cPanel hosting accounts via API for version 134.0.11 and compatible versions. Supports account management, DNS zones, email accounts, databases (MySQL/PostgreSQL), file operations, SSL certificates, backups, and bandwidth monitoring. Use when managing cPanel/WHM servers, creating accounts, configuring domains, managing email, or performing server administration tasks. Integrates with UAPI, WHM API, and cPanel API 2. Uses exec, read_file, write_file tools for API calls and configuration.
通过API管理cPanel托管账户(兼容版本134.0.11)。
列出账户:
bash
exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/listaccts?api.version=1 | jq .
创建邮箱账户:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Email/add_pop?email=user&password=secure123&domain=example.com | jq .
| API | 用途 | 端点前缀 |
|---|---|---|
| WHM API | 服务器管理,账户管理 | /json-api/ |
| UAPI |
创建账户:
bash
exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/createacct?api.version=1&username=newuser&domain=newdomain.com&password=secure123&plan=default | jq .
暂停/恢复:
bash
终止账户:
bash
exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/removeacct?api.version=1&user=username | jq .
列出DNS区域:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/DNS/zone_records?domain=example.com | jq .
添加DNS记录:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/DNS/addzonerecord?domain=example.com&name=www&type=A&address=192.168.1.1&ttl=3600 | jq .
列出邮箱账户:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Email/list_pops?domain=example.com | jq .
创建邮箱账户:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Email/add_pop?email=newuser&password=secure123&domain=example.com"a=250 | jq .
设置邮件转发器:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Email/add_forwarder?domain=example.com&email=user&fwdopt=fwd&fwdemail=dest@example.org | jq .
创建MySQL数据库:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Mysql/create_database?name=mydb | jq .
创建MySQL用户:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Mysql/create_user?name=myuser&password=secure123 | jq .
授予权限:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Mysql/setprivilegeson_database?user=myuser&database=mydb&privileges=ALL%20PRIVILEGES | jq .
列出SSL证书:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/SSL/list_certs | jq .
安装Lets Encrypt:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/SSL/install_ssl?domain=example.com&cert=$(cat cert.pem | jq -sR .)&key=$(cat key.pem | jq -sR .) | jq .
列出文件:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Fileman/listfiles?dir=publichtml | jq .
上传文件:
bash
exec command=curl -s -H Authorization: cpanel $CPANELTOKEN $CPANELHOST/execute/Fileman/uploadfiles?dir=publichtml&file-1=@localfile.txt | jq .
创建账户备份:
bash
exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/backupacct?api.version=1&user=username | jq .
恢复账户:
bash
exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/restoreacct?api.version=1&user=username | jq .
该技能包含辅助脚本:
使用exec工具执行脚本:
bash
exec command=bash ~/.picoclaw/workspace-default/skills/dxyz-cpanel/scripts/cpanel_api.sh listaccts
需要时使用read_file工具加载参考文件:
该技能支持:
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 dxyz-cpanel-1776117866 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 dxyz-cpanel-1776117866 技能
skillhub install dxyz-cpanel-1776117866
文件大小: 19.78 KB | 发布时间: 2026-4-14 14:42