nb-cli
nb-cli copied to clipboard
NoneBot2 脚手架 / CLI for NoneBot2
nb-cli
English | 中文
NoneBot2 的命令行工具
功能
- 创建新的 Nonebot 项目
- 启动 Nonebot
- 部署 NoneBot 到 Docker
- 管理插件
- 创建新的插件
- 搜索/安装/更新/卸载在官方商店上发布的插件
- 管理适配器
- 创建新的适配器
- 搜索/安装/更新/卸载在官方商店上发布的适配器
使用
安装
pip install nb-cli
或者,带有可选的 deploy 依赖项
pip install nb-cli[deploy]
命令行使用
nb --help
nb init (create)创建新的 Nonebot 项目nb run在当前目录启动 Nonebotnb driver管理驱动器nb driver list查看驱动器列表nb driver search搜索驱动器nb driver install (add)安装驱动器
nb plugin管理插件nb plugin new (create)创建新的插件nb plugin list列出官方商店的所有插件nb plugin search在官方商店搜索插件nb plugin install (add)安装插件nb plugin update更新插件nb plugin uninstall (remove)卸载插件
nb adapter管理适配器nb adapter new (create)创建新的适配器nb adapter list列出官方商店的所有适配器nb adapter search在官方商店搜索适配器nb adapter install (add)安装适配器nb adapter update更新适配器nb adapter uninstall (remove)卸载适配器
以下功能需要 [deploy] 依赖
nb build在当前目录构建 Docker 镜像nb deploy (up)在当前目录构建、创建并运行 Docker 容器nb exit (down)在当前目录停止并删除 Docker 容器
交互式使用
nb
CookieCutter 使用
安装 cookiecutter
pip install cookiecutter
创建项目
cookiecutter https://github.com/nonebot/nb-cli.git --directory="nb_cli/project"
创建插件
cookiecutter https://github.com/nonebot/nb-cli.git --directory="nb_cli/plugin"
创建适配器
cookiecutter https://github.com/nonebot/nb-cli.git --directory="nb_cli/adapter"