rayprism 0.1.0 → 0.2.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 +16 -23
- package/bin/rayprism.js +6 -8
- package/package.json +1 -1
- package/src/commands/init.js +5 -19
- package/src/commands/list.js +1 -1
- package/src/utils/constants.js +2 -2
package/README.md
CHANGED
|
@@ -5,18 +5,24 @@
|
|
|
5
5
|
## 快速开始
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
#
|
|
8
|
+
# 一行创建项目(自动下载,无需安装)
|
|
9
9
|
npx rayprism init dev my-app
|
|
10
10
|
|
|
11
|
-
# 方式二:全局安装(长期使用)
|
|
12
|
-
npm install -g rayprism
|
|
13
|
-
rayprism init dev my-app --git
|
|
14
|
-
|
|
15
11
|
# 进入项目,开始工作
|
|
16
12
|
cd ~/Projects/my-app
|
|
17
13
|
```
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
其他分支同理:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx rayprism init ink my-blog # 内容创作
|
|
19
|
+
npx rayprism init pro my-report # 专业文档
|
|
20
|
+
npx rayprism init ops my-infra # 运维管理
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
> 💡 **Tips**
|
|
24
|
+
> - 首次运行会自动从 GitHub 下载模板到 `~/.rayprism/framework/`,后续使用缓存
|
|
25
|
+
> - 频繁使用?全局安装更方便:`npm i -g rayprism`,之后直接 `rayprism init ...`
|
|
20
26
|
|
|
21
27
|
## 核心概念
|
|
22
28
|
|
|
@@ -31,7 +37,7 @@ RayPrism/(框架,只读) 实例化项目(可写)
|
|
|
31
37
|
======================== ========================
|
|
32
38
|
branches/ my-app/
|
|
33
39
|
├── pro/ ├── framework/ → branches/dev/ 🔗
|
|
34
|
-
├──
|
|
40
|
+
├── ink/ rayprism init ├── .agents/skills/ (合并视图)
|
|
35
41
|
├── dev/ ──────────────→ ├── .claude/rules/ (合并视图)
|
|
36
42
|
└── ops/ ├── overrides/ (自定义扩展)
|
|
37
43
|
└── workspace/ (所有产出)
|
|
@@ -42,7 +48,7 @@ branches/ my-app/
|
|
|
42
48
|
| 分支 | 适合场景 | 主力技能 |
|
|
43
49
|
|------|---------|---------|
|
|
44
50
|
| **pro** | 知识整理 / Obsidian 笔记 | obsidian-markdown, obsidian-bases, json-canvas |
|
|
45
|
-
| **
|
|
51
|
+
| **ink** | 公众号 / 内容创作 | ray-content-wechat-generating, ray-multi-party-mode |
|
|
46
52
|
| **dev** | 工程开发 / 代码 | ray-util-antigravity-bridging, vercel-react-best-practices |
|
|
47
53
|
| **ops** | 系统运维 / 排障 | tavily-search, agent-browser |
|
|
48
54
|
|
|
@@ -56,17 +62,6 @@ rayprism upgrade # 升级框架到最新版本
|
|
|
56
62
|
rayprism unregister <name> # 从注册表移除项目
|
|
57
63
|
```
|
|
58
64
|
|
|
59
|
-
## 安装
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
# npx(免安装)
|
|
63
|
-
npx rayprism <command>
|
|
64
|
-
|
|
65
|
-
# 全局安装
|
|
66
|
-
npm install -g rayprism
|
|
67
|
-
rayprism <command>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
65
|
## 框架结构
|
|
71
66
|
|
|
72
67
|
```
|
|
@@ -78,19 +73,17 @@ RayPrism/
|
|
|
78
73
|
├── README.md ← 当前文件
|
|
79
74
|
├── AGENTS.md ← AI Agent 主规则
|
|
80
75
|
├── CLAUDE.md ← Claude Code 规则入口
|
|
81
|
-
├── GEMINI.md ← Gemini CLI 规则入口
|
|
82
|
-
│
|
|
83
|
-
├── setup/ ← 旧版 bash 工具(保留兼容)
|
|
84
76
|
│
|
|
85
77
|
└── branches/ ← 四分支纯净模板(只读)
|
|
86
78
|
├── pro/ ← 知识管理 / Obsidian
|
|
87
|
-
├──
|
|
79
|
+
├── ink/ ← 内容创作流水线
|
|
88
80
|
├── dev/ ← 工程开发
|
|
89
81
|
└── ops/ ← 系统运维
|
|
90
82
|
```
|
|
91
83
|
|
|
92
84
|
## 文档
|
|
93
85
|
|
|
86
|
+
- [**使用手册**](setup/README.md) — 完整的一步一步指南
|
|
94
87
|
- [验证清单](setup/checklist.md) — 初始化后的检查项
|
|
95
88
|
|
|
96
89
|
## License
|
package/bin/rayprism.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* rayprism — Multi-branch AI Agent Framework CLI
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* rayprism init <branch> <name> [--path /dir]
|
|
7
|
+
* rayprism init <branch> <name> [--path /dir]
|
|
8
8
|
* rayprism list
|
|
9
9
|
* rayprism projects
|
|
10
10
|
* rayprism status
|
|
@@ -24,18 +24,18 @@ const HELP = `
|
|
|
24
24
|
\x1b[1mrayprism — Multi-branch AI Agent Framework\x1b[0m
|
|
25
25
|
|
|
26
26
|
命令:
|
|
27
|
-
rayprism init <branch> <name> [--path /dir]
|
|
27
|
+
rayprism init <branch> <name> [--path /dir] 初始化新项目
|
|
28
28
|
rayprism list 列出可用分支
|
|
29
29
|
rayprism projects 列出所有已注册项目
|
|
30
30
|
rayprism status 查看当前项目信息
|
|
31
31
|
rayprism upgrade 更新框架符号链接
|
|
32
32
|
rayprism unregister <name> 从注册表移除项目
|
|
33
33
|
|
|
34
|
-
分支: pro |
|
|
34
|
+
分支: pro | ink | dev | ops
|
|
35
35
|
|
|
36
36
|
示例:
|
|
37
37
|
npx rayprism init dev my-app
|
|
38
|
-
npx rayprism init
|
|
38
|
+
npx rayprism init ink my-blog
|
|
39
39
|
rayprism list
|
|
40
40
|
rayprism projects
|
|
41
41
|
`;
|
|
@@ -50,7 +50,7 @@ async function main() {
|
|
|
50
50
|
const branch = args[1];
|
|
51
51
|
const name = args[2];
|
|
52
52
|
if (!branch || !name) {
|
|
53
|
-
log.err('用法: rayprism init <branch> <name> [--path /dir]
|
|
53
|
+
log.err('用法: rayprism init <branch> <name> [--path /dir]');
|
|
54
54
|
}
|
|
55
55
|
const opts = parseInitOpts(args.slice(3));
|
|
56
56
|
await init(branch, name, opts);
|
|
@@ -102,12 +102,10 @@ async function main() {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
function parseInitOpts(args) {
|
|
105
|
-
const opts = { path: ''
|
|
105
|
+
const opts = { path: '' };
|
|
106
106
|
for (let i = 0; i < args.length; i++) {
|
|
107
107
|
if (args[i] === '--path' && args[i + 1]) {
|
|
108
108
|
opts.path = args[++i];
|
|
109
|
-
} else if (args[i] === '--git') {
|
|
110
|
-
opts.git = true;
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
return opts;
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* rayprism init <branch> <name> [--path /dir]
|
|
2
|
+
* rayprism init <branch> <name> [--path /dir]
|
|
3
3
|
*
|
|
4
4
|
* Full port of rp.sh cmd_init logic to Node.js.
|
|
5
5
|
*/
|
|
@@ -196,7 +196,6 @@ export async function init(branch, projectName, opts = {}) {
|
|
|
196
196
|
console.log(` 项目路径 : ${projectPath}`);
|
|
197
197
|
console.log(` 框架来源 : ${branchDir}`);
|
|
198
198
|
console.log(` 模板版本 : v${templateVer}`);
|
|
199
|
-
if (opts.git) console.log(' Git 初始 : ✅');
|
|
200
199
|
console.log('');
|
|
201
200
|
|
|
202
201
|
mkdirSync(projectPath, { recursive: true });
|
|
@@ -214,12 +213,10 @@ export async function init(branch, projectName, opts = {}) {
|
|
|
214
213
|
// ③ Link hidden dirs (merge mode)
|
|
215
214
|
linkHiddenDirs(branch, branchDir, projectPath);
|
|
216
215
|
|
|
217
|
-
// ④ Link CLAUDE.md
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
log.ok(`链接 ${f}`);
|
|
222
|
-
}
|
|
216
|
+
// ④ Link CLAUDE.md
|
|
217
|
+
if (existsSync(join(branchDir, 'CLAUDE.md'))) {
|
|
218
|
+
symlinkSync(join('framework', 'CLAUDE.md'), join(projectPath, 'CLAUDE.md'));
|
|
219
|
+
log.ok('链接 CLAUDE.md');
|
|
223
220
|
}
|
|
224
221
|
|
|
225
222
|
// ⑤ workspace/ directories
|
|
@@ -278,16 +275,6 @@ export async function init(branch, projectName, opts = {}) {
|
|
|
278
275
|
}
|
|
279
276
|
}
|
|
280
277
|
|
|
281
|
-
// ⑫ Git init
|
|
282
|
-
if (opts.git) {
|
|
283
|
-
log.info('初始化 Git 仓库...');
|
|
284
|
-
execSync('git init -q', { cwd: projectPath, stdio: 'pipe' });
|
|
285
|
-
execSync('git add -A', { cwd: projectPath, stdio: 'pipe' });
|
|
286
|
-
execSync(`git commit -q -m "init: rayprism init ${branch} ${projectName} (v${templateVer})"`, {
|
|
287
|
-
cwd: projectPath, stdio: 'pipe',
|
|
288
|
-
});
|
|
289
|
-
log.ok('Git 仓库已初始化并完成首次提交');
|
|
290
|
-
}
|
|
291
278
|
|
|
292
279
|
// Done
|
|
293
280
|
console.log('');
|
|
@@ -354,7 +341,6 @@ framework
|
|
|
354
341
|
.agents
|
|
355
342
|
.claude
|
|
356
343
|
CLAUDE.md
|
|
357
|
-
GEMINI.md
|
|
358
344
|
|
|
359
345
|
# 临时产出
|
|
360
346
|
workspace/logs/
|
package/src/commands/list.js
CHANGED
package/src/utils/constants.js
CHANGED
|
@@ -16,11 +16,11 @@ export const GITHUB_REPO = '961882/RayPrism';
|
|
|
16
16
|
export const GITHUB_TARBALL = `https://github.com/${GITHUB_REPO}/archive/refs/heads/main.tar.gz`;
|
|
17
17
|
|
|
18
18
|
// ─── Branch definitions ─────────────────────────────────────────────
|
|
19
|
-
export const VALID_BRANCHES = ['pro', '
|
|
19
|
+
export const VALID_BRANCHES = ['pro', 'ink', 'dev', 'ops'];
|
|
20
20
|
|
|
21
21
|
export const BRANCH_META = {
|
|
22
22
|
pro: { desc: '专业文档 / 策略规划 / 分析报告', dirs: 'reports strategy analysis drafts references' },
|
|
23
|
-
|
|
23
|
+
ink: { desc: '内容创作 / 公众号 / 社媒运营', dirs: 'drafts published assets scheduled archive' },
|
|
24
24
|
dev: { desc: '软件开发 / 代码 / 架构设计', dirs: 'src docs tests artifacts experiments' },
|
|
25
25
|
ops: { desc: '运维 / 自动化 / 系统管理', dirs: 'scripts configs runbooks logs incidents' },
|
|
26
26
|
};
|