mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
92 lines
3.7 KiB
Plaintext
92 lines
3.7 KiB
Plaintext
---
|
||
title: "发布插件到插件市场"
|
||
---
|
||
|
||
通过 CLI 将插件发布至 [LangBot 插件市场](https://space.langbot.app/market)。
|
||
|
||
## 在 LangBot Space 创建账号
|
||
|
||
LangBot Space 是 LangBot 提供中心化服务平台。请访问[LangBot Space](https://space.langbot.app),点击右上角使用 GitHub 登录并创建账号。
|
||
|
||
<img width="600" src="/images/zh/plugin/dev/login_space.png" />
|
||
|
||
这将跳转到 GitHub 授权页面,请根据提示完成授权。
|
||
|
||
## 使用 CLI 登录 LangBot Space
|
||
|
||
### 方式一:使用个人访问令牌(推荐)
|
||
|
||
1. 登录 [LangBot Space](https://space.langbot.app),点击头像进入 **账户设置**,在 **账户** 标签页中找到 **个人访问令牌**,创建一个新的令牌。
|
||
2. 复制生成的令牌(仅显示一次),在终端执行:
|
||
|
||
```bash
|
||
➜ HelloPlugin > lbp login --token lbpat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||
|
||
==================================================
|
||
✅ 使用个人访问令牌登录成功!
|
||
令牌已保存至:~/.langbot/cli/config.json
|
||
==================================================
|
||
```
|
||
|
||
### 方式二:使用设备码验证
|
||
|
||
在任意目录执行命令`lbp login`:
|
||
|
||
```bash
|
||
➜ HelloPlugin > lbp login
|
||
Starting LangBot CLI login process...
|
||
Generating device code...
|
||
|
||
==================================================
|
||
Please copy the user code and complete verification in your browser:
|
||
User Code: 6CD64D56
|
||
Verification URL: https://space.langbot.app/auth/device
|
||
Device code expires in: 120 seconds
|
||
==================================================
|
||
|
||
Waiting for verification...
|
||
```
|
||
|
||
请点击`Verification URL`跳转至 LangBot Space,输入`User Code`完成登录。
|
||
|
||
<img width="600" src="/images/zh/plugin/dev/space_device_flow.png" />
|
||
|
||
```bash
|
||
==================================================
|
||
✅ Login successful!
|
||
Access token saved to: ~/.langbot/cli/config.json
|
||
Token type: Bearer
|
||
Expires in: 21600 seconds
|
||
==================================================
|
||
```
|
||
|
||
两种方式登录成功后,均可继续使用 CLI 上传插件。
|
||
|
||
## 上传插件
|
||
|
||
请在您的插件目录下执行`lbp publish`:
|
||
|
||
```bash
|
||
➜ HelloPlugin > lbp publish
|
||
Building plugin to dist/tmp...
|
||
- Skipping ignored directory: dist
|
||
- Skipping ignored directory: __pycache__
|
||
...
|
||
Plugin built successfully: dist/tmp/RockChinQ-HelloPlugin-0.1.0.lbpkg
|
||
✅ Plugin published successfully. You can check it on https://https://space.langbot.app/market
|
||
```
|
||
|
||
您现在可以在[LangBot 插件市场](https://space.langbot.app/market)查看您的插件提交任务。请等待审核通过后,您可以在插件市场查看您的插件。
|
||
|
||
## 申请认证插件审核
|
||
|
||
如果该版本准备申请认证,请在 `manifest.yaml` 中同时声明 `execution.sharedRuntime: shared-runtime-v1` 和 `execution.componentModel: stateless-v1`,并提交一个**新版本**。辅助审查会确认单例组件无状态、可重入、按调用读取配置且不持有租户数据。声明本身不会授予认证标识或共享运行权限。
|
||
|
||
LangBot Space 会检查本次提交的精确插件包,进行辅助代码审查,并在人工批准后才签发认证插件标识。认证绑定到已审核的插件版本与校验和。请让工作区配置、存储、凭据、日志和后台工作都与当前安装绑定,不要依赖可变的进程全局状态。
|
||
|
||
如果审核发现该版本无法满足要求,请先作为未签名的普通专属插件提交,并在后续不可变版本中修复问题。不存在专属运行认证或中间认证等级。用户侧说明见[认证插件](/zh/plugin/certified-plugins)。
|
||
|
||
<img width="600" src="/images/zh/plugin/dev/plugin_submission.png" />
|
||
|
||
有任何问题,您可以发送邮件到`[email protected]`或通过[社区](/zh/insight/community)联系我们。
|