@nodeskai/genehub 2026.3.2-9 → 2026.3.3-3
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/LICENSE +21 -0
- package/README.md +96 -0
- package/dist/index.js +6576 -229
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NoDeskAI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @nodeskai/genehub - GeneHub CLI
|
|
2
|
+
|
|
3
|
+
AI 员工基因管理命令行工具,用于搜索、安装、发布基因到 GeneHub Registry。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @nodeskai/genehub
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 配置
|
|
12
|
+
|
|
13
|
+
### 配置文件
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
genehub config set registry https://genehub.nodeskai.com
|
|
17
|
+
genehub config set token <your-token>
|
|
18
|
+
genehub config get
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
配置文件存储在 `~/.genehub/config.json`。
|
|
22
|
+
|
|
23
|
+
### 环境变量
|
|
24
|
+
|
|
25
|
+
环境变量优先级高于配置文件:
|
|
26
|
+
|
|
27
|
+
| 环境变量 | 说明 | 对应配置项 |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| `GENEHUB_REGISTRY_URL` | Registry 地址 | `registry` |
|
|
30
|
+
| `GENEHUB_REGISTRY` | Registry 地址(别名) | `registry` |
|
|
31
|
+
| `GENEHUB_TOKEN` | 认证 Token | `token` |
|
|
32
|
+
|
|
33
|
+
本地开发示例:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
GENEHUB_REGISTRY_URL=http://localhost:3000 GENEHUB_TOKEN=dev genehub publish ./my-gene
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 认证
|
|
40
|
+
|
|
41
|
+
使用 GitHub OAuth 登录,自动创建 API Key:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
genehub auth login # 打开浏览器完成 GitHub 登录,自动保存 token
|
|
45
|
+
genehub auth status # 查看当前登录状态
|
|
46
|
+
genehub auth logout # 退出登录(清除本地 token)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 命令
|
|
50
|
+
|
|
51
|
+
| 命令 | 说明 |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `genehub auth login` | GitHub OAuth 登录 |
|
|
54
|
+
| `genehub auth status` | 查看登录状态 |
|
|
55
|
+
| `genehub auth logout` | 退出登录 |
|
|
56
|
+
| `genehub search [keyword]` | 搜索基因库 |
|
|
57
|
+
| `genehub install <slug>` | 安装基因到当前 Agent 环境 |
|
|
58
|
+
| `genehub uninstall <slug>` | 卸载基因 |
|
|
59
|
+
| `genehub publish <path>` | 发布基因到 Registry |
|
|
60
|
+
| `genehub list` | 列出已安装的基因 |
|
|
61
|
+
| `genehub learn <slug>` | 触发基因深度学习(L2) |
|
|
62
|
+
| `genehub init` | 初始化基因项目 |
|
|
63
|
+
| `genehub config` | 管理配置 |
|
|
64
|
+
|
|
65
|
+
## 目录结构
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
packages/cli/
|
|
69
|
+
├── src/
|
|
70
|
+
│ ├── index.ts # 入口,注册所有命令
|
|
71
|
+
│ ├── config.ts # 配置管理(文件 + 环境变量)
|
|
72
|
+
│ ├── output.ts # 格式化输出工具
|
|
73
|
+
│ └── commands/
|
|
74
|
+
│ ├── auth.ts # GitHub OAuth 登录
|
|
75
|
+
│ ├── config.ts # config set / get
|
|
76
|
+
│ ├── init.ts # 初始化基因项目
|
|
77
|
+
│ ├── install.ts # 安装基因
|
|
78
|
+
│ ├── learn.ts # 深度学习
|
|
79
|
+
│ ├── list.ts # 列出已安装基因
|
|
80
|
+
│ ├── publish.ts # 发布基因
|
|
81
|
+
│ ├── search.ts # 搜索基因
|
|
82
|
+
│ └── uninstall.ts # 卸载基因
|
|
83
|
+
├── dist/ # 构建产物
|
|
84
|
+
├── package.json
|
|
85
|
+
└── tsup.config.ts
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 开发
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
cd packages/cli
|
|
92
|
+
pnpm install
|
|
93
|
+
pnpm build # 构建
|
|
94
|
+
pnpm dev # 开发模式
|
|
95
|
+
pnpm test # 测试
|
|
96
|
+
```
|