nonebot-plugin-webui
一个面向 NoneBot2 的 WebUI 插件雏形,目标是集中管理 NoneBot 运行配置、已加载插件、插件设置与插件商店。
当前能力
- 挂载到 FastAPI 驱动提供的
server_app - 查看 NoneBot 运行信息
- 查看已读取的配置项,并自动遮蔽疑似密钥、令牌、密码字段
- 查看已加载插件与
PluginMetadata - 从 NoneBot 官方 registry 拉取插件商店列表,并给出
nb plugin install命令 - 提供 WebUI 虚拟聊天环境,可触发 NoneBot matcher
- 内置
/ai命令,可通过 WebUI 模型提供商配置调用 OpenAI 兼容大模型
使用方式
安装到你的 NoneBot 项目环境后,在入口中加载插件:
nonebot.load_plugin("nonebot_plugin_webui")
确保项目使用 FastAPI 驱动,例如:
DRIVER=~fastapi
启动 NoneBot 后访问:
http://127.0.0.1:8080/webui
Docker
本地构建并启动:
docker compose up -d --build
启动后访问:
http://127.0.0.1:8080/webui
Release 发布并成功推送 PyPI 后,GitHub Actions 会从 PyPI 安装同版本包并推送镜像到 Docker Hub:
<dockerhub-namespace>/nonebot-plugin-webui:<release-tag>
非预发布版本还会额外推送 latest 标签。
需要在 GitHub 仓库 Secrets 中配置:
DOCKERHUB_USERNAME
DOCKERHUB_TOKEN
配置
WEBUI_PATH=/webui
WEBUI_STORE_URL=https://registry.nonebot.dev/plugins.json
WEBUI_STORE_TIMEOUT=10
# 可选:启用 WebUI 登录保护
# 设置后访问 WebUI 需要输入该令牌
WEBUI_ACCESS_TOKEN=change-me
# 登录账号固定为 admin,初始密码为 WEBUI_ACCESS_TOKEN。
# 数据库不可用时也会使用这个本地保底密码登录。
# 数据库配置不放在 .env 中。
# WebUI 默认使用 .nonebot-plugin-webui/webui.sqlite3,
# 可在 WebUI 的“配置 / 数据库”面板中修改并测试连接。
# 可选:作为 WebUI 模型提供商设置的回退值
# 推荐直接在 WebUI 的“模型”页面配置
WEBUI_AI_API_KEY=sk-...
WEBUI_AI_BASE_URL=https://api.openai.com/v1
WEBUI_AI_MODEL=gpt-4o-mini
AI 模型提供商设置会保存到运行目录下:
.nonebot-plugin-webui/webui.sqlite3
数据库连接配置会保存到运行目录下的本地 JSON 文件,作为启动期保底配置:
.nonebot-plugin-webui/database.json
如果数据库不可用,WebUI 会回退读取 .nonebot-plugin-webui/settings.json,并允许使用本地保底登录令牌进入界面修复数据库配置。
路线图
- 支持编辑
.env/.env.*配置文件并生成变更预览 - 为插件配置类生成可编辑表单
- 调用
nb-cli安装、更新、卸载插件 - 增加鉴权与访问控制
- 前端迁移到正式构建链并补充更完整的状态管理
Metadata
Release files for nonebot-plugin-webui 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_webui-0.1.5.tar.gz | 2.5 MB | With provenance | Details for nonebot_plugin_webui-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_webui-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_webui-0.1.5-py3-none-any.whl |
Total release size: 3.8 MB
Release files / nonebot_plugin_webui-0.1.5.tar.gz
| Download URL | nonebot_plugin_webui-0.1.5.tar.gz |
|---|---|
| Size | 2.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc99e7a39bcaa20e76e3ea1cd52e5c8b04021300181de53fc4a5fff8a630e93f
|
|
BLAKE2b-256 checksum How to use checksums |
091bdcd9f8166ffc38af8d4083d375fb4657f21c0a06a5881603e571b0ffcc56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 17, 2026.
Transparency logRelease files / nonebot_plugin_webui-0.1.5-py3-none-any.whl
| Download URL | nonebot_plugin_webui-0.1.5-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a5893cf7d02bf302cdd298710cd63e74f9bc5926b065286d298a24101b9c77e
|
|
BLAKE2b-256 checksum How to use checksums |
8ee549545f5e68d14c70fb76866773a6b502813b7cd8544026f816444e72e0b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 17, 2026.
Transparency logSecurity for nonebot-plugin-webui 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nonebot_plugin_webui-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.