返回顶部
d

dxyz-cpanelcPanel主机管理

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
89
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

dxyz-cpanel

dxyz-cPanel 技能

通过API管理cPanel托管账户(兼容版本134.0.11)。

快速开始

连接cPanel API

bash

使用API令牌(推荐)

export CPANEL_HOST=https://your-server.com:2087 export CPANEL_TOKEN=your-api-token

测试连接

exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/version | jq .

常用操作

列出账户:
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类型

API用途端点前缀
WHM API服务器管理,账户管理/json-api/
UAPI
cPanel用户操作 | /execute/ | | cPanel API 2 | 旧版(已弃用) | /json-api/cpanel2 |

身份验证

API令牌(推荐)

  1. 1. 在WHM → 开发 → 管理API令牌中生成
  2. 使用标头:Authorization: whm (WHM)或 Authorization: cpanel (UAPI)

基本认证(安全性较低)

bash curl -u username:password https://server:2087/json-api/...

核心操作

账户管理(WHM API)

创建账户:
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

暂停


exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/suspendacct?api.version=1&user=username&reason=non-payment | jq .

恢复

exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/unsuspendacct?api.version=1&user=username | jq .

终止账户:
bash
exec command=curl -s -H Authorization: whm $CPANELTOKEN $CPANELHOST/json-api/removeacct?api.version=1&user=username | jq .

DNS管理(UAPI)

列出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 .

邮箱管理(UAPI)

列出邮箱账户:
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 .

数据库管理(UAPI)

创建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证书(UAPI)

列出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 .

文件操作(UAPI)

列出文件:
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 .

备份操作(WHM API)

创建账户备份:
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 .

脚本

该技能包含辅助脚本:

  • - scripts/cpanelapi.sh - 通用API调用器,带错误处理
  • scripts/createaccount.sh - 创建托管账户
  • scripts/managedns.sh - DNS区域管理
  • scripts/manageemail.sh - 邮箱账户操作
  • scripts/managedatabase.sh - MySQL/PostgreSQL操作
  • scripts/backupaccount.sh - 备份/恢复操作

使用exec工具执行脚本:
bash
exec command=bash ~/.picoclaw/workspace-default/skills/dxyz-cpanel/scripts/cpanel_api.sh listaccts

参考资料

需要时使用read_file工具加载参考文件:

配置

环境变量

bash CPANEL_HOST=https://your-server.com:2087 # WHM端口 CPANEL_TOKEN=your-api-token # API令牌 CPANEL_USER=root # WHM用户名

配置文件

创建~/.cpanel/config.json: json { host: https://your-server.com:2087, token: your-api-token, default_plan: default, default_quota: 1000, default_bwlimit: 10000 }

版本兼容性

该技能支持:

  • -

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 dxyz-cpanel-1776117866 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 dxyz-cpanel-1776117866 技能

通过命令行安装

skillhub install dxyz-cpanel-1776117866

下载

⬇ 下载 dxyz-cpanel v1.0.0(免费)

文件大小: 19.78 KB | 发布时间: 2026-4-14 14:42

v1.0.0 最新 2026-4-14 14:42
dxyz-cpanel 1.0.0

- Initial release of the dxyz-cpanel skill for managing cPanel/WHM servers via API (version 134.0.11+ compatible)
- Provides command, script, and reference examples for account management, DNS, email, databases, file operations, SSL, and backups
- Integrates with UAPI, WHM API, and cPanel API 2; uses exec/read_file/write_file tool interfaces
- Includes best practices, configuration samples, and compatibility notes for versions 130.x–134.x

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部