tools-cc 1.0.3 → 1.0.5

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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  本项目的所有重要变更都将记录在此文件中。
4
4
 
5
+ ## [1.0.4] - 2026-02-28
6
+
7
+ ### Added
8
+ - 新增英文版项目说明文档 README_en.md
9
+
10
+ ### Changed
11
+ - 优化项目初始化与源码同步逻辑
12
+
5
13
  ## [1.0.3] - 2026-02-26
6
14
 
7
15
  ### Changed
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.0.4] - 2026-02-28
6
+
7
+ ### Added
8
+ - Added English version of project documentation README_en.md
9
+
10
+ ### Changed
11
+ - Optimized project initialization and source synchronization logic
12
+
13
+ ## [1.0.3] - 2026-02-26
14
+
15
+ ### Changed
16
+ - Changed project configuration file location from `tools-cc.json` to `.toolscc/config.json`
17
+ - Improved documentation command descriptions, clearly distinguishing global and project commands
18
+
19
+ ## [1.0.2] - 2026-02-26
20
+
21
+ ### Added
22
+ - Added `tools-cc -s scan` command: scan sourcesDir directory to auto-discover and add configuration sources
23
+ - Added `tools-cc -s upgrade [name]` command alias: execute git pull to update configuration source code
24
+ - Added `tools-cc update [sources...]` command: sync configuration source content to project .toolscc directory
25
+
26
+ ### Changed
27
+ - Improved help documentation, added workflow guide and command comparison table
28
+
29
+ ## [1.0.1] - 2026-02-25
30
+
31
+ ### Added
32
+ - Added package.json repository metadata (repository, bugs, homepage)
33
+
34
+ ## [1.0.0] - 2026-02-25
35
+
36
+ ### Added
37
+ - Project initialization, built CLI framework based on TypeScript + Commander
38
+ - Global configuration management module
39
+ - `tools-cc -c set <key> <value>` set configuration
40
+ - `tools-cc -c get <key>` get configuration
41
+ - `tools-cc config list` view complete configuration
42
+ - Configuration source management module
43
+ - `tools-cc -s add <name> <path-or-url>` add configuration source (supports Git URL and local path)
44
+ - `tools-cc -s list` list all configuration sources
45
+ - `tools-cc -s remove <name>` remove configuration source
46
+ - `tools-cc -s update [name]` update configuration source (git pull)
47
+ - Project management module
48
+ - `tools-cc use [sources...]` enable configuration sources and create symbolic links
49
+ - `tools-cc list` list enabled configuration sources
50
+ - `tools-cc rm <source>` disable configuration source
51
+ - `tools-cc status` view project status
52
+ - Symbolic link management module (supports Windows Junction)
53
+ - Manifest loading and scanning module
54
+ - Bilingual help information (Chinese/English) (`tools-cc help`)
55
+ - Unit test coverage (vitest)
56
+
57
+ ### Supported Tools
58
+ | Tool | Link Name |
59
+ |------|-----------|
60
+ | iflow | `.iflow` |
61
+ | claude | `.claude` |
62
+ | codebuddy | `.codebuddy` |
63
+ | opencode | `.opencode` |
64
+
65
+ ---
66
+
67
+ ## Versioning
68
+
69
+ - **Major version**: Incompatible API changes
70
+ - **Minor version**: Backwards-compatible functionality additions
71
+ - **Patch version**: Backwards-compatible bug fixes
package/README.md CHANGED
@@ -36,6 +36,13 @@ tools-cc -s list
36
36
  cd my-project
37
37
  tools-cc use my-skills -p iflow claude
38
38
 
39
+ # 4a. 或使用部分引入(只引入需要的 skills/commands/agents)
40
+ tools-cc use my-skills/skills/a-skill
41
+ tools-cc use my-skills -ls # 交互式选择
42
+
43
+ # 4b. 或从配置文件快速导入
44
+ tools-cc use -c project-config.json
45
+
39
46
  # 5. 查看项目状态
40
47
  tools-cc status
41
48
 
@@ -99,11 +106,47 @@ tools-cc sources scan # 扫描 sourcesDir 目录,自动发
99
106
  ### 项目配置
100
107
 
