6aspec 3.0.0-dev.1 → 3.0.0-dev.12
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/.6aspec/rules/biz/code.md +7 -3
- package/.6aspec/rules/brown/brown_analyze_sop.md +7 -2
- package/.6aspec/rules/brown/brown_archive_sop.md +3 -2
- package/.6aspec/rules/brown/brown_continue_sop.md +1 -3
- package/.6aspec/rules/brown/brown_implement_sop.md +9 -6
- package/.6aspec/rules/brown/brown_new_sop.md +10 -6
- package/.6aspec/rules/brown/brown_quick_sop.md +1 -1
- package/.6aspec/rules/brown/brown_rollback_sop.md +3 -7
- package/.6aspec/rules/brown/brown_tasks_sop.md +8 -13
- package/.6aspec/rules/brown/brown_update_sop.md +4 -9
- package/.6aspec/rules/brown/subagents/implementer.md +17 -8
- package/.6aspec/rules/brown/subagents/spec-compliance-reviewer.md +40 -7
- package/.6aspec/rules/common/code-reviewer-agent.md +118 -0
- package/.agents/skills/6aspec-brown-analyze/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-archive/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-continue/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-design/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-explore/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-ff/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-implement/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-list/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-new/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-proposal/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-quick/SKILL.md +10 -0
- package/{.cursor/commands/6aspec/brown/impact.md → .agents/skills/6aspec-brown-review/SKILL.md} +5 -4
- package/.agents/skills/6aspec-brown-rollback/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-specs/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-status/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-tasks/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-update/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-verify/SKILL.md +10 -0
- package/.claude/agents/{implementer.md → 6aspec-brown-implementer.md} +2 -1
- package/.claude/agents/{spec-compliance-reviewer.md → 6aspec-brown-spec-compliance-reviewer.md} +2 -1
- package/.claude/agents/6aspec-code-reviewer.md +7 -0
- package/.claude/commands/6aspec/brown/analyze.md +1 -1
- package/.claude/commands/6aspec/brown/design.md +1 -1
- package/.claude/commands/6aspec/brown/quick.md +1 -1
- package/.claude/commands/6aspec/brown/review.md +1 -1
- package/.claude/commands/6aspec/brown/specs.md +1 -1
- package/.claude/commands/6aspec/brown/tasks.md +1 -1
- package/.claude/commands/6aspec/review.md +56 -0
- package/.codex/agents/6aspec-brown-implementer.md +7 -0
- package/.codex/agents/6aspec-brown-spec-compliance-reviewer.md +7 -0
- package/.codex/agents/6aspec-code-reviewer.md +7 -0
- package/.cursor/agents/6aspec-brown-implementer.md +7 -0
- package/.cursor/agents/6aspec-brown-spec-compliance-reviewer.md +8 -0
- package/.cursor/agents/6aspec-code-reviewer.md +8 -0
- package/.cursor/commands/6aspec-brown-analyze.md +9 -0
- package/.cursor/commands/{6aspec/brown/design.md → 6aspec-brown-design.md} +1 -1
- package/.cursor/commands/{6aspec/brown/quick.md → 6aspec-brown-quick.md} +1 -1
- package/.cursor/commands/{6aspec/brown/review.md → 6aspec-brown-review.md} +1 -1
- package/.cursor/commands/{6aspec/brown/specs.md → 6aspec-brown-specs.md} +1 -1
- package/.cursor/commands/{6aspec/brown/tasks.md → 6aspec-brown-tasks.md} +1 -1
- package/.cursor/commands/6aspec-review.md +56 -0
- package/lib/cli.js +47 -11
- package/lib/installer.js +74 -23
- package/package.json +3 -1
- package/.claude/commands/6aspec/brown/impact.md +0 -11
- package/.claude/commands/6aspec/brown/understand.md +0 -11
- package/.claude/settings.local.json +0 -28
- package/.cursor/commands/6aspec/brown/understand.md +0 -9
- /package/.cursor/commands/{6aspec/brown/archive.md → 6aspec-brown-archive.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/continue.md → 6aspec-brown-continue.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/explore.md → 6aspec-brown-explore.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/ff.md → 6aspec-brown-ff.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/implement.md → 6aspec-brown-implement.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/list.md → 6aspec-brown-list.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/new.md → 6aspec-brown-new.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/proposal.md → 6aspec-brown-proposal.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/rollback.md → 6aspec-brown-rollback.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/status.md → 6aspec-brown-status.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/update.md → 6aspec-brown-update.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/verify.md → 6aspec-brown-verify.md} +0 -0
- /package/.cursor/commands/{6aspec/code.md → 6aspec-code.md} +0 -0
- /package/.cursor/commands/{6aspec/green/archive.md → 6aspec-green-archive.md} +0 -0
- /package/.cursor/commands/{6aspec/green/clarify.md → 6aspec-green-clarify.md} +0 -0
- /package/.cursor/commands/{6aspec/green/continue.md → 6aspec-green-continue.md} +0 -0
- /package/.cursor/commands/{6aspec/green/design.md → 6aspec-green-design.md} +0 -0
- /package/.cursor/commands/{6aspec/green/implement.md → 6aspec-green-implement.md} +0 -0
- /package/.cursor/commands/{6aspec/green/import-model-table.md → 6aspec-green-import-model-table.md} +0 -0
- /package/.cursor/commands/{6aspec/green/init.md → 6aspec-green-init.md} +0 -0
- /package/.cursor/commands/{6aspec/green/model.md → 6aspec-green-model.md} +0 -0
- /package/.cursor/commands/{6aspec/green/new.md → 6aspec-green-new.md} +0 -0
- /package/.cursor/commands/{6aspec/green/rollback.md → 6aspec-green-rollback.md} +0 -0
- /package/.cursor/commands/{6aspec/green/status.md → 6aspec-green-status.md} +0 -0
- /package/.cursor/commands/{6aspec/green/tasks.md → 6aspec-green-tasks.md} +0 -0
- /package/.cursor/commands/{6aspec/green/visual-logic.md → 6aspec-green-visual-logic.md} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-new"
|
|
3
|
+
description: "开始新需求分析(选择流程深度)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-new** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_new_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-proposal"
|
|
3
|
+
description: "创建需求提案(轻量级流程)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-proposal** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_proposal_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-quick"
|
|
3
|
+
description: "需求快速通道(简化流程)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-quick** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_quick_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
package/{.cursor/commands/6aspec/brown/impact.md → .agents/skills/6aspec-brown-review/SKILL.md}
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
name: "6aspec-brown-review"
|
|
3
|
+
description: "实施后评估"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-review** has been activated
|
|
7
8
|
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
8
|
-
3. Read file: `.6aspec/rules/brown/
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_review_sop.md`
|
|
9
10
|
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-rollback"
|
|
3
|
+
description: "回退到上一个阶段"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-rollback** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_rollback_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-specs"
|
|
3
|
+
description: "需求规格定义"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-specs** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_specs_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-status"
|
|
3
|
+
description: "查看需求的当前状态和进度"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-status** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_status_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-tasks"
|
|
3
|
+
description: "任务拆解与排期"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-tasks** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_tasks_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-update"
|
|
3
|
+
description: "非破坏性地更新指定阶段的文档"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-update** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_update_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec-brown-verify"
|
|
3
|
+
description: "验证实现是否符合需求和设计(增强版,借鉴 OpenSpec)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 操作流程
|
|
7
|
+
1. Immediate response upon activation: brown field requirement workflow - **6aspec-brown-verify** has been activated
|
|
8
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
9
|
+
3. Read file: `.6aspec/rules/brown/brown_verify_sop.md`
|
|
10
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "6aspec:review"
|
|
3
|
+
description: 独立代码审查命令,不绑定任何流程,随时可用
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
对当前代码变更进行独立审查。
|
|
9
|
+
|
|
10
|
+
## 步骤
|
|
11
|
+
|
|
12
|
+
### 1. 解析输入
|
|
13
|
+
|
|
14
|
+
用户可以提供以下参数(均可选):
|
|
15
|
+
- `<description>` — 变更描述
|
|
16
|
+
- `--base <SHA>` — 起始 commit(默认:HEAD~1)
|
|
17
|
+
- `--head <SHA>` — 结束 commit(默认:HEAD)
|
|
18
|
+
- `--plan <file>` — 需求/计划文件路径
|
|
19
|
+
|
|
20
|
+
如果没有提供任何参数,使用默认值(HEAD~1..HEAD)。
|
|
21
|
+
|
|
22
|
+
### 2. 确定 git 范围
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git log --oneline -10
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
显示最近 10 条 commit,帮助用户确认审查范围。
|
|
29
|
+
|
|
30
|
+
如果用户未指定 SHA,使用:
|
|
31
|
+
- BASE_SHA = HEAD~1
|
|
32
|
+
- HEAD_SHA = HEAD
|
|
33
|
+
|
|
34
|
+
### 3. 派发 6aspec-code-reviewer agent
|
|
35
|
+
|
|
36
|
+
调用 `6aspec-code-reviewer` agent,传入:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
变更描述:[用户提供的描述,或"最近一次提交的变更"]
|
|
40
|
+
需求/计划:[--plan 指定的文件路径,或"无"]
|
|
41
|
+
BASE_SHA:[base SHA]
|
|
42
|
+
HEAD_SHA:[head SHA]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 4. 展示审查结果
|
|
46
|
+
|
|
47
|
+
直接展示 agent 返回的完整审查报告。
|
|
48
|
+
|
|
49
|
+
## 使用示例
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
/6aspec:review
|
|
53
|
+
/6aspec:review 实现了用户认证功能
|
|
54
|
+
/6aspec:review --base abc1234 --head def5678
|
|
55
|
+
/6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
|
|
56
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 需求澄清与影响面分析(合并原 Understand + Impact)
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
1. Immediate response upon activation: brown field requirement workflow - **Analyze** has been activated
|
|
7
|
+
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
8
|
+
3. Read file: `.6aspec/rules/brown/brown_analyze_sop.md`
|
|
9
|
+
4. Strictly follow the SOP defined in that file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 独立代码审查,不绑定任何流程,随时可用
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
对当前代码变更进行独立审查。
|
|
9
|
+
|
|
10
|
+
## 步骤
|
|
11
|
+
|
|
12
|
+
### 1. 解析输入
|
|
13
|
+
|
|
14
|
+
用户可以提供以下参数(均可选):
|
|
15
|
+
- `<description>` — 变更描述
|
|
16
|
+
- `--base <SHA>` — 起始 commit(默认:HEAD~1)
|
|
17
|
+
- `--head <SHA>` — 结束 commit(默认:HEAD)
|
|
18
|
+
- `--plan <file>` — 需求/计划文件路径
|
|
19
|
+
|
|
20
|
+
如果没有提供任何参数,使用默认值(HEAD~1..HEAD)。
|
|
21
|
+
|
|
22
|
+
### 2. 确定 git 范围
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git log --oneline -10
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
显示最近 10 条 commit,帮助用户确认审查范围。
|
|
29
|
+
|
|
30
|
+
如果用户未指定 SHA,使用:
|
|
31
|
+
- BASE_SHA = HEAD~1
|
|
32
|
+
- HEAD_SHA = HEAD
|
|
33
|
+
|
|
34
|
+
### 3. 派发 6aspec-code-reviewer agent
|
|
35
|
+
|
|
36
|
+
调用 `6aspec-code-reviewer` agent,传入:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
变更描述:[用户提供的描述,或"最近一次提交的变更"]
|
|
40
|
+
需求/计划:[--plan 指定的文件路径,或"无"]
|
|
41
|
+
BASE_SHA:[base SHA]
|
|
42
|
+
HEAD_SHA:[head SHA]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 4. 展示审查结果
|
|
46
|
+
|
|
47
|
+
直接展示 agent 返回的完整审查报告。
|
|
48
|
+
|
|
49
|
+
## 使用示例
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
/6aspec:review
|
|
53
|
+
/6aspec:review 实现了用户认证功能
|
|
54
|
+
/6aspec:review --base abc1234 --head def5678
|
|
55
|
+
/6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
|
|
56
|
+
```
|
package/lib/cli.js
CHANGED
|
@@ -17,14 +17,37 @@ const CONFIG_FILE = '.6aspec/init.json';
|
|
|
17
17
|
const TOOLS = [
|
|
18
18
|
{ id: 'cursor', name: 'Cursor', desc: 'Cursor IDE 配置' },
|
|
19
19
|
{ id: 'claude', name: 'Claude Code', desc: 'Claude Code CLI 配置' },
|
|
20
|
+
{ id: 'codex', name: 'Codex CLI', desc: 'Codex CLI skills/agents 配置' },
|
|
20
21
|
];
|
|
21
22
|
|
|
22
23
|
// Only the 6aspec-owned subdirectory is removed — user's own commands are untouched
|
|
23
24
|
const TOOL_DIRS = {
|
|
24
25
|
cursor: ['.cursor/commands/6aspec'],
|
|
25
26
|
claude: ['.claude/commands/6aspec', '.claude/agents'],
|
|
27
|
+
codex: [
|
|
28
|
+
'.agents/skills/6aspec-brown-new',
|
|
29
|
+
'.agents/skills/6aspec-brown-explore',
|
|
30
|
+
'.agents/skills/6aspec-brown-analyze',
|
|
31
|
+
'.agents/skills/6aspec-brown-proposal',
|
|
32
|
+
'.agents/skills/6aspec-brown-specs',
|
|
33
|
+
'.agents/skills/6aspec-brown-design',
|
|
34
|
+
'.agents/skills/6aspec-brown-tasks',
|
|
35
|
+
'.agents/skills/6aspec-brown-implement',
|
|
36
|
+
'.agents/skills/6aspec-brown-verify',
|
|
37
|
+
'.agents/skills/6aspec-brown-review',
|
|
38
|
+
'.agents/skills/6aspec-brown-archive',
|
|
39
|
+
'.agents/skills/6aspec-brown-continue',
|
|
40
|
+
'.agents/skills/6aspec-brown-status',
|
|
41
|
+
'.agents/skills/6aspec-brown-list',
|
|
42
|
+
'.agents/skills/6aspec-brown-ff',
|
|
43
|
+
'.agents/skills/6aspec-brown-quick',
|
|
44
|
+
'.agents/skills/6aspec-brown-rollback',
|
|
45
|
+
'.agents/skills/6aspec-brown-update',
|
|
46
|
+
'.codex/agents/6aspec-brown-implementer.md',
|
|
47
|
+
'.codex/agents/6aspec-brown-spec-compliance-reviewer.md',
|
|
48
|
+
'.codex/agents/6aspec-code-reviewer.md',
|
|
49
|
+
],
|
|
26
50
|
};
|
|
27
|
-
|
|
28
51
|
// ─── Welcome Screen with Animation ──────────────────────────────────
|
|
29
52
|
|
|
30
53
|
// Braille spinner frames
|
|
@@ -272,15 +295,23 @@ function writeConfig(targetDir, tools) {
|
|
|
272
295
|
|
|
273
296
|
// ─── Tool removal ───────────────────────────────────────────────────
|
|
274
297
|
|
|
275
|
-
function
|
|
276
|
-
if (!fs.existsSync(
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
298
|
+
function removePathRecursive(targetPath) {
|
|
299
|
+
if (!fs.existsSync(targetPath)) return;
|
|
300
|
+
const stat = fs.lstatSync(targetPath);
|
|
301
|
+
|
|
302
|
+
if (stat.isDirectory()) {
|
|
303
|
+
const entries = fs.readdirSync(targetPath, { withFileTypes: true });
|
|
304
|
+
for (const entry of entries) {
|
|
305
|
+
const full = path.join(targetPath, entry.name);
|
|
306
|
+
if (entry.isDirectory()) removePathRecursive(full);
|
|
307
|
+
else fs.unlinkSync(full);
|
|
308
|
+
}
|
|
309
|
+
fs.rmdirSync(targetPath);
|
|
310
|
+
return;
|
|
282
311
|
}
|
|
283
|
-
|
|
312
|
+
|
|
313
|
+
// file or symlink
|
|
314
|
+
fs.unlinkSync(targetPath);
|
|
284
315
|
}
|
|
285
316
|
|
|
286
317
|
function removeToolFiles(targetDir, tools) {
|
|
@@ -289,13 +320,12 @@ function removeToolFiles(targetDir, tools) {
|
|
|
289
320
|
for (const rel of dirs) {
|
|
290
321
|
const full = path.join(targetDir, rel);
|
|
291
322
|
if (fs.existsSync(full)) {
|
|
292
|
-
|
|
323
|
+
removePathRecursive(full);
|
|
293
324
|
console.log(`${GREEN}[INFO]${RESET} 已删除 ${rel}`);
|
|
294
325
|
}
|
|
295
326
|
}
|
|
296
327
|
}
|
|
297
328
|
}
|
|
298
|
-
|
|
299
329
|
// Simple y/N prompt (readline, no raw mode needed)
|
|
300
330
|
function promptConfirm(question) {
|
|
301
331
|
return new Promise((resolve) => {
|
|
@@ -380,6 +410,9 @@ async function init(args) {
|
|
|
380
410
|
case 'claude':
|
|
381
411
|
installer.installClaude();
|
|
382
412
|
break;
|
|
413
|
+
case 'codex':
|
|
414
|
+
installer.installCodex();
|
|
415
|
+
break;
|
|
383
416
|
}
|
|
384
417
|
}
|
|
385
418
|
|
|
@@ -439,6 +472,9 @@ async function update(args) {
|
|
|
439
472
|
case 'claude':
|
|
440
473
|
installer.installClaude();
|
|
441
474
|
break;
|
|
475
|
+
case 'codex':
|
|
476
|
+
installer.installCodex();
|
|
477
|
+
break;
|
|
442
478
|
}
|
|
443
479
|
}
|
|
444
480
|
|