Skip to main content

A web UI for managing NoneBot runtime config, loaded plugins, and plugin store entries.

Project description

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

配置

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 安装、更新、卸载插件
  • 增加鉴权与访问控制
  • 前端迁移到正式构建链并补充更完整的状态管理

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_webui-0.1.3.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_webui-0.1.3-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_webui-0.1.3.tar.gz.

File metadata

  • Download URL: nonebot_plugin_webui-0.1.3.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nonebot_plugin_webui-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fd2095be36bbd63c8f0f32d01e9f315a530421990a46ca332dd2f3e96732b1a2
MD5 ac8af72a38e85900fd97fe168c0bc9b8
BLAKE2b-256 0a1bde98bcc4e14e4cd873fb1134637097d6da1ed6445c98f035b914efe7ceaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_webui-0.1.3.tar.gz:

Publisher: release.yml on Coloynle/nonebot-plugin-webui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_webui-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_webui-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cb2f30b4bb8e1c9b9ca8c5de1e0bed0f697b471074303b9417f7cbd090872ab1
MD5 0fc6f4a88dd63709cbd5b7a81a6f3e37
BLAKE2b-256 a8d4529d2a78ba7e50d49d7bad5469c498d373cb82b9ab70cd26a3077e6f0f18

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_webui-0.1.3-py3-none-any.whl:

Publisher: release.yml on Coloynle/nonebot-plugin-webui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page