101
108
  ```bash
102
- tools-cc use [sources...] [-p tools...] # 启用配置源并创建符号链接
109
+ tools-cc use [sources...] [options] # 启用配置源并创建符号链接
103
110
  tools-cc update [sources...] # 同步配置源内容到项目 .toolscc 目录
104
111
  tools-cc list # 列出已启用的配置源
105
112
  tools-cc rm <source> # 禁用配置源
106
113
  tools-cc status # 查看项目状态
114
+ tools-cc export [options] # 导出项目或全局配置
115
+ ```
116
+
117
+ #### `use` 命令详解
118
+
119
+ ```bash
120
+ # 整源引入(全部 skills/commands/agents)
121
+ tools-cc use my-skills
122
+ tools-cc use my-skills -p iflow claude # 指定工具链接
123
+
124
+ # 部分引入(路径语法)
125
+ tools-cc use my-skills/skills/a-skill # 引入单个 skill
126
+ tools-cc use my-skills/commands/test # 引入单个 command
127
+ tools-cc use my-skills/agents/reviewer # 引入单个 agent
128
+ tools-cc use my-skills/skills/a my-skills/commands/test # 引入多项
129
+
130
+ # 交互式选择(-ls 参数)
131
+ tools-cc use my-skills -ls # 分组展示,勾选引入
132
+
133
+ # 从配置文件导入
134
+ tools-cc use -c project-config.json # 快速恢复项目配置
135
+
136
+ # 使用 "." 表示当前项目已配置的源(只创建链接,不复制内容)
137
+ tools-cc use . -p iflow claude
138
+ ```
139
+
140
+ #### `export` 命令详解
141
+
142
+ ```bash
143
+ # 导出项目配置(包含具体选择)
144
+ tools-cc export # 导出到 .toolscc-export.json
145
+ tools-cc export -o my-config.json # 指定输出路径
146
+
147
+ # 导出全局配置
148
+ tools-cc export --global # 导出到 .toolscc-global-export.json
149
+ tools-cc export --global -o global.json # 指定输出路径
107
150
  ```
108
151
 
109
152
  ### Config 管理
@@ -208,11 +251,23 @@ my-project/
208
251
 
209
252
  ```json
210
253
  {
211
- "sources": ["my-skills"],
254
+ "sources": {
255
+ "my-skills": {
256
+ "skills": ["a-skill", "b-skill"],
257
+ "commands": ["test"],
258
+ "agents": ["*"]
259
+ }
260
+ },
212
261
  "links": ["iflow", "claude"]
213
262
  }
214
263
  ```
215
264
 
