@sstar/skill-install 1.0.0 → 1.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 CHANGED
@@ -1,180 +1,180 @@
1
- # Agent Skill Installer
1
+ # Agent Skill 安装工具
2
2
 
3
- A command-line tool for installing Agent Skills from various sources (public URLs, Wiki with authentication, or local archive files). Automatically downloads, extracts, validates, and installs skills for **Claude Code** or **Codex**.
3
+ 命令行工具,用于从多种来源(公开 URL、需要认证的 Wiki 或本地归档文件)安装 Agent Skills。自动下载、解压、验证并安装技能到 **Claude Code** **Codex**。
4
4
 
5
- ## Features
5
+ ## 功能特性
6
6
 
7
- - **Multi-tool support**: Works with both Claude Code (`~/.claude/skills/`) and Codex (`~/.codex/skills/`)
8
- - **Auto-detect source**: Automatically detects if the source is a public URL, Wiki URL (with auth), or local file
9
- - **Multiple archive formats**: Supports `.zip` and `.tar.gz` archives
10
- - **Strict validation**: Validates that archives contain a valid `SKILL.md` with required frontmatter
11
- - **Wiki authentication**: Supports authentication with internal Confluence Wiki
12
- - **Skill management**: List installed skills and uninstall them
13
- - **Interactive prompts**: Choose between global/local directories and AI tools
14
- - **Self-signed certificates**: Built-in support for corporate SSL certificates
7
+ - **多工具支持**:同时支持 Claude Code (`~/.claude/skills/`) Codex (`~/.codex/skills/`)
8
+ - **自动检测来源**:自动识别来源类型(公开 URL、需认证的 Wiki URL 或本地文件)
9
+ - **多种归档格式**:支持 `.zip` `.tar.gz` 归档文件
10
+ - **严格验证**:验证归档包含有效的 `SKILL.md` 文件及必需的 frontmatter
11
+ - **Wiki 认证**:支持内部 Confluence Wiki 的身份认证
12
+ - **技能管理**:列出已安装的技能并支持卸载
13
+ - **交互式提示**:可选择全局/本地目录和 AI 工具
14
+ - **自签名证书**:内置支持企业 SSL 证书
15
15
 
16
- ## What are Skills?
16
+ ## 什么是 Skills
17
17
 
18
- Skills are a lightweight, open format for extending AI agent capabilities with specialized knowledge and workflows. At its core, a skill is a folder containing a `SKILL.md` file with metadata (`name` and `description`) and instructions.
18
+ Skills 是一种轻量级的开放格式,用于通过专业知识和工作流扩展 AI 代理的能力。本质上,一个 skill 是一个包含 `SKILL.md` 文件的文件夹,该文件包含元数据(`name` `description`)和指令。
19
19
 
20
- Learn more at: https://agentskills.io/what-are-skills
20
+ 了解更多:https://agentskills.io/what-are-skills
21
21
 
22
- ## Installation
22
+ ## 安装
23
23
 
24
24
  ```bash
25
25
  cd /home/ekko.bao/work/tools/wiki_download
26
26
  npm install
27
27
  npm run build
28
- npm link # Optional: for global installation
28
+ npm link # 可选:全局安装
29
29
  ```
30
30
 
31
- ## Usage
31
+ ## 使用方法
32
32
 
33
33
  ```bash
34
- # Install with interactive AI tool and directory selection
34
+ # 交互式安装(提示选择 AI 工具和目录)
35
35
  skill-install install https://github.com/user/repo/archive/main.zip
36
36
 
37
- # Install for specific AI tool (skip prompt)
37
+ # 指定 AI 工具安装(跳过提示)
38
38
  skill-install -t claude install https://github.com/user/repo/archive/main.zip
39
39
  skill-install -t codex install https://github.com/user/repo/archive/main.zip
40
40
 
41
- # Install to global directory explicitly
41
+ # 显式安装到全局目录
42
42
  skill-install install https://example.com/skill.zip --global
43
43
 
44
- # Install to local directory explicitly
44
+ # 显式安装到本地目录
45
45
  skill-install install https://example.com/skill.zip --local
46
46
 
47
- # Install with custom directory
47
+ # 安装到自定义目录
48
48
  skill-install -s /path/to/skills install https://example.com/skill.zip
49
49
 
50
- # Install from Wiki with authentication
50
+ # 从需要认证的 Wiki 安装
51
51
  skill-install install https://wiki.company.com/download/attachments/123/skill.zip -u username
52
52
 
53
- # Install from a local archive file
53
+ # 从本地归档文件安装
54
54
  skill-install install ./my-skill.zip
55
55
 
56
- # List installed skills (prompts for AI tool)
56
+ # 列出已安装的技能(提示选择 AI 工具)
57
57
  skill-install list
58
58
 
59
- # List installed skills for specific AI tool (skip prompt)
59
+ # 列出指定 AI 工具的技能(跳过提示)
60
60
  skill-install -t claude list
61
61
  skill-install -t codex list
62
62
 
63
- # List skills from both global and local directories
63
+ # 列出全局和本地目录的所有技能
64
64
  skill-install list --all
65
65
 
66
- # Uninstall a skill (prompts for AI tool)
66
+ # 卸载技能(提示选择 AI 工具)
67
67
  skill-install uninstall my-skill
68
68
 
69
- # Uninstall from specific AI tool (skip prompt)
69
+ # 从指定 AI 工具卸载(跳过提示)
70
70
  skill-install -t claude uninstall my-skill
71
71
  skill-install -t codex uninstall my-skill
72
72
 
73
- # Force reinstall if skill already exists
73
+ # 技能已存在时强制重新安装
74
74
  skill-install install ./my-skill.zip --force
75
75
  ```
