Skip to content

Commit 4933ca0

Browse files
author
iammm0
committed
feat(cli): secbot 单命令同时启动后端与 TUI 并纳入发布包
1 parent 76bca76 commit 4933ca0

11 files changed

Lines changed: 1252 additions & 23 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# 自动发布 npm 包 @opensec/secbot(以 2.0.1 / 标签 v2.0.1 为例)
2-
# 1. 确认根目录 package.json 的 version 与即将打的标签一致(如 2.0.1 对应标签 v2.0.1)。
1+
# 自动发布 npm 包 @opensec/secbot(以 2.0.2 / 标签 v2.0.2 为例)
2+
# 1. 确认根目录 package.json 的 version 与即将打的标签一致(如 2.0.2 对应标签 v2.0.2)。
33
# 2. NPM_TOKEN(npm 账号若开启 2FA,必须二选一,否则会报 403:需 bypass 2FA 才能 publish):
44
# · Granular Access Token:Packages 选 Read and write;创建时勾选「允许发布时绕过双因素认证」
55
# (英文界面类似 "Bypass two-factor authentication (2FA) for writes",以 npm 网站为准)。
66
# · 或 Classic Token:类型必须选 Automation(勿用需 OTP 的 Publish 类令牌)。
77
# 权限须覆盖 @opensec;GitHub Secret 名仍为 NPM_TOKEN。
8-
# 3. git tag v2.0.1 && git push origin v2.0.1
8+
# 3. git tag v2.0.2 && git push origin v2.0.2
99
# 将触发:构建 → 校验版本 → 打 GitHub Release 并上传 tgz → npm publish(npmjs)+
1010
# GitHub Packages(仓库 Settings → Packages 可见;包名为 @<仓库所有者>/secbot,与 @opensec/secbot 并存)。
1111
# 工作流 permissions 需含 packages: write(已配置);使用 GITHUB_TOKEN 认证 npm.pkg.github.com。

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
<!-- version list -->
44

5+
## v2.0.2 (2026-04-06)
6+
7+
### Features
8+
9+
- **cli**`secbot` 一单命令同时启动 Nest 后端与 Ink TUI(全局安装与 `npm pack` 均包含 `terminal-ui/dist`);`secbot-server` 仍仅启动后端 API。
10+
511
## v2.0.1 (2026-04-06)
612

713
### Chores

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<img src="https://img.shields.io/badge/TypeScript-5.x-3178C6.svg" alt="TypeScript">
1717
</a>
1818
<a href="package.json">
19-
<img src="https://img.shields.io/badge/version-2.0.1-brightgreen.svg" alt="Version">
19+
<img src="https://img.shields.io/badge/version-2.0.2-brightgreen.svg" alt="Version">
2020
</a>
2121
<a href="LICENSE">
2222
<img src="https://img.shields.io/badge/license-Custom-orange.svg" alt="License">

README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Node.js](https://img.shields.io/badge/Node.js-18%2B-339933.svg)](https://nodejs.org/)
88
[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6.svg)](https://www.typescriptlang.org/)
9-
[![Version](https://img.shields.io/badge/version-2.0.1-brightgreen.svg)](package.json)
9+
[![Version](https://img.shields.io/badge/version-2.0.2-brightgreen.svg)](package.json)
1010
[![License](https://img.shields.io/badge/license-Custom-orange.svg)](LICENSE)
1111
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)](https://github.com/iammm0/secbot/releases)
1212
[![NestJS](https://img.shields.io/badge/NestJS-11-E0234E.svg)](https://nestjs.com/)

docs/RELEASE.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
当前发布包命名为 `secbot-<platform>.zip`,也可通过 npm 安装:
1414

1515
```bash
16-
# 全局安装
16+
# 全局安装:`secbot` 会启动后端 + 终端 TUI(一节真实 TTY 中运行;IDE 集成终端在 Windows 上可能自动新开窗口)
1717
npm install -g @opensec/secbot
1818
secbot
1919

20-
# 或通过 npx 直接运行
20+
# 仅启动 HTTP API(自动化 / 自建前端)
21+
secbot-server
22+
23+
# 或通过 npx 直接运行完整产品
2124
npx @opensec/secbot
2225
```
2326

@@ -90,7 +93,7 @@ node scripts/release-docs.js version-docs --changelog CHANGELOG.md --output-dir
9093
```bash
9194
node scripts/release-docs.js package-readme \
9295
--changelog CHANGELOG.md \
93-
--version v2.0.1 \
96+
--version v2.0.2 \
9497
--platform windows-amd64 \
9598
--output dist/README_RELEASE.md
9699
```

npm-bin/secbot-server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env node
22

3-
require('./secbot.js');
3+
/** 仅启动 HTTP 后端(供 API / CI / 自动化使用);完整产品请使用 `secbot`。 */
4+
require('../server/dist/main.js');
45

npm-bin/secbot.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/usr/bin/env node
22

3-
require('../server/dist/main.js');
3+
const { start } = require('../scripts/run-product.js');
4+
5+
start().catch((error) => {
6+
// eslint-disable-next-line no-console
7+
console.error(`[secbot] ${error.message}`);
8+
process.exit(1);
9+
});
410

0 commit comments

Comments
 (0)