265
+ **说明:**
266
+ - `sources` 记录每个源具体引入了哪些内容
267
+ - `["*"]` 表示引入该类型全部内容
268
+ - `[]` 表示不引入该类型任何内容
269
+ ```
270
+
216
271
  ## 许可证
217
272
 
218
273
  MIT
package/README_en.md ADDED
@@ -0,0 +1,218 @@
1
+ # tools-cc
2
+
3
+ A CLI tool for unified management of skills/commands/agents configurations across multiple AI programming tools (iflow, claude, codebuddy, opencode, etc.). Uses symbolic links to avoid duplicate configurations across tools.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Install from npm
9
+ npm install -g tools-cc
10
+
11
+ # Or build from source
12
+ git clone https://github.com/q759410559/tools-cc.git
13
+ cd tools-cc
14
+ npm install
15
+ npm run build
16
+ npm link
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # 1. Set configuration source storage location (optional, default is ~/.tools-cc/sources)
23
+ tools-cc -c set sourcesDir D:/skills-hub-sources
24
+
25
+ # 2. Add configuration sources (supports Git URL or local path)
26
+ tools-cc -s add my-skills https://github.com/user/my-skills.git
27
+ tools-cc -s add local-skills D:/path/to/local-skills
28
+
29
+ # Or scan source directory to auto-discover and add configurations
30
+ tools-cc -s scan
31
+
32
+ # 3. View added configuration sources
33
+ tools-cc -s list
34
+
35
+ # 4. Enable configuration sources in a project and create links
36
+ cd my-project
37
+ tools-cc use my-skills -p iflow claude
38
+
39
+ # 5. View project status
40
+ tools-cc status
41
+
42
+ # 6. View enabled configuration sources
43
+ tools-cc list
44
+
45
+ # 7. Update configuration sources (sync latest content from source directory to project)
46
+ tools-cc update my-skills
47
+ tools-cc update # Update all
48
+
49
+ # 8. Remove configuration source
50
+ tools-cc rm my-skills
51
+ ```
52
+
53
+ ## Workflow Guide
54
+
55
+ ### Global Source Management vs Project Configuration
56
+
57
+ | Command | Scope | Description |
58
+ |---------|-------|-------------|
59
+ | `tools-cc -s add/remove/list` | Global | Manage global configuration sources |
60
+ | `tools-cc -s update/upgrade` | Global | git pull to update source code |
61
+ | `tools-cc -s scan` | Global | Scan directory to discover new sources |
62
+ | `tools-cc use/rm` | Project | Enable/disable sources in project |
63
+ | `tools-cc update` | Project | Sync source content to project |
64
+
65
+ ### Typical Workflow
66
+
67
+ ```bash
68
+ # Scenario 1: Configuration source has updates, need to sync to project
69
+ tools-cc -s upgrade my-skills # 1. git pull to update source code
70
+ cd my-project
71
+ tools-cc update my-skills # 2. Sync to project .toolscc directory
72
+
73
+ # Scenario 2: Batch update all sources
74
+ tools-cc -s upgrade # 1. Update all git sources
75
+ cd my-project
76
+ tools-cc update # 2. Sync all sources to project
77
+ ```
78
+
79
+ ## Command Reference
80
+
81
+ ### Source Management
82
+
83
+ ```bash
84
+ # Shortcuts (-s)
85
+ tools-cc -s add <name> <path-or-url> # Add configuration source (Git URL or local path)
86
+ tools-cc -s list # List all configuration sources (alias: -s ls)
87
+ tools-cc -s remove <name> # Remove configuration source (alias: -s rm)
88
+ tools-cc -s update [name] # git pull to update source code (alias: -s up, -s upgrade)
89
+ tools-cc -s scan # Scan sourcesDir to auto-discover and add configuration sources
90
+
91
+ # Full commands (sources)
92
+ tools-cc sources add <name> <path-or-url> # Add configuration source
93
+ tools-cc sources list # List all configuration sources (alias: sources ls)
94
+ tools-cc sources remove <name> # Remove configuration source (alias: sources rm)
95
+ tools-cc sources update [name] # git pull to update source code (alias: sources up, sources upgrade)
96
+ tools-cc sources scan # Scan sourcesDir to auto-discover and add configuration sources
97
+ ```
98
+
99
+ ### Project Configuration
100
+
101
+ ```bash
102
+ tools-cc use [sources...] [-p tools...] # Enable configuration sources and create symbolic links
103
+ tools-cc update [sources...] # Sync configuration source content to project .toolscc directory
104
+ tools-cc list # List enabled configuration sources
105
+ tools-cc rm <source> # Disable configuration source
106
+ tools-cc status # View project status
107
+ ```
108
+
109
+ ### Config Management
110
+
111
+ ```bash
112
+ # Shortcuts (-c)
113
+ tools-cc -c set <key> <value> # Set configuration
114
+ tools-cc -c get <key> # Get configuration
115
+
116
+ # Full commands (config)
117
+ tools-cc config set <key> <value> # Set configuration
118
+ tools-cc config get <key> # Get configuration
119
+ tools-cc config list # View complete global configuration
120
+ ```
121
+
122
+ ### Help
123
+
124
+ ```bash
125
+ tools-cc help # Display bilingual help (Chinese/English)
126
+ tools-cc --help # Display command line help
127
+ tools-cc --version # Display version number
128
+ ```
129
+
130
+ ## Supported Tools
131
+
132
+ | Tool | Link Name |
133
+ |------|-----------|
134
+ | iflow | `.iflow` |
135
+ | claude | `.claude` |
136
+ | codebuddy | `.codebuddy` |
137
+ | opencode | `.opencode` |
138
+
139
+ ## Configuration Source Structure
140
+
141
+ A configuration source directory should contain the following structure:
142
+
143
+ ```
144
+ my-skills/
145
+ ├── manifest.json # Optional, describes component information
146
+ ├── skills/
147
+ │ └── my-skill/
148
+ │ └── SKILL.md
149
+ ├── commands/
150
+ │ └── my-command.md
151
+ └── agents/
152
+ └── my-agent.md
153
+ ```
154
+
155
+ ### manifest.json Format
156
+
157
+ ```json
158
+ {
159
+ "name": "my-skills",
160
+ "version": "1.0.0",
161
+ "skills": ["my-skill"],
162
+ "commands": ["my-command"],
163
+ "agents": ["my-agent"]
164
+ }
165
+ ```
166
+
167
+ If `manifest.json` is not present, the CLI will automatically scan the directory structure to generate one.
168
+
169
+ ## Project Structure
170
+
171
+ After using `tools-cc use`, the project directory structure:
172
+
173
+ ```
174
+ my-project/
175
+ ├── .toolscc/ # Actual content directory
176
+ │ ├── config.json # Project configuration
177
+ │ ├── skills/ # Flattened, with source prefix
178
+ │ │ └── my-skills-my-skill/
179
+ │ ├── commands/
180
+ │ │ └── my-skills/
181
+ │ └── agents/
182
+ │ └── my-skills/
183
+ ├── .iflow -> .toolscc # Symbolic link
184
+ └── .claude -> .toolscc
185
+ ```
186
+
187
+ ## Configuration Files
188
+
189
+ ### Global Configuration `~/.tools-cc/config.json`
190
+
191
+ ```json
192
+ {
193
+ "sourcesDir": "D:/skills-hub-sources",
194
+ "sources": {
195
+ "my-skills": {
196
+ "type": "git",
197
+ "url": "https://github.com/user/my-skills.git"
198
+ },
199
+ "local-skills": {
200
+ "type": "local",
201
+ "path": "D:/local-skills"
202
+ }
203
+ }
204
+ }
205
+ ```
206
+
207
+ ### Project Configuration `project/.toolscc/config.json`
208
+
209
+ ```json
210
+ {
211
+ "sources": ["my-skills"],
212
+ "links": ["iflow", "claude"]
213
+ }
214
+ ```
215
+
216
+ ## License
217
+
218
+ MIT
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 导出项目或全局配置
3
+ */
4
+ export declare function handleExport(options: {
5
+ output?: string;
6
+ global?: boolean;
7
+ }): Promise<void>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.handleExport = handleExport;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const fs_extra_1 = __importDefault(require("fs-extra"));
10
+ const project_1 = require("../core/project");
11
+ const config_1 = require("../core/config");
12
+ const path_2 = require("../utils/path");
13
+ /**
14
+ * 导出项目或全局配置
15
+ */
16
+ async function handleExport(options) {
17
+ try {
18
+ if (options.global) {
19
+ // 导出全局配置
20
+ await exportGlobalConfig(options.output);
21
+ }
22
+ else {
23
+ // 导出项目配置
24
+ await exportProjectConfigCmd(options.output);
25
+ }
26
+ }
27
+ catch (error) {
28
+ const message = error instanceof Error ? error.message : String(error);
29
+ console.log(chalk_1.default.red(`✗ Export failed: ${message}`));
30
+ throw error;
31
+ }
32
+ }
33
+ /**
34
+ * 导出项目配置
35
+ */
36
+ async function exportProjectConfigCmd(outputPath) {
37
+ const projectDir = process.cwd();
38
+ const outputFile = outputPath ?? path_1.default.join(projectDir, '.toolscc-export.json');
39
+ await (0, project_1.exportProjectConfig)(projectDir, outputFile);
40
+ console.log(chalk_1.default.green(`✓ Project config exported to: ${outputFile}`));
41
+ }
42
+ /**
43
+ * 导出全局配置
44
+ */
45
+ async function exportGlobalConfig(outputPath) {
46
+ const projectDir = process.cwd();
47
+ const outputFile = outputPath ?? path_1.default.join(projectDir, '.toolscc-global-export.json');
48
+ const config = await (0, config_1.loadGlobalConfig)(path_2.GLOBAL_CONFIG_DIR);
49
+ const exportConfig = {
50
+ version: '1.0',
51
+ type: 'global',
52
+ config,
53
+ exportedAt: new Date().toISOString()
54
+ };
55
+ await fs_extra_1.default.writeJson(outputFile, exportConfig, { spaces: 2 });
56
+ console.log(chalk_1.default.green(`✓ Global config exported to: ${outputFile}`));
57
+ }
@@ -1,6 +1,22 @@
1
- export declare function handleUse(sourceNames: string[], options: {
1
+ /**
2
+ * use 命令选项
3
+ */
4
+ export interface UseOptions {
2
5
  projects?: string[];
3
- }): Promise<void>;
6
+ ls?: boolean;
7
+ config?: string;
8
+ }
9
+ /**
10
+ * 处理 use 命令
11
+ *
12
+ * 支持多种模式:
13
+ * 1. 配置导入模式: tools-cc use -c config.json
14
+ * 2. 交互选择模式: tools-cc use my-source -ls
15
+ * 3. 路径语法模式: tools-cc use my-source/skills/a-skill
16
+ * 4. 整体导入模式: tools-cc use my-source
17
+ * 5. 点模式: tools-cc use . (使用已配置源)
18
+ */
19
+ export declare function handleUse(sourceSpecs: string[], options: UseOptions): Promise<void>;
4
20
  export declare function handleList(): Promise<void>;
5
21
  export declare function handleRemove(sourceName: string): Promise<void>;
6
22
  export declare function handleStatus(): Promise<void>;