76
76
 
77
- ## Options
77
+ ## 命令选项
78
78
 
79
- ### Global Options
80
- | Option | Description |
81
- |--------|-------------|
82
- | `-t, --tool <tool>` | AI tool: `claude` or `codex` (skip prompt if specified) |
83
- | `-s, --skills-dir <path>` | Custom skills directory |
84
- | `-v, --verbose` | Enable verbose logging |
85
- | `-h, --help` | Display help |
79
+ ### 全局选项
80
+ | 选项 | 描述 |
81
+ |------|------|
82
+ | `-t, --tool <tool>` | AI 工具:`claude` `codex`(指定后跳过提示) |
83
+ | `-s, --skills-dir <path>` | 自定义技能目录 |
84
+ | `-v, --verbose` | 启用详细日志 |
85
+ | `-h, --help` | 显示帮助信息 |
86
86
 
87
- **Note**: If `-t` is not specified, the tool will prompt interactively to choose between Claude Code and Codex.
87
+ **注意**:如果未指定 `-t`,工具将提示交互选择 Claude Code Codex
88
88
 
89
- ### Install Command
90
- | Option | Description |
91
- |--------|-------------|
92
- | `<source>` | URL or local file path to skill archive |
93
- | `-g, --global` | Install to global directory (`~/.claude/skills/` or `~/.codex/skills/`) |
94
- | `-l, --local` | Install to local directory (`./.claude/skills/` or `./.codex/skills/`) |
95
- | `-u, --username <username>` | Wiki username (for Wiki URLs) |
96
- | `-p, --password <password>` | Wiki password (or use env var) |
97
- | `--allow-self-signed` | Allow self-signed SSL certificates (default: true) |
98
- | `-f, --force` | Reinstall if skill already exists |
89
+ ### install 命令
90
+ | 选项 | 描述 |
91
+ |------|------|
92
+ | `<source>` | 技能归档的 URL 或本地文件路径 |
93
+ | `-g, --global` | 安装到全局目录 (`~/.claude/skills/` `~/.codex/skills/`) |
94
+ | `-l, --local` | 安装到本地目录 (`./.claude/skills/` `./.codex/skills/`) |
95
+ | `-u, --username <username>` | Wiki 用户名(用于 Wiki URL) |
96
+ | `-p, --password <password>` | Wiki 密码(或使用环境变量) |
97
+ | `--allow-self-signed` | 允许自签名 SSL 证书(默认:true |
98
+ | `-f, --force` | 技能已存在时重新安装 |
99
99
 
100
- **Note**: If neither `-g` nor `-l` nor `-s` is specified, the tool will prompt interactively to choose between global and local directories.
100
+ **注意**:如果未指定 `-g`、`-l` `-s`,工具将提示交互选择全局或本地目录。
101
101
 
102
- ### List Command
103
- | Option | Description |
104
- |--------|-------------|
105
- | `-a, --all` | List skills from both global and local directories |
102
+ ### list 命令
103
+ | 选项 | 描述 |
104
+ |------|------|
105
+ | `-a, --all` | 列出全局和本地目录的所有技能 |
106
106
 
107
- ### Uninstall Command
108
- | Option | Description |
109
- |--------|-------------|
110
- | `[name]` | Name of the skill to uninstall (optional - leave empty to select from list) |
111
- | `-y, --yes` | Skip confirmation prompt |
107
+ ### uninstall 命令
108
+ | 选项 | 描述 |
109
+ |------|------|
110
+ | `[name]` | 要卸载的技能名称(可选 - 留空可从列表中选择) |
111
+ | `-y, --yes` | 跳过确认提示 |
112
112
 
113
- **Note**: If no skill name is provided, the tool will display all installed skills and allow you to select which ones to uninstall by entering numbers separated by spaces (e.g., `1 3 5`).
113
+ **注意**:如果未提供技能名称,工具将显示所有已安装的技能并允许通过输入数字来选择要卸载的技能(例如 `1 3 5`)。
114
114
 
115
- ## Environment Variables
115
+ ## 环境变量
116
116
 
117
- | Variable | Description |
118
- |----------|-------------|
119
- | `WIKI_USERNAME` | Default Wiki username |
120
- | `WIKI_PASSWORD` | Default Wiki password |
117
+ | 变量 | 描述 |
118
+ |------|------|
119
+ | `WIKI_USERNAME` | 默认 Wiki 用户名 |
120
+ | `WIKI_PASSWORD` | 默认 Wiki 密码 |
121
121
 
122
- ## Skill Validation
122
+ ## 技能验证
123
123
 
124
- A valid skill must have a `SKILL.md` file at the root with YAML frontmatter containing:
124
+ 有效的技能必须在根目录包含 `SKILL.md` 文件,其中包含 YAML frontmatter
125
125
 
126
126
  ```yaml
127
127
  ---
128
128
  name: my-skill
129
- description: A brief description of what this skill does
129
+ description: 对该技能功能的简要描述
130
130
  ---
131
131
 
132
132
  # My Skill
133
133
 
134
- Instructions for the agent...
134
+ 给代理的指令...
135
135
  ```
136
136
 
137
- The tool validates:
138
- - `SKILL.md` exists
139
- - YAML frontmatter is present (wrapped in `---`)
140
- - `name` field is present
141
- - `description` field is present
137
+ 工具会验证:
138
+ - `SKILL.md` 文件存在
139
+ - YAML frontmatter 存在(用 `---` 包裹)
140
+ - `name` 字段存在
141
+ - `description` 字段存在
142
142
 
143
- ## Skill Directory Structure
143
+ ## 技能目录结构
144
144
 
145
- Skills can be installed to different locations based on the AI tool:
145
+ 根据 AI 工具的不同,技能可以安装到不同位置:
146
146
 
147
147
  ### Claude Code
148
- - **Global**: `~/.claude/skills/` - Available to all projects
149
- - **Local**: `./.claude/skills/` - Project-specific
148
+ - **全局**:`~/.claude/skills/` - 所有项目可用
149
+ - **本地**:`./.claude/skills/` - 项目特定
150
150
 
151
151
  ### Codex
152
- - **Global**: `~/.codex/skills/` - Available to all projects
153
- - **Local**: `./.codex/skills/` - Project-specific
152
+ - **全局**:`~/.codex/skills/` - 所有项目可用
153
+ - **本地**:`./.codex/skills/` - 项目特定
154
154
 
155
- ### Directory Selection
156
- - **Global**: Use `--global` flag or select "1" when prompted (recommended for commonly used skills)
157
- - **Local**: Use `--local` flag or select "2" when prompted (recommended for project-specific skills)
158
- - **Custom**: Use `-s /path/to/skills` for a custom location
155
+ ### 目录选择
156
+ - **全局**:使用 `--global` 标志或提示时选择 "1"(推荐用于常用技能)
157
+ - **本地**:使用 `--local` 标志或提示时选择 "2"(推荐用于项目特定技能)
158
+ - **自定义**:使用 `-s /path/to/skills` 指定自定义位置
159
159
 
160
- A typical installed skill:
160
+ 典型的已安装技能结构:
161
161
 
162
162
  ```
163
163
  ~/.claude/skills/my-skill/
164
- ├── SKILL.md # Required: instructions + metadata
165
- ├── scripts/ # Optional: executable code
166
- ├── references/ # Optional: documentation
167
- └── assets/ # Optional: templates, resources
164
+ ├── SKILL.md # 必需:指令 + 元数据
165
+ ├── scripts/ # 可选:可执行代码
166
+ ├── references/ # 可选:文档
167
+ └── assets/ # 可选:模板、资源
168
168
  ```
169
169
 
170
- ## Examples
170
+ ## 使用示例
171
171
 
172
- ### Interactive installation (prompts for AI tool and directory)
172
+ ### 交互式安装(提示选择 AI 工具和目录)
173
173
 
174
174
  ```bash
175
175
  skill-install install https://github.com/user/repo/archive/main.zip
176
176
 
177
- # Output:
177
+ # 输出:
178
178
  # Select AI tool:
179
179
  # 1. Claude Code (~/.claude/skills/)
180
180
  # 2. Codex (~/.codex/skills/)
@@ -188,67 +188,67 @@ skill-install install https://github.com/user/repo/archive/main.zip
188
188
  # Choose [1/2]: 1
189
189
  ```
190
190
 
191
- ### Install for specific AI tool (skip prompt)
191
+ ### 为指定 AI 工具安装(跳过提示)
192
192
 
193
193
  ```bash
194
- # Install for Claude Code
194
+ # Claude Code 安装
195
195
  skill-install -t claude install https://example.com/skill.zip
196
196
 
197
- # Install for Codex
197
+ # Codex 安装
198
198
  skill-install -t codex install https://example.com/skill.zip
199
199
 
200
- # Install to Codex global directory
200
+ # 安装到 Codex 全局目录
201
201
  skill-install -t codex install https://example.com/skill.zip --global
202
202
  ```
203
203
 
204
- ### Install to specific directory
204
+ ### 安装到指定目录
205
205
 
206
206
  ```bash
207
- # Install to global directory
207
+ # 安装到全局目录
208
208
  skill-install install https://example.com/skill.zip --global
209
209
 
210
- # Install to local directory
210
+ # 安装到本地目录
211
211
  skill-install install https://example.com/skill.zip --local
212
212
 
213
- # Install to custom directory
213
+ # 安装到自定义目录
214
214
  skill-install -s /custom/path install https://example.com/skill.zip
215
215
  ```
216
216
 
217
- ### Install from Wiki
217
+ ### Wiki 安装
218
218
 
219
219
  ```bash
220
220
  skill-install install "https://wiki.company.com/download/attachments/12345/skill.zip?api=v2" -u john.doe
221
221
  ```
222
222
 
223
- ### Install from local file
223
+ ### 从本地文件安装
224
224
 
225
225
  ```bash
226
226
  skill-install install ~/Downloads/my-skill.tar.gz
227
227
  ```
228
228
 
229
- ### List and uninstall
229
+ ### 列出和卸载
230
230
 
231
231
  ```bash
232
- # List skills (prompts for AI tool)
232
+ # 列出技能(提示选择 AI 工具)
233
233
  skill-install list
234
234
 
235
- # List skills for specific AI tool (skip prompt)
235
+ # 列出指定 AI 工具的技能(跳过提示)
236
236
  skill-install -t claude list
237
237
  skill-install -t codex list
238
238
 
239
- # List skills from both directories
239
+ # 列出两个目录的所有技能
240
240
  skill-install -t claude list --all
241
241
 
242
- # Uninstall a specific skill (prompts for AI tool)
242
+ # 卸载指定技能(提示选择 AI 工具)
243
243
  skill-install uninstall my-skill
244
244
 
245
- # Uninstall without prompts (specify AI tool and skip confirmation)
245
+ # 无提示卸载(指定 AI 工具并跳过确认)
246
246
  skill-install -t codex uninstall my-skill -y
247
247
 
248
- # Interactive uninstall (select from list)
248
+ # 交互式卸载(从列表选择)
249
249
  skill-install uninstall
250
250
 
251
- # Output:
251
+ # 输出:
252
252
  # Select AI tool:
253
253
  # 1. Claude Code (~/.claude/skills/)
254
254
  # 2. Codex (~/.codex/skills/)
@@ -270,27 +270,27 @@ skill-install uninstall
270
270
  # Selected skills: repo-git, pdf-processing
271
271
  ```
272
272
 
273
- ## Project Structure
273
+ ## 项目结构
274
274
 
275
275
  ```
276
276
  src/
277
- ├── cli.ts # CLI entry point
277
+ ├── cli.ts # CLI 入口
278
278
  ├── installer/
279
- │ └── install-service.ts # Core installation logic
279
+ │ └── install-service.ts # 核心安装逻辑
280
280
  ├── download/
281
- │ └── download-manager.ts # Download manager (wiki + public)
281
+ │ └── download-manager.ts # 下载管理器(wiki + 公共)
282
282
  ├── archive/
283
- │ └── archive-extractor.ts # Archive extraction (ZIP, tar.gz)
283
+ │ └── archive-extractor.ts # 归档解压(ZIPtar.gz
284
284
  ├── source/
285
- │ └── source-detector.ts # Source type detection
285
+ │ └── source-detector.ts # 来源类型检测
286
286
  ├── skills/
287
- │ ├── skills-manager.ts # List/uninstall operations
288
- │ └── skill-validator.ts # SKILL.md validation
289
- ├── auth/ # Wiki authentication
290
- ├── http/ # HTTP client with cookies
291
- └── core/ # Error handling & logging
287
+ │ ├── skills-manager.ts # 列表/卸载操作
288
+ │ └── skill-validator.ts # SKILL.md 验证
289
+ ├── auth/ # Wiki 认证
290
+ ├── http/ # Cookie HTTP 客户端
291
+ └── core/ # 错误处理和日志
292
292
  ```
293
293
 
294
- ## License
294
+ ## 许可证
295
295
 
296
296
  MIT