nb-cli


Namenb-cli JSON
Version 1.4.1 PyPI version JSON
download
home_pagehttps://cli.nonebot.dev/
SummaryCLI for nonebot2
upload_time2024-04-04 08:51:38
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.9
licenseMIT
keywords bot qq nonebot bot qq nonebot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable MD033 MD041 -->
<p align="center">
  <a href="https://cli.nonebot.dev/"><img src="https://cli.nonebot.dev/logo.png" width="200" height="200" alt="nonebot"></a>
</p>

<div align="center">

# NB CLI

_✨ NoneBot2 命令行工具 ✨_

</div>

<p align="center">
  <a href="https://raw.githubusercontent.com/nonebot/nb-cli/master/LICENSE">
    <img src="https://img.shields.io/github/license/nonebot/nb-cli" alt="license">
  </a>
  <a href="https://pypi.python.org/pypi/nb-cli">
    <img src="https://img.shields.io/pypi/v/nb-cli" alt="pypi">
  </a>
  <img src="https://img.shields.io/badge/python-3.9+-blue" alt="python">
  <a href="https://github.com/nonebot/nb-cli/actions/workflows/website-deploy.yml">
    <img src="https://github.com/nonebot/nb-cli/actions/workflows/website-deploy.yml/badge.svg?branch=master&event=push" alt="site"/>
  </a>
  <a href="https://results.pre-commit.ci/latest/github/nonebot/nb-cli/master">
    <img src="https://results.pre-commit.ci/badge/github/nonebot/nb-cli/master.svg" alt="pre-commit" />
  </a>
  <br />
  <a href="https://jq.qq.com/?_wv=1027&k=5OFifDh">
    <img src="https://img.shields.io/badge/QQ%E7%BE%A4-768887710-orange?style=flat-square" alt="QQ Chat Group">
  </a>
  <a href="https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&appChannel=share&inviteCode=7b4a3&appChannel=share&businessType=9&from=246610&biz=ka">
    <img src="https://img.shields.io/badge/QQ%E9%A2%91%E9%81%93-NoneBot-5492ff?style=flat-square" alt="QQ Channel">
  </a>
  <a href="https://t.me/botuniverse">
    <img src="https://img.shields.io/badge/telegram-botuniverse-blue?style=flat-square" alt="Telegram Channel">
  </a>
  <a href="https://discord.gg/VKtE6Gdc4h">
    <img src="https://discordapp.com/api/guilds/847819937858584596/widget.png?style=shield" alt="Discord Server">
  </a>
</p>

<p align="center">
  <a href="https://cli.nonebot.dev/">文档</a>
  ·
  <a href="https://cli.nonebot.dev/docs/guide/installation">安装</a>
  ·
  <a href="https://nonebot.dev/">NoneBot 文档</a>
</p>

## 功能

- 创建新的 Nonebot 项目
- 启动 Nonebot
- 管理插件
  - 创建新的插件
  - 搜索/安装/更新/卸载在官方商店上发布的插件
- 管理适配器
  - 创建新的适配器
  - 搜索/安装/更新/卸载在官方商店上发布的适配器
- 管理驱动器
  - 搜索/安装/更新/卸载在官方商店上发布的驱动器
- 支持 CLI 插件和运行脚本

## 使用

