npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-xui-api

v2.1.2

Published

3x-ui / X-UI 面板 API 插件 — 查询服务器状态、入站、客户端、用户流量、在线用户、用户组、活跃入站、Xray状态;支持创建/删除用户、重置流量、启停Xray等管理操作

Downloads

1,728

Readme

koishi-plugin-xui-api

npm

用于 Koishi 的 X-UI / 3x-ui 面板插件。通过调用面板的 REST API,让你在聊天中快速查询服务器状态、入站、客户端、用户流量,并支持创建/删除用户、重置流量、重启/停止Xray等管理操作。

配置

| 配置项 | 说明 | |--------|------| | servers[].name | 服务器别名(命令中用 -s 或作为位置参数指定)。建议把常用的主服务器写在配置列表的最前面xui.traffic 默认查询第一台 | | servers[].host | 服务器 IP 或域名(自动移除 http:// / https:// 前缀) | | servers[].port | 面板端口 | | servers[].path | API 路径前缀(空则使用默认 /panel/api) | | servers[].token | API Token(在面板设置 → 安全里生成) | | servers[].scheme | httphttps | | timeout | 每台服务器请求超时时间(毫秒,默认 10000) | | enableManagement | 是否启用管理类命令(默认 false,关闭后所有人无法使用 xui.restartxui.addxui.del 等) | | adminUserIds | 管理员用户 ID 列表(必须填写,仅这些账号可以使用管理类命令) |

命令一览

查询类

| 命令 | 功能 | |------|------| | xui.status [服务器名] | 查询服务器状态(CPU / 内存 / 磁盘 / 网络 / 连接数 / Xray) | | xui.inbounds [服务器名] | 查询入站列表(协议 / 流量 / 客户端数量 / 到期) | | xui.clients [服务器名] | 查询客户端列表(-o 仅显示在线) | | xui.online [服务器名] | 查询当前在线用户及最后活动时间 | | xui.traffic [邮箱] | 查询用户流量(默认查第一台配置的服务器;-s 服务器名 指定某台;-a 查询全部服务器,每台独立显示。不填邮箱则默认用用户ID。建议常用服务器写在配置列表最前面) | | xui.ip [邮箱] | 查询用户连接IP(默认查第一台配置的服务器;-s 指定某台;-a 查询全部。不填邮箱则默认用用户ID) | | xui.groups [组名] | 查询用户组 / 组内成员 | | xui.active <邮箱> | 查询用户当前活跃入站 | | xui.xray [服务器名] | 查询 Xray 运行状态与版本 | | xui.info <邮箱> | 查询用户详细信息(配额 / 到期 / 所属入站 / 订阅ID) | | xui.sub <邮箱或订阅ID> | 获取用户订阅链接 | | xui.servers | 列出所有已配置服务器 | | xui.help | 查看完整命令帮助 |

管理类

| 命令 | 功能 | |------|------| | xui.restart | 重启 Xray | | xui.stop | 停止 Xray | | xui.logs [行数] | 获取面板日志(默认 10 行) | | xui.xraylogs [行数] | 获取 Xray 进程日志(-f 关键词 过滤) | | xui.inbound-enable <ID> | 启用指定入站 | | xui.inbound-disable <ID> | 停用指定入站 | | xui.inbound-del <ID> | 删除指定入站 | | xui.inbound-reset <ID> | 重置指定入站流量 | | xui.add <邮箱> <入站IDs> | 创建用户(-t 100 指定100GB流量 / -d 30 指定30天有效期) | | xui.del <邮箱> | 删除用户(-k 保留流量记录) | | xui.reset <邮箱> | 重置用户流量 | | xui.extend <邮箱> <天数> | 延长用户有效期(-t 50 额外增加50GB流量) | | xui.clearips <邮箱> | 清除用户连接 IP 记录 | | xui.cleanup | 清理所有到期 / 流量耗尽的用户 |

提示:绝大多数命令支持 -s 服务器别名 指定单个服务器,不写则对所有已配置服务器执行。