@zythegit/agent-hub 0.0.0-stage → 0.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 +128 -2
- package/dist/.gitkeep +0 -0
- package/dist/ahub.js +363 -0
- package/package.json +57 -4
package/README.md
CHANGED
|
@@ -1,3 +1,129 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AgentHub (`ahub`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 跨 AI 编码客户端(Claude / Codex / Pi / Antigravity / Qoder / Trae 等)的规范同步、经验学习与技能分发平台。
|
|
4
|
+
|
|
5
|
+
一处维护规范,多处秒级更新;物理隔离个人与公司资产;支持免编译通过配置扩展任意新 Agent。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 安装与运行
|
|
10
|
+
|
|
11
|
+
### 方式 1:全局安装(推荐)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @zythegit/agent-hub
|
|
15
|
+
|
|
16
|
+
# 验证安装
|
|
17
|
+
ahub --version
|
|
18
|
+
# 或
|
|
19
|
+
agent-hub --version
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 方式 2:免安装直接执行(npx)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @zythegit/agent-hub sync --all
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 方式 3:从源码本地构建
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
git clone https://github.com/zyTheGit/AgentHub.git
|
|
32
|
+
cd AgentHub
|
|
33
|
+
npm install
|
|
34
|
+
npm run build
|
|
35
|
+
npm link
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 常用命令速查
|
|
41
|
+
|
|
42
|
+
| 全称命令 | 说明 | 行业常用简写 / 别名 |
|
|
43
|
+
| :--- | :--- | :--- |
|
|
44
|
+
| `ahub sync --all` | 一键同步全部项目规则与技能 (日常最高频) | `ahub sync -a` / `ahub s` |
|
|
45
|
+
| `ahub sync <项目名>` | 仅同步指定的一个项目 | `ahub s <项目名>` |
|
|
46
|
+
| `ahub doctor` | 全项目健康体检与配置巡检 | `ahub d` |
|
|
47
|
+
| `ahub project list` | 列出当前已纳管的所有项目 | `ahub project ls` |
|
|
48
|
+
| `ahub project add <路径>` | 纳管新项目并自动侦测技术栈 | - |
|
|
49
|
+
| `ahub project remove <项目名> -c` | 解绑项目并安全清理投影生成物 | `ahub project rm <项目名> -c` |
|
|
50
|
+
| `ahub learn harvest` | 增量脱敏采集多工具近期会话日志 | - |
|
|
51
|
+
| `ahub learn distill` | 提纯会话日志为待审经验卡 | - |
|
|
52
|
+
| `ahub learn review` | 终端交互式逐条审核经验卡 | - |
|
|
53
|
+
| `ahub learn review --auto` | 免交互自动批量审核 (高分晋升, 低分丢弃) | - |
|
|
54
|
+
|
|
55
|
+
> 📌 **命令设计原则**:遵循 CLI 行业惯例(如 `git` / `npm` / `docker` / `kubectl`),**文档与帮助全面优先呈现语义明确的全称命令**;仅提供标准动词缩写(如 `list` -> `ls`、`remove` -> `rm`、`--all` -> `-a`),杜绝反直觉的生硬连环缩写。
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 核心工作流
|
|
60
|
+
|
|
61
|
+
### 1. 初始化(首次使用或换机迁移)
|
|
62
|
+
```bash
|
|
63
|
+
# 首次使用:初始化双 Hub 结构与本机映射
|
|
64
|
+
ahub hub init
|
|
65
|
+
|
|
66
|
+
# 换新电脑:克隆 SoT 仓库后一键重建路径映射与全端软链
|
|
67
|
+
ahub hub restore
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2. 纳管新项目
|
|
71
|
+
```bash
|
|
72
|
+
# 自动检测技术栈(Vue/Spring Boot/TS/Python),自动绑定对应 Profile 与生成覆盖层模版
|
|
73
|
+
ahub project add /path/to/project
|
|
74
|
+
|
|
75
|
+
# 触发首次同步
|
|
76
|
+
ahub sync
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 3. 会话经验学习闭环
|
|
80
|
+
```bash
|
|
81
|
+
# 1. 增量采集并强制脱敏 (Token/密码/凭据)
|
|
82
|
+
ahub learn harvest --since 7d
|
|
83
|
+
|
|
84
|
+
# 2. 提纯为经验待审卡片 (存入 .local/pending/)
|
|
85
|
+
ahub learn distill
|
|
86
|
+
|
|
87
|
+
# 3. 审核卡片(支持终端交互确认,或基于置信度一键自动批量处理)
|
|
88
|
+
ahub learn review --auto
|
|
89
|
+
|
|
90
|
+
# 4. 同步至各端生效
|
|
91
|
+
ahub sync --all
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 4. 项目解绑与清理
|
|
95
|
+
```bash
|
|
96
|
+
# 方式 A:仅解绑项目,保留项目中的现有文件
|
|
97
|
+
ahub project remove <项目名>
|
|
98
|
+
|
|
99
|
+
# 方式 B:解绑并安全清理(剥离 AGENTS.md 托管块,清理 .claude/.agents/.qoder/.trae 等目录)
|
|
100
|
+
# (你在托管块外面手写的内容 100% 完好保留!)
|
|
101
|
+
ahub project remove <项目名> --clean
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 免代码扩展新 Agent 工具
|
|
107
|
+
|
|
108
|
+
如需支持新出的人工智能编码工具(例如 Cursor、Windsurf 等),无需修改源码或重新编译,直接在配置根目录的 `custom-targets.yaml` 中声明:
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
targets:
|
|
112
|
+
cursor:
|
|
113
|
+
description: "Cursor IDE"
|
|
114
|
+
rules:
|
|
115
|
+
single_file: ".cursorrules"
|
|
116
|
+
mcp:
|
|
117
|
+
path: ".cursor/mcp.json"
|
|
118
|
+
skills_dir: ".cursor/skills"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
保存后直接执行 `ahub sync --all` 即可全局自动生效。
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 跨平台说明
|
|
126
|
+
|
|
127
|
+
- **Windows**:技能通过 Directory Junction (`mklink /J`) 软链分发,改一处处处实时生效,免管理员权限。
|
|
128
|
+
- **macOS / Linux**:自动采用原生 Symbolic Link (`ln -s`)。
|
|
129
|
+
- **受限环境**:自动降级为带哈希校验的实体拷贝。
|
package/dist/.gitkeep
ADDED
|
File without changes
|