完整使用文档请参考 [文档](https://cli.nonebot.dev/)。

### 安装

使用 pipx 安装

```shell
pipx install nb-cli
```

使用 Docker 运行

```shell
docker pull nonebot/nb-cli:latest
```

Docker 镜像可以选择以下版本:

- `latest`, `latest-slim`:最新的稳定版本
- `latest-${python版本}`, `latest-${python版本}-slim`:指定 Python 版本的最新稳定版本
- `${cli版本}`, `${cli版本}-slim`:指定 CLI 版本的最新稳定版本
- `${cli版本}-${python版本}`, `${cli版本}-${python版本}-slim`:指定 CLI 和 Python 版本的最新稳定版本

### 命令行使用

```shell
nb --help
```

> **Warning**
>
> 如果找不到 `nb` 命令,请尝试 `pipx ensurepath` 来添加路径到环境变量

- `nb create (init)` 创建新的 NoneBot 项目
- `nb run` 在当前目录启动 NoneBot
- `nb generate` 在当前目录生成启动脚本
- `nb driver` 管理驱动器
- `nb plugin` 管理插件
- `nb adapter` 管理适配器
- `nb self` 管理 CLI 内部环境
- `nb <script>` 运行脚本

Docker 镜像使用

```shell
docker run --rm -it -v ./:/workspaces nonebot/nb-cli:latest --help
```

挂载当前目录到容器的 `/workspaces` 目录,然后在容器中运行 `nb` 命令。

### 交互式使用

```shell
nb
```

Docker 镜像使用

```shell
docker run --rm -it -v ./:/workspaces nonebot/nb-cli:latest
```

## 开发

### 翻译

生成模板

```shell
pdm run extract
```

初始化语言翻译文件或者更新现有语言翻译文件

```shell
pdm run init en_US
```

更新语言翻译文件

```shell
pdm run update
```

编译语言翻译文件

```shell
pdm run compile
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://cli.nonebot.dev/",
    "name": "nb-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "bot qq nonebot bot qq nonebot",
    "author": null,
    "author_email": "yanyongyu <yyy@nonebot.dev>",
    "download_url": "https://files.pythonhosted.org/packages/94/77/4c5c7ec92820a3bd4c67f6cc15f2ad25a09d03c1d43b376ae8b91da11478/nb_cli-1.4.1.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable MD033 MD041 -->\n<p align=\"center\">\n  <a href=\"https://cli.nonebot.dev/\"><img src=\"https://cli.nonebot.dev/logo.png\" width=\"200\" height=\"200\" alt=\"nonebot\"></a>\n</p>\n\n<div align=\"center\">\n\n# NB CLI\n\n_\u2728 NoneBot2 \u547d\u4ee4\u884c\u5de5\u5177 \u2728_\n\n</div>\n\n<p align=\"center\">\n  <a href=\"https://raw.githubusercontent.com/nonebot/nb-cli/master/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/nonebot/nb-cli\" alt=\"license\">\n  </a>\n  <a href=\"https://pypi.python.org/pypi/nb-cli\">\n    <img src=\"https://img.shields.io/pypi/v/nb-cli\" alt=\"pypi\">\n  </a>\n  <img src=\"https://img.shields.io/badge/python-3.9+-blue\" alt=\"python\">\n  <a href=\"https://github.com/nonebot/nb-cli/actions/workflows/website-deploy.yml\">\n    <img src=\"https://github.com/nonebot/nb-cli/actions/workflows/website-deploy.yml/badge.svg?branch=master&event=push\" alt=\"site\"/>\n  </a>\n  <a href=\"https://results.pre-commit.ci/latest/github/nonebot/nb-cli/master\">\n    <img src=\"https://results.pre-commit.ci/badge/github/nonebot/nb-cli/master.svg\" alt=\"pre-commit\" />\n  </a>\n  <br />\n  <a href=\"https://jq.qq.com/?_wv=1027&k=5OFifDh\">\n    <img src=\"https://img.shields.io/badge/QQ%E7%BE%A4-768887710-orange?style=flat-square\" alt=\"QQ Chat Group\">\n  </a>\n  <a href=\"https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&appChannel=share&inviteCode=7b4a3&appChannel=share&businessType=9&from=246610&biz=ka\">\n    <img src=\"https://img.shields.io/badge/QQ%E9%A2%91%E9%81%93-NoneBot-5492ff?style=flat-square\" alt=\"QQ Channel\">\n  </a>\n  <a href=\"https://t.me/botuniverse\">\n    <img src=\"https://img.shields.io/badge/telegram-botuniverse-blue?style=flat-square\" alt=\"Telegram Channel\">\n  </a>\n  <a href=\"https://discord.gg/VKtE6Gdc4h\">\n    <img src=\"https://discordapp.com/api/guilds/847819937858584596/widget.png?style=shield\" alt=\"Discord Server\">\n  </a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://cli.nonebot.dev/\">\u6587\u6863</a>\n  \u00b7\n  <a href=\"https://cli.nonebot.dev/docs/guide/installation\">\u5b89\u88c5</a>\n  \u00b7\n  <a href=\"https://nonebot.dev/\">NoneBot \u6587\u6863</a>\n</p>\n\n## \u529f\u80fd\n\n- \u521b\u5efa\u65b0\u7684 Nonebot \u9879\u76ee\n- \u542f\u52a8 Nonebot\n- \u7ba1\u7406\u63d2\u4ef6\n  - \u521b\u5efa\u65b0\u7684\u63d2\u4ef6\n  - \u641c\u7d22/\u5b89\u88c5/\u66f4\u65b0/\u5378\u8f7d\u5728\u5b98\u65b9\u5546\u5e97\u4e0a\u53d1\u5e03\u7684\u63d2\u4ef6\n- \u7ba1\u7406\u9002\u914d\u5668\n  - \u521b\u5efa\u65b0\u7684\u9002\u914d\u5668\n  - \u641c\u7d22/\u5b89\u88c5/\u66f4\u65b0/\u5378\u8f7d\u5728\u5b98\u65b9\u5546\u5e97\u4e0a\u53d1\u5e03\u7684\u9002\u914d\u5668\n- \u7ba1\u7406\u9a71\u52a8\u5668\n  - \u641c\u7d22/\u5b89\u88c5/\u66f4\u65b0/\u5378\u8f7d\u5728\u5b98\u65b9\u5546\u5e97\u4e0a\u53d1\u5e03\u7684\u9a71\u52a8\u5668\n- \u652f\u6301 CLI \u63d2\u4ef6\u548c\u8fd0\u884c\u811a\u672c\n\n## \u4f7f\u7528\n\n\u5b8c\u6574\u4f7f\u7528\u6587\u6863\u8bf7\u53c2\u8003 [\u6587\u6863](https://cli.nonebot.dev/)\u3002\n\n### \u5b89\u88c5\n\n\u4f7f\u7528 pipx \u5b89\u88c5\n\n```shell\npipx install nb-cli\n```\n\n\u4f7f\u7528 Docker \u8fd0\u884c\n\n```shell\ndocker pull nonebot/nb-cli:latest\n```\n\nDocker \u955c\u50cf\u53ef\u4ee5\u9009\u62e9\u4ee5\u4e0b\u7248\u672c\uff1a\n\n- `latest`, `latest-slim`\uff1a\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\n- `latest-${python\u7248\u672c}`, `latest-${python\u7248\u672c}-slim`\uff1a\u6307\u5b9a Python \u7248\u672c\u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\n- `${cli\u7248\u672c}`, `${cli\u7248\u672c}-slim`\uff1a\u6307\u5b9a CLI \u7248\u672c\u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\n- `${cli\u7248\u672c}-${python\u7248\u672c}`, `${cli\u7248\u672c}-${python\u7248\u672c}-slim`\uff1a\u6307\u5b9a CLI \u548c Python \u7248\u672c\u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\n\n### \u547d\u4ee4\u884c\u4f7f\u7528\n\n```shell\nnb --help\n```\n\n> **Warning**\n>\n> \u5982\u679c\u627e\u4e0d\u5230 `nb` \u547d\u4ee4\uff0c\u8bf7\u5c1d\u8bd5 `pipx ensurepath` \u6765\u6dfb\u52a0\u8def\u5f84\u5230\u73af\u5883\u53d8\u91cf\n\n- `nb create (init)` \u521b\u5efa\u65b0\u7684 NoneBot \u9879\u76ee\n- `nb run` \u5728\u5f53\u524d\u76ee\u5f55\u542f\u52a8 NoneBot\n- `nb generate` \u5728\u5f53\u524d\u76ee\u5f55\u751f\u6210\u542f\u52a8\u811a\u672c\n- `nb driver` \u7ba1\u7406\u9a71\u52a8\u5668\n- `nb plugin` \u7ba1\u7406\u63d2\u4ef6\n- `nb adapter` \u7ba1\u7406\u9002\u914d\u5668\n- `nb self` \u7ba1\u7406 CLI \u5185\u90e8\u73af\u5883\n- `nb <script>` \u8fd0\u884c\u811a\u672c\n\nDocker \u955c\u50cf\u4f7f\u7528\n\n```shell\ndocker run --rm -it -v ./:/workspaces nonebot/nb-cli:latest --help\n```\n\n\u6302\u8f7d\u5f53\u524d\u76ee\u5f55\u5230\u5bb9\u5668\u7684 `/workspaces` \u76ee\u5f55\uff0c\u7136\u540e\u5728\u5bb9\u5668\u4e2d\u8fd0\u884c `nb` \u547d\u4ee4\u3002\n\n### \u4ea4\u4e92\u5f0f\u4f7f\u7528\n\n```shell\nnb\n```\n\nDocker \u955c\u50cf\u4f7f\u7528\n\n```shell\ndocker run --rm -it -v ./:/workspaces nonebot/nb-cli:latest\n```\n\n## \u5f00\u53d1\n\n### \u7ffb\u8bd1\n\n\u751f\u6210\u6a21\u677f\n\n```shell\npdm run extract\n```\n\n\u521d\u59cb\u5316\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\u6216\u8005\u66f4\u65b0\u73b0\u6709\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\n\n```shell\npdm run init en_US\n```\n\n\u66f4\u65b0\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\n\n```shell\npdm run update\n```\n\n\u7f16\u8bd1\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\n\n```shell\npdm run compile\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI for nonebot2",
    "version": "1.4.1",
    "project_urls": {
        "Homepage": "https://cli.nonebot.dev/",
        "Repository": "https://github.com/nonebot/nb-cli"
    },
    "split_keywords": [
        "bot",
        "qq",
        "nonebot",
        "bot",
        "qq",
        "nonebot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59a2b5c8219dad088c662a72856208c53e29defdde5c282301380290b96c8bfc",
                "md5": "f23b33582d504e977ee64f66bfe19edb",
                "sha256": "57b6111773202bce29c0520f4a281edb8a7643fa33692d4afc70ca5b51b10f70"
            },
            "downloads": -1,
            "filename": "nb_cli-1.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f23b33582d504e977ee64f66bfe19edb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 63732,
            "upload_time": "2024-04-04T08:51:36",
            "upload_time_iso_8601": "2024-04-04T08:51:36.675861Z",
            "url": "https://files.pythonhosted.org/packages/59/a2/b5c8219dad088c662a72856208c53e29defdde5c282301380290b96c8bfc/nb_cli-1.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94774c5c7ec92820a3bd4c67f6cc15f2ad25a09d03c1d43b376ae8b91da11478",
                "md5": "379b4601726f332f5d76403a06a472aa",
                "sha256": "908dd4cbbf66bf46fe879c23ad1377332f63385cebca1912b627aa686d1816f3"
            },
            "downloads": -1,
            "filename": "nb_cli-1.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "379b4601726f332f5d76403a06a472aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 39322,
            "upload_time": "2024-04-04T08:51:38",
            "upload_time_iso_8601": "2024-04-04T08:51:38.746031Z",
            "url": "https://files.pythonhosted.org/packages/94/77/4c5c7ec92820a3bd4c67f6cc15f2ad25a09d03c1d43b376ae8b91da11478/nb_cli-1.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-04 08:51:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nonebot",
    "github_project": "nb-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nb-cli"
}
        
Elapsed time: 0.19998s