@bgicli/bgicli 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -0
- package/dist/bgi.js +15233 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# BGI CLI
|
|
2
|
+
|
|
3
|
+
**BGI CLI** 是一个独立的生物信息学 AI 终端工具,专为中国研究者设计。
|
|
4
|
+
|
|
5
|
+
- ✅ **独立工具** — 无需安装 OpenCode 或其他 AI 工具
|
|
6
|
+
- ✅ **中国 AI 服务商** — DeepSeek、Kimi、通义千问、MiniMax
|
|
7
|
+
- ✅ **21 个预装工作流** — 覆盖转录组、基因组、表观基因组、临床分析
|
|
8
|
+
- ✅ **真正的工具调用** — 执行 bash 命令、读写文件、运行 R/Python 脚本
|
|
9
|
+
- ✅ **单一命令** — 直接运行 `bgi`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 需要 Node.js 18+
|
|
17
|
+
npm install -g @bgicli/bgicli
|
|
18
|
+
|
|
19
|
+
# 或从源码安装
|
|
20
|
+
git clone https://github.com/zja2004/BGI-CLI.git
|
|
21
|
+
cd BGI-CLI
|
|
22
|
+
npm install
|
|
23
|
+
npm run build
|
|
24
|
+
npm link
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 快速开始
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bgi
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
首次运行会提示选择 AI 服务商并输入 API Key。
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 支持的 AI 服务商
|
|
38
|
+
|
|
39
|
+
| 服务商 | 命令 | 获取 API Key |
|
|
40
|
+
|--------|------|-------------|
|
|
41
|
+
| **DeepSeek** (默认) | `/provider deepseek` | [platform.deepseek.com](https://platform.deepseek.com/api_keys) |
|
|
42
|
+
| **Kimi** | `/provider kimi` | [platform.moonshot.cn](https://platform.moonshot.cn/console/api-keys) |
|
|
43
|
+
| **通义千问** | `/provider qwen` | [dashscope.aliyuncs.com](https://dashscope.aliyuncs.com) |
|
|
44
|
+
| **MiniMax** | `/provider minimax` | [platform.minimax.chat](https://platform.minimax.chat) |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 命令参考
|
|
49
|
+
|
|
50
|
+
| 命令 | 说明 |
|
|
51
|
+
|------|------|
|
|
52
|
+
| `/provider <name>` | 切换 AI 服务商 |
|
|
53
|
+
| `/model <name>` | 切换模型 |
|
|
54
|
+
| `/models` | 列出当前服务商的可用模型 |
|
|
55
|
+
| `/providers` | 列出所有服务商 |
|
|
56
|
+
| `/connect [provider]` | 配置 API Key |
|
|
57
|
+
| `/status` | 显示当前配置 |
|
|
58
|
+
| `/clear` | 清空对话历史 |
|
|
59
|
+
| `/help` | 显示帮助 |
|
|
60
|
+
| `exit` / `quit` | 退出 |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 预装工作流 (21个)
|
|
65
|
+
|
|
66
|
+
运行分析时,BGI CLI 自动读取对应的 SKILL.md 工作流指南:
|
|
67
|
+
|
|
68
|
+
### 转录组学
|
|
69
|
+
- `bulk-rnaseq-counts-to-de-deseq2` — DESeq2 差异表达分析
|
|
70
|
+
- `bulk-omics-clustering` — 样本/特征聚类
|
|
71
|
+
- `scrnaseq-scanpy-core-analysis` — 单细胞分析 (Scanpy/Python)
|
|
72
|
+
- `scrnaseq-seurat-core-analysis` — 单细胞分析 (Seurat/R)
|
|
73
|
+
- `spatial-transcriptomics` — 空间转录组
|
|
74
|
+
- `coexpression-network` — 共表达网络 (WGCNA)
|
|
75
|
+
- `functional-enrichment-from-degs` — 功能富集 (GO/KEGG/GSEA)
|
|
76
|
+
- `grn-pyscenic` — 基因调控网络 (pySCENIC)
|
|
77
|
+
|
|
78
|
+
### 基因组学
|
|
79
|
+
- `genetic-variant-annotation` — 变异注释
|
|
80
|
+
- `gwas-to-function-twas` — GWAS → TWAS
|
|
81
|
+
- `mendelian-randomization-twosamplemr` — 孟德尔随机化
|
|
82
|
+
- `polygenic-risk-score-prs-catalog` — 多基因风险评分
|
|
83
|
+
- `pooled-crispr-screens` — CRISPR 文库筛选
|
|
84
|
+
|
|
85
|
+
### 表观基因组
|
|
86
|
+
- `chip-atlas-peak-enrichment / diff-analysis / target-genes` — ChIP-Atlas 分析
|
|
87
|
+
|
|
88
|
+
### 临床与流行病学
|
|
89
|
+
- `clinicaltrials-landscape`, `literature-preclinical`
|
|
90
|
+
- `experimental-design-statistics`, `lasso-biomarker-panel`, `pcr-primer-design`
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 工作流安装
|
|
95
|
+
|
|
96
|
+
将 21 个分析工作流部署到 `~/.bgicli/workflows/`:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# 从 bgicli-opencode 目录复制(如果已克隆旧仓库)
|
|
100
|
+
cp -r /path/to/old/workflows ~/.bgicli/workflows/
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
或运行安装脚本(Linux/macOS):
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
bash install.sh
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 架构
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
bgi (单一二进制)
|
|
115
|
+
├── src/index.ts — CLI 主入口、命令处理、交互循环
|
|
116
|
+
├── src/chat.ts — 流式对话引擎(支持工具调用)
|
|
117
|
+
├── src/tools.ts — 工具实现 (bash, read_file, write_file, list_dir, search_files)
|
|
118
|
+
├── src/prompt.ts — 嵌入式生物信息学系统提示 + 工作流索引
|
|
119
|
+
├── src/providers.ts — 中国 AI 服务商配置
|
|
120
|
+
└── src/config.ts — 配置管理 (~/.bgicli/config.json)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**工具调用流程**:
|
|
124
|
+
1. 用户提问 → 发给 LLM(带工具定义)
|
|
125
|
+
2. LLM 决定调用工具(bash/read_file 等)
|
|
126
|
+
3. BGI CLI 执行工具,将结果返回给 LLM
|
|
127
|
+
4. LLM 基于执行结果继续回答
|
|
128
|
+
5. 循环直到 LLM 完成回答
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|