tools-cc 1.0.5 → 1.0.7
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/CHANGELOG.md +38 -0
- package/CHANGELOG_en.md +36 -0
- package/README.md +19 -11
- package/README_en.md +56 -4
- package/dist/commands/help.js +34 -6
- package/dist/commands/use.d.ts +1 -1
- package/dist/commands/use.js +18 -20
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/commands/help.ts +34 -6
- package/src/commands/use.ts +411 -413
- package/src/index.ts +11 -12
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的所有重要变更都将记录在此文件中。
|
|
4
4
|
|
|
5
|
+
## [1.0.7] - 2026-03-02
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- 修复 `tools-cc update` 命令无法正确识别旧版数组格式配置的问题(sources 为数组时会被错误解析为索引)
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- 更新帮助文档,完善命令说明和示例
|
|
12
|
+
|
|
13
|
+
## [1.0.6] - 2026-03-02
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- 新增无参数交互式源选择:`tools-cc use` 直接运行显示源列表供选择
|
|
17
|
+
- 新增配置文件导入功能:`tools-cc use -c config.json` 从导出的配置文件快速恢复项目配置
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- 重构 `use` 命令,统一支持多种模式(配置导入、交互选择、路径语法、整体导入、点模式)
|
|
21
|
+
- 优化交互选择模式,支持分组展示 skills/commands/agents
|
|
22
|
+
|
|
23
|
+
## [1.0.5] - 2026-02-28
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- 新增部分导入功能:支持路径语法选择特定的 skills/commands/agents
|
|
27
|
+
- `tools-cc use source:skills/xxx` 只导入指定 skill
|
|
28
|
+
- `tools-cc use source:commands/` 导入所有 commands
|
|
29
|
+
- 新增 `--ls` 模式:`tools-cc use --ls` 列出源内容而不创建链接
|
|
30
|
+
- 新增 `tools-cc export` 命令:导出项目或全局配置到 JSON 文件
|
|
31
|
+
- `tools-cc export` 导出项目配置
|
|
32
|
+
- `tools-cc export -g` 导出全局配置
|
|
33
|
+
- 新增 `codex` 工具支持,创建 `.codex -> .toolscc` 符号链接
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- 重构 `use` 命令,支持路径语法和 `--ls` 模式
|
|
37
|
+
- 重构 `useSource` 核心逻辑,支持部分导入
|
|
38
|
+
|
|
39
|
+
### Removed
|
|
40
|
+
- 删除临时设计和实现文档 (docs/plans 目录)
|
|
41
|
+
|
|
5
42
|
## [1.0.4] - 2026-02-28
|
|
6
43
|
|
|
7
44
|
### Added
|
|
@@ -61,6 +98,7 @@
|
|
|
61
98
|
| claude | `.claude` |
|
|
62
99
|
| codebuddy | `.codebuddy` |
|
|
63
100
|
| opencode | `.opencode` |
|
|
101
|
+
| codex | `.codex` |
|
|
64
102
|
|
|
65
103
|
---
|
|
66
104
|
|
package/CHANGELOG_en.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.7] - 2026-03-02
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Fixed `tools-cc update` command failing to recognize legacy array format config (sources array was incorrectly parsed as indices)
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated help documentation with improved command descriptions and examples
|
|
12
|
+
|
|
13
|
+
## [1.0.6] - 2026-03-02
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Added interactive source selection: `tools-cc use` without arguments shows source list for selection
|
|
17
|
+
- Added config import feature: `tools-cc use -c config.json` to quickly restore project config from exported file
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- Refactored `use` command to support multiple modes (config import, interactive selection, path syntax, full import, dot mode)
|
|
21
|
+
- Improved interactive selection mode with grouped display of skills/commands/agents
|
|
22
|
+
|
|
23
|
+
## [1.0.5] - 2026-02-28
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- Added partial import feature: support path syntax to select specific skills/commands/agents
|
|
27
|
+
- `tools-cc use source:skills/xxx` import only specified skill
|
|
28
|
+
- `tools-cc use source:commands/` import all commands
|
|
29
|
+
- Added `-ls` mode: `tools-cc use -ls` list source content without creating links
|
|
30
|
+
- Added `tools-cc export` command: export project or global config to JSON file
|
|
31
|
+
- `tools-cc export` export project config
|
|
32
|
+
- `tools-cc export -g` export global config
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- Refactored `use` command to support path syntax and `-ls` mode
|
|
36
|
+
- Refactored `useSource` core logic to support partial import
|
|
37
|
+
|
|
38
|
+
### Removed
|
|
39
|
+
- Removed temporary design and implementation docs (docs/plans directory)
|
|
40
|
+
|
|
5
41
|
## [1.0.4] - 2026-02-28
|
|
6
42
|
|
|
7
43
|
### Added
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# tools-cc
|
|
2
2
|
|
|
3
|
-
一个用于统一管理多个 AI 编程工具(iflow、claude、codebuddy、opencode 等)的 skills/commands/agents 配置的 CLI 工具。通过符号链接机制,避免在多个工具间重复配置。
|
|
3
|
+
一个用于统一管理多个 AI 编程工具(iflow、claude、codebuddy、opencode、codex 等)的 skills/commands/agents 配置的 CLI 工具。通过符号链接机制,避免在多个工具间重复配置。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -34,13 +34,16 @@ tools-cc -s list
|
|
|
34
34
|
|
|
35
35
|
# 4. 在项目中启用配置源并创建链接
|
|
36
36
|
cd my-project
|
|
37
|
-
tools-cc use my-skills -p iflow claude
|
|
37
|
+
tools-cc use my-skills -p iflow claude codex
|
|
38
38
|
|
|
39
|
-
# 4a.
|
|
39
|
+
# 4a. 无参数运行,交互式选择源
|
|
40
|
+
tools-cc use # 显示源列表供选择
|
|
41
|
+
|
|
42
|
+
# 4b. 或使用部分引入(只引入需要的 skills/commands/agents)
|
|
40
43
|
tools-cc use my-skills/skills/a-skill
|
|
41
|
-
tools-cc use my-skills
|
|
44
|
+
tools-cc use my-skills --ls # 交互式选择内容
|
|
42
45
|
|
|
43
|
-
#
|
|
46
|
+
# 4c. 或从配置文件快速导入
|
|
44
47
|
tools-cc use -c project-config.json
|
|
45
48
|
|
|
46
49
|
# 5. 查看项目状态
|
|
@@ -117,9 +120,12 @@ tools-cc export [options] # 导出项目或全局配置
|
|
|
117
120
|
#### `use` 命令详解
|
|
118
121
|
|
|
119
122
|
```bash
|
|
123
|
+
# 无参数运行:交互式选择源
|
|
124
|
+
tools-cc use # 显示可用源列表供选择
|
|
125
|
+
|
|
120
126
|
# 整源引入(全部 skills/commands/agents)
|
|
121
127
|
tools-cc use my-skills
|
|
122
|
-
tools-cc use my-skills -p iflow claude # 指定工具链接
|
|
128
|
+
tools-cc use my-skills -p iflow claude codex # 指定工具链接
|
|
123
129
|
|
|
124
130
|
# 部分引入(路径语法)
|
|
125
131
|
tools-cc use my-skills/skills/a-skill # 引入单个 skill
|
|
@@ -127,14 +133,14 @@ tools-cc use my-skills/commands/test # 引入单个 command
|
|
|
127
133
|
tools-cc use my-skills/agents/reviewer # 引入单个 agent
|
|
128
134
|
tools-cc use my-skills/skills/a my-skills/commands/test # 引入多项
|
|
129
135
|
|
|
130
|
-
#
|
|
131
|
-
tools-cc use my-skills
|
|
136
|
+
# 交互式选择内容(--ls 参数)
|
|
137
|
+
tools-cc use my-skills --ls # 分组展示,勾选引入
|
|
132
138
|
|
|
133
139
|
# 从配置文件导入
|
|
134
140
|
tools-cc use -c project-config.json # 快速恢复项目配置
|
|
135
141
|
|
|
136
142
|
# 使用 "." 表示当前项目已配置的源(只创建链接,不复制内容)
|
|
137
|
-
tools-cc use . -p iflow claude
|
|
143
|
+
tools-cc use . -p iflow claude codex
|
|
138
144
|
```
|
|
139
145
|
|
|
140
146
|
#### `export` 命令详解
|
|
@@ -178,6 +184,7 @@ tools-cc --version # 显示版本号
|
|
|
178
184
|
| claude | `.claude` |
|
|
179
185
|
| codebuddy | `.codebuddy` |
|
|
180
186
|
| opencode | `.opencode` |
|
|
187
|
+
| codex | `.codex` |
|
|
181
188
|
|
|
182
189
|
## 配置源结构
|
|
183
190
|
|
|
@@ -224,7 +231,8 @@ my-project/
|
|
|
224
231
|
│ └── agents/
|
|
225
232
|
│ └── my-skills/
|
|
226
233
|
├── .iflow -> .toolscc # 符号链接
|
|
227
|
-
|
|
234
|
+
├── .claude -> .toolscc
|
|
235
|
+
└── .codex -> .toolscc
|
|
228
236
|
```
|
|
229
237
|
|
|
230
238
|
## 配置文件
|
|
@@ -258,7 +266,7 @@ my-project/
|
|
|
258
266
|
"agents": ["*"]
|
|
259
267
|
}
|
|
260
268
|
},
|
|
261
|
-
"links": ["iflow", "claude"]
|
|
269
|
+
"links": ["iflow", "claude", "codex"]
|
|
262
270
|
}
|
|
263
271
|
```
|
|
264
272
|
|
package/README_en.md
CHANGED
|
@@ -34,7 +34,8 @@ tools-cc -s list
|
|
|
34
34
|
|
|
35
35
|
# 4. Enable configuration sources in a project and create links
|
|
36
36
|
cd my-project
|
|
37
|
-
tools-cc use
|
|
37
|
+
tools-cc use # Interactive source selection
|
|
38
|
+
tools-cc use my-skills -p iflow claude codex
|
|
38
39
|
|
|
39
40
|
# 5. View project status
|
|
40
41
|
tools-cc status
|
|
@@ -99,11 +100,50 @@ tools-cc sources scan # Scan sourcesDir to auto-discover and
|
|
|
99
100
|
### Project Configuration
|
|
100
101
|
|
|
101
102
|
```bash
|
|
102
|
-
tools-cc use [sources...] [
|
|
103
|
+
tools-cc use [sources...] [options] # Enable configuration sources and create symbolic links
|
|
103
104
|
tools-cc update [sources...] # Sync configuration source content to project .toolscc directory
|
|
104
105
|
tools-cc list # List enabled configuration sources
|
|
105
106
|
tools-cc rm <source> # Disable configuration source
|
|
106
107
|
tools-cc status # View project status
|
|
108
|
+
tools-cc export [options] # Export project or global config
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### `use` Command Details
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# No arguments: interactive source selection
|
|
115
|
+
tools-cc use # Show available sources for selection
|
|
116
|
+
|
|
117
|
+
# Full source import (all skills/commands/agents)
|
|
118
|
+
tools-cc use my-skills
|
|
119
|
+
tools-cc use my-skills -p iflow claude codex # Specify tool links
|
|
120
|
+
|
|
121
|
+
# Partial import (path syntax)
|
|
122
|
+
tools-cc use my-skills/skills/a-skill # Import single skill
|
|
123
|
+
tools-cc use my-skills/commands/test # Import single command
|
|
124
|
+
tools-cc use my-skills/agents/reviewer # Import single agent
|
|
125
|
+
tools-cc use my-skills/skills/a my-skills/commands/test # Import multiple
|
|
126
|
+
|
|
127
|
+
# Interactive content selection (--ls flag)
|
|
128
|
+
tools-cc use my-skills --ls # Grouped display, checkbox selection
|
|
129
|
+
|
|
130
|
+
# Import from config file
|
|
131
|
+
tools-cc use -c project-config.json # Quick restore project config
|
|
132
|
+
|
|
133
|
+
# Use "." for existing project sources (only create links, no copy)
|
|
134
|
+
tools-cc use . -p iflow claude codex
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### `export` Command Details
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Export project config
|
|
141
|
+
tools-cc export # Export to .toolscc-export.json
|
|
142
|
+
tools-cc export -o my-config.json # Specify output path
|
|
143
|
+
|
|
144
|
+
# Export global config
|
|
145
|
+
tools-cc export --global # Export to .toolscc-global-export.json
|
|
146
|
+
tools-cc export --global -o global.json # Specify output path
|
|
107
147
|
```
|
|
108
148
|
|
|
109
149
|
### Config Management
|
|
@@ -135,6 +175,7 @@ tools-cc --version # Display version number
|
|
|
135
175
|
| claude | `.claude` |
|
|
136
176
|
| codebuddy | `.codebuddy` |
|
|
137
177
|
| opencode | `.opencode` |
|
|
178
|
+
| codex | `.codex` |
|
|
138
179
|
|
|
139
180
|
## Configuration Source Structure
|
|
140
181
|
|
|
@@ -208,11 +249,22 @@ my-project/
|
|
|
208
249
|
|
|
209
250
|
```json
|
|
210
251
|
{
|
|
211
|
-
"sources":
|
|
212
|
-
|
|
252
|
+
"sources": {
|
|
253
|
+
"my-skills": {
|
|
254
|
+
"skills": ["a-skill", "b-skill"],
|
|
255
|
+
"commands": ["test"],
|
|
256
|
+
"agents": ["*"]
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"links": ["iflow", "claude", "codex"]
|
|
213
260
|
}
|
|
214
261
|
```
|
|
215
262
|
|
|
263
|
+
**Notes:**
|
|
264
|
+
- `sources` records specific content imported from each source
|
|
265
|
+
- `["*"]` means import all content of that type
|
|
266
|
+
- `[]` means import nothing of that type
|
|
267
|
+
|
|
216
268
|
## License
|
|
217
269
|
|
|
218
270
|
MIT
|
package/dist/commands/help.js
CHANGED
|
@@ -14,7 +14,7 @@ ${chalk_1.default.bold.cyan('═════════════════
|
|
|
14
14
|
|
|
15
15
|
${chalk_1.default.bold('DESCRIPTION / 描述')}
|
|
16
16
|
A CLI tool for managing skills/commands/agents configurations across multiple
|
|
17
|
-
AI coding tools (iflow, claude, codebuddy, opencode, etc.) via symlinks.
|
|
17
|
+
AI coding tools (iflow, claude, codebuddy, opencode, codex, etc.) via symlinks.
|
|
18
18
|
|
|
19
19
|
一个用于统一管理多个 AI 编程工具配置的命令行工具,通过符号链接机制避免重复配置。
|
|
20
20
|
|
|
@@ -28,7 +28,8 @@ ${chalk_1.default.bold('COMMANDS / 命令')}
|
|
|
28
28
|
tools-cc sources add <name> <path-or-url> Add a source / 添加配置源
|
|
29
29
|
tools-cc sources list, ls List all sources / 列出所有配置源
|
|
30
30
|
tools-cc sources remove, rm <name> Remove a source / 移除配置源
|
|
31
|
-
tools-cc sources update, up [name]
|
|
31
|
+
tools-cc sources update, up [name] git pull update / 更新源代码
|
|
32
|
+
tools-cc sources scan Scan dir for sources / 扫描发现新源
|
|
32
33
|
|
|
33
34
|
${chalk_1.default.gray('Shortcut: -s')} e.g., tools-cc -s add my-skills https://github.com/user/skills.git
|
|
34
35
|
|
|
@@ -40,21 +41,33 @@ ${chalk_1.default.bold('COMMANDS / 命令')}
|
|
|
40
41
|
${chalk_1.default.gray('Shortcut: -c')} e.g., tools-cc -c set sourcesDir D:/skills
|
|
41
42
|
|
|
42
43
|
${chalk_1.default.cyan('Project Commands / 项目命令')}
|
|
43
|
-
tools-cc use [sources...] [
|
|
44
|
+
tools-cc use [sources...] [options] Use sources in project / 在项目中启用配置源
|
|
45
|
+
tools-cc update [sources...] Sync source content to project / 同步内容到项目
|
|
44
46
|
tools-cc list List used sources / 列出已启用的配置源
|
|
45
47
|
tools-cc rm <source> Remove source from project / 禁用配置源
|
|
46
48
|
tools-cc status Show project status / 显示项目状态
|
|
49
|
+
tools-cc export [options] Export config / 导出配置
|
|
47
50
|
|
|
48
51
|
${chalk_1.default.cyan('Help / 帮助')}
|
|
49
52
|
tools-cc help Show this help / 显示此帮助信息
|
|
50
53
|
tools-cc --help, -h Show command help / 显示命令帮助
|
|
51
54
|
tools-cc --version, -V Show version / 显示版本号
|
|
52
55
|
|
|
56
|
+
${chalk_1.default.bold('USE OPTIONS / use 命令选项')}
|
|
57
|
+
-p, --tools <tools...> Target tools (iflow, claude, etc.) / 目标工具
|
|
58
|
+
--ls Interactive selection / 交互式选择内容
|
|
59
|
+
-c, --config <file> Import from config file / 从配置文件导入
|
|
60
|
+
|
|
61
|
+
${chalk_1.default.bold('EXPORT OPTIONS / export 命令选项')}
|
|
62
|
+
-o, --output <file> Output file path / 输出文件路径
|
|
63
|
+
--global Export global config / 导出全局配置
|
|
64
|
+
|
|
53
65
|
${chalk_1.default.bold('SUPPORTED TOOLS / 支持的工具')}
|
|
54
66
|
iflow → .iflow
|
|
55
67
|
claude → .claude
|
|
56
68
|
codebuddy → .codebuddy
|
|
57
69
|
opencode → .opencode
|
|
70
|
+
codex → .codex
|
|
58
71
|
|
|
59
72
|
${chalk_1.default.bold('EXAMPLES / 示例')}
|
|
60
73
|
${chalk_1.default.gray('# Add a git source / 添加 Git 配置源')}
|
|
@@ -63,21 +76,36 @@ ${chalk_1.default.bold('EXAMPLES / 示例')}
|
|
|
63
76
|
${chalk_1.default.gray('# Add a local source / 添加本地配置源')}
|
|
64
77
|
tools-cc sources add local-skills D:/path/to/local-skills
|
|
65
78
|
|
|
79
|
+
${chalk_1.default.gray('# Scan for sources / 扫描发现配置源')}
|
|
80
|
+
tools-cc sources scan
|
|
81
|
+
|
|
66
82
|
${chalk_1.default.gray('# List all sources / 列出所有配置源')}
|
|
67
83
|
tools-cc sources list
|
|
68
84
|
|
|
69
85
|
${chalk_1.default.gray('# Use sources in project / 在项目中启用配置源')}
|
|
70
|
-
tools-cc use my-skills -p iflow claude
|
|
86
|
+
tools-cc use my-skills -p iflow claude codex
|
|
87
|
+
|
|
88
|
+
${chalk_1.default.gray('# Interactive selection / 交互式选择内容')}
|
|
89
|
+
tools-cc use my-skills --ls
|
|
90
|
+
|
|
91
|
+
${chalk_1.default.gray('# Import from config file / 从配置文件导入')}
|
|
92
|
+
tools-cc use -c project-config.json
|
|
93
|
+
|
|
94
|
+
${chalk_1.default.gray('# Sync source content to project / 同步源内容到项目')}
|
|
95
|
+
tools-cc update my-skills
|
|
71
96
|
|
|
72
97
|
${chalk_1.default.gray('# Check project status / 检查项目状态')}
|
|
73
98
|
tools-cc status
|
|
74
99
|
|
|
100
|
+
${chalk_1.default.gray('# Export project config / 导出项目配置')}
|
|
101
|
+
tools-cc export -o my-config.json
|
|
102
|
+
|
|
75
103
|
${chalk_1.default.gray('# Show full configuration / 显示完整配置')}
|
|
76
104
|
tools-cc config list
|
|
77
105
|
|
|
78
106
|
${chalk_1.default.bold('MORE INFO / 更多信息')}
|
|
79
|
-
GitHub: https://github.com/
|
|
80
|
-
Docs: https://github.com/
|
|
107
|
+
GitHub: https://github.com/q759410559/tools-cc
|
|
108
|
+
Docs: https://github.com/q759410559/tools-cc#readme
|
|
81
109
|
|
|
82
110
|
${chalk_1.default.bold.cyan('═══════════════════════════════════════════════════════════════════════════')}
|
|
83
111
|
`);
|
package/dist/commands/use.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface UseOptions {
|
|
|
11
11
|
*
|
|
12
12
|
* 支持多种模式:
|
|
13
13
|
* 1. 配置导入模式: tools-cc use -c config.json
|
|
14
|
-
* 2. 交互选择模式: tools-cc use my-source
|
|
14
|
+
* 2. 交互选择模式: tools-cc use my-source --ls
|
|
15
15
|
* 3. 路径语法模式: tools-cc use my-source/skills/a-skill
|
|
16
16
|
* 4. 整体导入模式: tools-cc use my-source
|
|
17
17
|
* 5. 点模式: tools-cc use . (使用已配置源)
|
package/dist/commands/use.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.handleProjectUpdate = handleProjectUpdate;
|
|
|
11
11
|
const chalk_1 = __importDefault(require("chalk"));
|
|
12
12
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
13
13
|
const project_1 = require("../core/project");
|
|
14
|
+
const config_1 = require("../types/config");
|
|
14
15
|
const source_1 = require("../core/source");
|
|
15
16
|
const manifest_1 = require("../core/manifest");
|
|
16
17
|
const symlink_1 = require("../core/symlink");
|
|
@@ -22,22 +23,15 @@ const SUPPORTED_TOOLS = {
|
|
|
22
23
|
iflow: '.iflow',
|
|
23
24
|
claude: '.claude',
|
|
24
25
|
codebuddy: '.codebuddy',
|
|
25
|
-
opencode: '.opencode'
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 默认选择配置 - 导入所有内容
|
|
29
|
-
*/
|
|
30
|
-
const DEFAULT_SELECTION = {
|
|
31
|
-
skills: ['*'],
|
|
32
|
-
commands: ['*'],
|
|
33
|
-
agents: ['*']
|
|
26
|
+
opencode: '.opencode',
|
|
27
|
+
codex: '.codex'
|
|
34
28
|
};
|
|
35
29
|
/**
|
|
36
30
|
* 处理 use 命令
|
|
37
31
|
*
|
|
38
32
|
* 支持多种模式:
|
|
39
33
|
* 1. 配置导入模式: tools-cc use -c config.json
|
|
40
|
-
* 2. 交互选择模式: tools-cc use my-source
|
|
34
|
+
* 2. 交互选择模式: tools-cc use my-source --ls
|
|
41
35
|
* 3. 路径语法模式: tools-cc use my-source/skills/a-skill
|
|
42
36
|
* 4. 整体导入模式: tools-cc use my-source
|
|
43
37
|
* 5. 点模式: tools-cc use . (使用已配置源)
|
|
@@ -56,7 +50,7 @@ async function handleUse(sourceSpecs, options) {
|
|
|
56
50
|
await handleDotMode(projectDir, toolsccDir, configFile, options.projects);
|
|
57
51
|
return;
|
|
58
52
|
}
|
|
59
|
-
// 3. 交互选择模式:单个源 +
|
|
53
|
+
// 3. 交互选择模式:单个源 + --ls 选项
|
|
60
54
|
if (options.ls && sourceSpecs.length === 1) {
|
|
61
55
|
const parsed = (0, parsePath_1.parseSourcePath)(sourceSpecs[0]);
|
|
62
56
|
// 只有源名称时才进入交互模式
|
|
@@ -141,21 +135,21 @@ async function handleInteractiveMode(sourceName, projectDir, projects) {
|
|
|
141
135
|
// 构建选项列表
|
|
142
136
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
143
137
|
const choices = [];
|
|
144
|
-
// Skills
|
|
138
|
+
// Skills 区
|
|
145
139
|
if (manifest.skills && manifest.skills.length > 0) {
|
|
146
140
|
choices.push(new inquirer_1.default.Separator(`--- Skills (${manifest.skills.length}) ---`));
|
|
147
141
|
for (const skill of manifest.skills) {
|
|
148
142
|
choices.push({ name: skill, value: `skills/${skill}` });
|
|
149
143
|
}
|
|
150
144
|
}
|
|
151
|
-
// Commands
|
|
145
|
+
// Commands 区
|
|
152
146
|
if (manifest.commands && manifest.commands.length > 0) {
|
|
153
147
|
choices.push(new inquirer_1.default.Separator(`--- Commands (${manifest.commands.length}) ---`));
|
|
154
148
|
for (const cmd of manifest.commands) {
|
|
155
149
|
choices.push({ name: cmd, value: `commands/${cmd}` });
|
|
156
150
|
}
|
|
157
151
|
}
|
|
158
|
-
// Agents
|
|
152
|
+
// Agents 区
|
|
159
153
|
if (manifest.agents && manifest.agents.length > 0) {
|
|
160
154
|
choices.push(new inquirer_1.default.Separator(`--- Agents (${manifest.agents.length}) ---`));
|
|
161
155
|
for (const agent of manifest.agents) {
|
|
@@ -310,18 +304,22 @@ async function handleProjectUpdate(sourceNames) {
|
|
|
310
304
|
console.log(chalk_1.default.yellow('Project not initialized. Run `tools-cc use <source>` first.'));
|
|
311
305
|
return;
|
|
312
306
|
}
|
|
313
|
-
const
|
|
307
|
+
const rawConfig = await fs_extra_1.default.readJson(configFile);
|
|
308
|
+
// 使用 normalizeProjectConfig 处理旧版(数组)和新版(对象)格式
|
|
309
|
+
const config = (0, config_1.normalizeProjectConfig)(rawConfig);
|
|
314
310
|
const configuredSources = Object.keys(config.sources || {});
|
|
315
|
-
|
|
316
|
-
|
|
311
|
+
// 过滤掉无效的源名称(如数字字符串),这些可能是 Commander.js 解析错误产生的
|
|
312
|
+
const validSourceNames = sourceNames?.filter(s => isNaN(Number(s))) || [];
|
|
313
|
+
let sourcesToUpdate = validSourceNames.length > 0
|
|
314
|
+
? validSourceNames
|
|
317
315
|
: configuredSources;
|
|
318
316
|
if (sourcesToUpdate.length === 0) {
|
|
319
317
|
console.log(chalk_1.default.gray('No sources to update.'));
|
|
320
318
|
return;
|
|
321
319
|
}
|
|
322
|
-
//
|
|
323
|
-
if (
|
|
324
|
-
const invalidSources =
|
|
320
|
+
// 验证指定的源是否存在于项目配置中(仅当用户明确指定了有效源名称时)
|
|
321
|
+
if (validSourceNames.length > 0) {
|
|
322
|
+
const invalidSources = validSourceNames.filter((s) => !configuredSources.includes(s));
|
|
325
323
|
if (invalidSources.length > 0) {
|
|
326
324
|
console.log(chalk_1.default.yellow(`Sources not in project: ${invalidSources.join(', ')}`));
|
|
327
325
|
}
|
package/dist/index.js
CHANGED
|
@@ -80,8 +80,8 @@ configCmd
|
|
|
80
80
|
program
|
|
81
81
|
.command('use [sources...]')
|
|
82
82
|
.description('Use sources in current project')
|
|
83
|
-
.option('-p, --projects <tools...>', 'Tools to link (iflow, claude, codebuddy, opencode)')
|
|
84
|
-
.option('-ls', 'Interactive selection mode for single source')
|
|
83
|
+
.option('-p, --projects <tools...>', 'Tools to link (iflow, claude, codebuddy, opencode, codex)')
|
|
84
|
+
.option('-l, --ls', 'Interactive selection mode for single source')
|
|
85
85
|
.option('-c, --config <file>', 'Import from config file')
|
|
86
86
|
.action(async (sources, options) => {
|
|
87
87
|
await (0, use_1.handleUse)(sources, options);
|
package/package.json
CHANGED
package/src/commands/help.ts
CHANGED
|
@@ -9,7 +9,7 @@ ${chalk.bold.cyan('════════════════════
|
|
|
9
9
|
|
|
10
10
|
${chalk.bold('DESCRIPTION / 描述')}
|
|
11
11
|
A CLI tool for managing skills/commands/agents configurations across multiple
|
|
12
|
-
AI coding tools (iflow, claude, codebuddy, opencode, etc.) via symlinks.
|
|
12
|
+
AI coding tools (iflow, claude, codebuddy, opencode, codex, etc.) via symlinks.
|
|
13
13
|
|
|
14
14
|
一个用于统一管理多个 AI 编程工具配置的命令行工具,通过符号链接机制避免重复配置。
|
|
15
15
|
|
|
@@ -23,7 +23,8 @@ ${chalk.bold('COMMANDS / 命令')}
|
|
|
23
23
|
tools-cc sources add <name> <path-or-url> Add a source / 添加配置源
|
|
24
24
|
tools-cc sources list, ls List all sources / 列出所有配置源
|
|
25
25
|
tools-cc sources remove, rm <name> Remove a source / 移除配置源
|
|
26
|
-
tools-cc sources update, up [name]
|
|
26
|
+
tools-cc sources update, up [name] git pull update / 更新源代码
|
|
27
|
+
tools-cc sources scan Scan dir for sources / 扫描发现新源
|
|
27
28
|
|
|
28
29
|
${chalk.gray('Shortcut: -s')} e.g., tools-cc -s add my-skills https://github.com/user/skills.git
|
|
29
30
|
|
|
@@ -35,21 +36,33 @@ ${chalk.bold('COMMANDS / 命令')}
|
|
|
35
36
|
${chalk.gray('Shortcut: -c')} e.g., tools-cc -c set sourcesDir D:/skills
|
|
36
37
|
|
|
37
38
|
${chalk.cyan('Project Commands / 项目命令')}
|
|
38
|
-
tools-cc use [sources...] [
|
|
39
|
+
tools-cc use [sources...] [options] Use sources in project / 在项目中启用配置源
|
|
40
|
+
tools-cc update [sources...] Sync source content to project / 同步内容到项目
|
|
39
41
|
tools-cc list List used sources / 列出已启用的配置源
|
|
40
42
|
tools-cc rm <source> Remove source from project / 禁用配置源
|
|
41
43
|
tools-cc status Show project status / 显示项目状态
|
|
44
|
+
tools-cc export [options] Export config / 导出配置
|
|
42
45
|
|
|
43
46
|
${chalk.cyan('Help / 帮助')}
|
|
44
47
|
tools-cc help Show this help / 显示此帮助信息
|
|
45
48
|
tools-cc --help, -h Show command help / 显示命令帮助
|
|
46
49
|
tools-cc --version, -V Show version / 显示版本号
|
|
47
50
|
|
|
51
|
+
${chalk.bold('USE OPTIONS / use 命令选项')}
|
|
52
|
+
-p, --tools <tools...> Target tools (iflow, claude, etc.) / 目标工具
|
|
53
|
+
--ls Interactive selection / 交互式选择内容
|
|
54
|
+
-c, --config <file> Import from config file / 从配置文件导入
|
|
55
|
+
|
|
56
|
+
${chalk.bold('EXPORT OPTIONS / export 命令选项')}
|
|
57
|
+
-o, --output <file> Output file path / 输出文件路径
|
|
58
|
+
--global Export global config / 导出全局配置
|
|
59
|
+
|
|
48
60
|
${chalk.bold('SUPPORTED TOOLS / 支持的工具')}
|
|
49
61
|
iflow → .iflow
|
|
50
62
|
claude → .claude
|
|
51
63
|
codebuddy → .codebuddy
|
|
52
64
|
opencode → .opencode
|
|
65
|
+
codex → .codex
|
|
53
66
|
|
|
54
67
|
${chalk.bold('EXAMPLES / 示例')}
|
|
55
68
|
${chalk.gray('# Add a git source / 添加 Git 配置源')}
|
|
@@ -58,21 +71,36 @@ ${chalk.bold('EXAMPLES / 示例')}
|
|
|
58
71
|
${chalk.gray('# Add a local source / 添加本地配置源')}
|
|
59
72
|
tools-cc sources add local-skills D:/path/to/local-skills
|
|
60
73
|
|
|
74
|
+
${chalk.gray('# Scan for sources / 扫描发现配置源')}
|
|
75
|
+
tools-cc sources scan
|
|
76
|
+
|
|
61
77
|
${chalk.gray('# List all sources / 列出所有配置源')}
|
|
62
78
|
tools-cc sources list
|
|
63
79
|
|
|
64
80
|
${chalk.gray('# Use sources in project / 在项目中启用配置源')}
|
|
65
|
-
tools-cc use my-skills -p iflow claude
|
|
81
|
+
tools-cc use my-skills -p iflow claude codex
|
|
82
|
+
|
|
83
|
+
${chalk.gray('# Interactive selection / 交互式选择内容')}
|
|
84
|
+
tools-cc use my-skills --ls
|
|
85
|
+
|
|
86
|
+
${chalk.gray('# Import from config file / 从配置文件导入')}
|
|
87
|
+
tools-cc use -c project-config.json
|
|
88
|
+
|
|
89
|
+
${chalk.gray('# Sync source content to project / 同步源内容到项目')}
|
|
90
|
+
tools-cc update my-skills
|
|
66
91
|
|
|
67
92
|
${chalk.gray('# Check project status / 检查项目状态')}
|
|
68
93
|
tools-cc status
|
|
69
94
|
|
|
95
|
+
${chalk.gray('# Export project config / 导出项目配置')}
|
|
96
|
+
tools-cc export -o my-config.json
|
|
97
|
+
|
|
70
98
|
${chalk.gray('# Show full configuration / 显示完整配置')}
|
|
71
99
|
tools-cc config list
|
|
72
100
|
|
|
73
101
|
${chalk.bold('MORE INFO / 更多信息')}
|
|
74
|
-
GitHub: https://github.com/
|
|
75
|
-
Docs: https://github.com/
|
|
102
|
+
GitHub: https://github.com/q759410559/tools-cc
|
|
103
|
+
Docs: https://github.com/q759410559/tools-cc#readme
|
|
76
104
|
|
|
77
105
|
${chalk.bold.cyan('═══════════════════════════════════════════════════════════════════════════')}
|
|
78
106
|
`);
|