@dhruvwill/skills-cli 1.0.0 → 1.1.1
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 +141 -72
- package/_config.yml +9 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/cli.ts +57 -28
- package/src/commands/doctor.ts +4 -4
- package/src/commands/source.ts +41 -36
- package/src/commands/status.ts +5 -5
- package/src/commands/target.ts +72 -5
- package/src/commands/update.ts +12 -12
- package/src/lib/config.ts +67 -6
- package/src/lib/known-targets.ts +77 -0
- package/src/lib/paths.ts +11 -14
- package/src/types.ts +2 -2
- package/tests/cli.test.ts +40 -24
- package/tests/paths.test.ts +11 -11
package/README.md
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Skills CLI
|
|
2
2
|
|
|
3
3
|
> Sync AI skills across all your agent tools with one command
|
|
4
4
|
|
|
5
|
-
Supports **Cursor**, **Claude
|
|
5
|
+
Supports **Cursor**, **Claude Code**, **Gemini CLI**, **GitHub Copilot**, **OpenCode**, **Windsurf**, and more.
|
|
6
6
|
|
|
7
7
|
[Installation](#installation) •
|
|
8
8
|
[Quick Start](#quick-start) •
|
|
9
9
|
[Commands](#commands) •
|
|
10
|
+
[Supported Tools](#supported-tools) •
|
|
10
11
|
[Configuration](#configuration) •
|
|
11
12
|
[FAQ](#faq)
|
|
12
13
|
|
|
13
14
|
---
|
|
14
15
|
|
|
15
|
-
## Why
|
|
16
|
+
## Why Skills CLI?
|
|
16
17
|
|
|
17
|
-
**The problem**: You create a skill for Cursor, but need it in Claude
|
|
18
|
+
**The problem**: You create a skill for Cursor, but need it in Claude Code and Gemini too. Manually copying? Tedious. What if you update it? Copy again to every tool.
|
|
18
19
|
|
|
19
20
|
**The solution**: One source of truth. Add once, sync everywhere.
|
|
20
21
|
|
|
21
22
|
```bash
|
|
22
|
-
skills source add https://github.com/
|
|
23
|
-
skills target add cursor
|
|
24
|
-
skills target add claude
|
|
23
|
+
skills source add https://github.com/user/repo/tree/main/skills/react --remote
|
|
24
|
+
skills target add cursor
|
|
25
|
+
skills target add claude
|
|
25
26
|
skills sync # Done! Skills synced to all targets
|
|
26
27
|
```
|
|
27
28
|
|
|
@@ -30,8 +31,9 @@ skills sync # Done! Skills synced to all targets
|
|
|
30
31
|
| Feature | Description |
|
|
31
32
|
|---------|-------------|
|
|
32
33
|
| 🔄 **Multi-source** | Pull from GitHub, GitLab, Bitbucket, or local folders |
|
|
33
|
-
| 🎯 **Multi-target** | Sync to Cursor, Claude, Gemini, or any custom directory |
|
|
34
|
-
| 📂 **Subdirectory support** | Install specific skills from large repos |
|
|
34
|
+
| 🎯 **Multi-target** | Sync to Cursor, Claude, Gemini, Copilot, or any custom directory |
|
|
35
|
+
| 📂 **Subdirectory support** | Install specific skills from large mono-repos |
|
|
36
|
+
| 🏷️ **Rename skills** | Use `--name` to avoid conflicts |
|
|
35
37
|
| 🔍 **Diagnostics** | `doctor` command checks your setup |
|
|
36
38
|
| ⚡ **Fast** | Built with Bun for maximum performance |
|
|
37
39
|
|
|
@@ -41,14 +43,20 @@ skills sync # Done! Skills synced to all targets
|
|
|
41
43
|
|
|
42
44
|
### Prerequisites
|
|
43
45
|
|
|
44
|
-
- [Bun](https://bun.sh) runtime
|
|
46
|
+
- [Bun](https://bun.sh) runtime (required - uses Bun shell)
|
|
45
47
|
- Git (for remote sources)
|
|
46
48
|
|
|
47
49
|
### Install via Bun
|
|
48
50
|
|
|
51
|
+
```bash
|
|
52
|
+
bun install -g @dhruvwill/skills-cli
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Install from Source
|
|
56
|
+
|
|
49
57
|
```bash
|
|
50
58
|
# Clone the repository
|
|
51
|
-
git clone https://github.com/
|
|
59
|
+
git clone https://github.com/dhruvwill/skills.git
|
|
52
60
|
cd skills
|
|
53
61
|
|
|
54
62
|
# Install dependencies
|
|
@@ -58,8 +66,6 @@ bun install
|
|
|
58
66
|
bun link
|
|
59
67
|
```
|
|
60
68
|
|
|
61
|
-
After linking, the `skills` command is available globally.
|
|
62
|
-
|
|
63
69
|
### Verify Installation
|
|
64
70
|
|
|
65
71
|
```bash
|
|
@@ -72,12 +78,12 @@ skills doctor
|
|
|
72
78
|
## Quick Start
|
|
73
79
|
|
|
74
80
|
```bash
|
|
75
|
-
# 1. Add a skill
|
|
81
|
+
# 1. Add a skill from GitHub
|
|
76
82
|
skills source add https://github.com/vercel-labs/agent-skills/tree/main/skills/react-best-practices --remote
|
|
77
83
|
|
|
78
|
-
# 2. Add your targets (
|
|
79
|
-
skills target add cursor
|
|
80
|
-
skills target add claude
|
|
84
|
+
# 2. Add your targets (path auto-detected for known tools)
|
|
85
|
+
skills target add cursor
|
|
86
|
+
skills target add claude
|
|
81
87
|
|
|
82
88
|
# 3. Sync!
|
|
83
89
|
skills sync
|
|
@@ -86,7 +92,7 @@ skills sync
|
|
|
86
92
|
Check your setup anytime:
|
|
87
93
|
|
|
88
94
|
```bash
|
|
89
|
-
skills status # Overview of
|
|
95
|
+
skills status # Overview of skills & targets
|
|
90
96
|
skills doctor # Diagnose issues
|
|
91
97
|
```
|
|
92
98
|
|
|
@@ -104,8 +110,7 @@ skills doctor # Diagnose issues
|
|
|
104
110
|
┌─────────────────────────────────────────────────────────────┐
|
|
105
111
|
│ ~/.skills/store/ │
|
|
106
112
|
│ │
|
|
107
|
-
│
|
|
108
|
-
│ └── react-best-... └── cursor-... └── my-skill/ │
|
|
113
|
+
│ react-best-practices/ my-custom-skill/ local-skill/ │
|
|
109
114
|
│ │
|
|
110
115
|
│ ⬆ Single Source of Truth ⬆ │
|
|
111
116
|
└─────────────────────────────────────────────────────────────┘
|
|
@@ -114,7 +119,7 @@ skills doctor # Diagnose issues
|
|
|
114
119
|
┌─────────────────────┼─────────────────────┐
|
|
115
120
|
▼ ▼ ▼
|
|
116
121
|
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
|
|
117
|
-
│ Cursor │ │
|
|
122
|
+
│ Cursor │ │ Claude Code │ │ Gemini CLI │
|
|
118
123
|
│ ~/.cursor/ │ │ ~/.claude/ │ │ ~/.gemini/ │
|
|
119
124
|
│ skills/ │ │ skills/ │ │ skills/ │
|
|
120
125
|
└───────────────┘ └───────────────┘ └───────────────┘
|
|
@@ -128,31 +133,66 @@ skills doctor # Diagnose issues
|
|
|
128
133
|
|
|
129
134
|
| Command | Description |
|
|
130
135
|
|---------|-------------|
|
|
131
|
-
| `skills status` | Show overview of
|
|
136
|
+
| `skills status` | Show overview of skills, targets & sync state |
|
|
132
137
|
| `skills doctor` | Diagnose configuration issues |
|
|
133
138
|
| `skills sync` | Push skills from store to all targets |
|
|
134
|
-
| `skills update` | Refresh all
|
|
139
|
+
| `skills update` | Refresh all skills from origin |
|
|
135
140
|
|
|
136
|
-
###
|
|
141
|
+
### Skill Management
|
|
137
142
|
|
|
138
143
|
| Command | Description |
|
|
139
144
|
|---------|-------------|
|
|
140
|
-
| `skills source list` | List all registered
|
|
141
|
-
| `skills source add <url> --remote` | Add a
|
|
142
|
-
| `skills source add <path> --local` | Add a local folder |
|
|
143
|
-
| `skills source
|
|
145
|
+
| `skills source list` | List all registered skills |
|
|
146
|
+
| `skills source add <url> --remote` | Add a skill from Git repository |
|
|
147
|
+
| `skills source add <path> --local` | Add a skill from local folder |
|
|
148
|
+
| `skills source add <url> --remote --name <name>` | Add with custom name |
|
|
149
|
+
| `skills source remove <name>` | Remove a skill by name |
|
|
144
150
|
|
|
145
151
|
### Target Management
|
|
146
152
|
|
|
147
153
|
| Command | Description |
|
|
148
154
|
|---------|-------------|
|
|
149
155
|
| `skills target list` | List all targets with sync status |
|
|
150
|
-
| `skills target
|
|
156
|
+
| `skills target available` | Show predefined targets with paths |
|
|
157
|
+
| `skills target add <name>` | Add a predefined target (auto-detects path) |
|
|
158
|
+
| `skills target add <name> <path>` | Add a custom target with specific path |
|
|
151
159
|
| `skills target remove <name>` | Remove a target |
|
|
152
160
|
|
|
153
161
|
---
|
|
154
162
|
|
|
155
|
-
##
|
|
163
|
+
## Supported Tools
|
|
164
|
+
|
|
165
|
+
Run `skills target available` to see all supported tools:
|
|
166
|
+
|
|
167
|
+
| Tool | Path |
|
|
168
|
+
|------|------|
|
|
169
|
+
| **Cursor** | `~/.cursor/skills/` |
|
|
170
|
+
| **Claude Code** | `~/.claude/skills/` |
|
|
171
|
+
| **Gemini CLI** | `~/.gemini/skills/` |
|
|
172
|
+
| **VS Code / Copilot** | `~/.copilot/skills/` |
|
|
173
|
+
| **OpenCode** | `~/.config/opencode/skills/` |
|
|
174
|
+
| **Windsurf** | `~/.windsurf/skills/` |
|
|
175
|
+
| **Antigravity** | `~/.gemini/antigravity/skills/` |
|
|
176
|
+
|
|
177
|
+
### Adding Predefined Targets
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Just use the name - path is auto-detected
|
|
181
|
+
skills target add cursor
|
|
182
|
+
skills target add claude
|
|
183
|
+
skills target add gemini
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Adding Custom Targets
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# For tools not in the list, specify the path
|
|
190
|
+
skills target add mytool ~/path/to/mytool/skills
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Adding Skills
|
|
156
196
|
|
|
157
197
|
### From GitHub
|
|
158
198
|
|
|
@@ -161,7 +201,10 @@ skills doctor # Diagnose issues
|
|
|
161
201
|
skills source add https://github.com/owner/repo --remote
|
|
162
202
|
|
|
163
203
|
# Specific subdirectory (great for mono-repos)
|
|
164
|
-
skills source add https://github.com/owner/repo/tree/main/skills/
|
|
204
|
+
skills source add https://github.com/owner/repo/tree/main/skills/my-skill --remote
|
|
205
|
+
|
|
206
|
+
# With custom name (to avoid conflicts)
|
|
207
|
+
skills source add https://github.com/owner/repo --remote --name my-custom-name
|
|
165
208
|
```
|
|
166
209
|
|
|
167
210
|
### From GitLab
|
|
@@ -187,26 +230,6 @@ skills source add /absolute/path/to/skills --local
|
|
|
187
230
|
|
|
188
231
|
---
|
|
189
232
|
|
|
190
|
-
## Adding Targets
|
|
191
|
-
|
|
192
|
-
Add any directory where you want skills synced:
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
# Cursor
|
|
196
|
-
skills target add cursor ~/.cursor/skills
|
|
197
|
-
|
|
198
|
-
# Claude Desktop
|
|
199
|
-
skills target add claude ~/.claude/settings/skills
|
|
200
|
-
|
|
201
|
-
# Gemini CLI
|
|
202
|
-
skills target add gemini ~/.gemini/skills
|
|
203
|
-
|
|
204
|
-
# Custom location
|
|
205
|
-
skills target add myapp ~/myapp/ai-skills
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
233
|
## Configuration
|
|
211
234
|
|
|
212
235
|
### Directory Structure
|
|
@@ -214,11 +237,28 @@ skills target add myapp ~/myapp/ai-skills
|
|
|
214
237
|
```
|
|
215
238
|
~/.skills/
|
|
216
239
|
├── store/ # Central repository for all skills
|
|
217
|
-
│ ├──
|
|
218
|
-
│
|
|
240
|
+
│ ├── react-best-practices/ # Each skill in its own folder
|
|
241
|
+
│ │ ├── SKILL.md
|
|
242
|
+
│ │ └── rules/
|
|
243
|
+
│ └── my-custom-skill/
|
|
244
|
+
│ └── SKILL.md
|
|
219
245
|
└── config.json # Registry of sources and targets
|
|
220
246
|
```
|
|
221
247
|
|
|
248
|
+
### Skill Folder Structure
|
|
249
|
+
|
|
250
|
+
Each skill should follow this structure:
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
skill-name/
|
|
254
|
+
├── SKILL.md # Main skill definition (required)
|
|
255
|
+
├── AGENTS.md # Agent behavior (optional)
|
|
256
|
+
├── rules/ # Additional rules (optional)
|
|
257
|
+
│ ├── rule-1.md
|
|
258
|
+
│ └── rule-2.md
|
|
259
|
+
└── metadata.json # Skill metadata (optional)
|
|
260
|
+
```
|
|
261
|
+
|
|
222
262
|
### Config File
|
|
223
263
|
|
|
224
264
|
Located at `~/.skills/config.json`:
|
|
@@ -229,18 +269,22 @@ Located at `~/.skills/config.json`:
|
|
|
229
269
|
{
|
|
230
270
|
"type": "remote",
|
|
231
271
|
"url": "https://github.com/owner/repo/tree/main/skills/my-skill",
|
|
232
|
-
"
|
|
272
|
+
"name": "my-skill"
|
|
233
273
|
},
|
|
234
274
|
{
|
|
235
275
|
"type": "local",
|
|
236
276
|
"path": "/home/user/my-skills",
|
|
237
|
-
"
|
|
277
|
+
"name": "my-local-skill"
|
|
238
278
|
}
|
|
239
279
|
],
|
|
240
280
|
"targets": [
|
|
241
281
|
{
|
|
242
282
|
"name": "cursor",
|
|
243
283
|
"path": "/home/user/.cursor/skills"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "claude",
|
|
287
|
+
"path": "/home/user/.claude/skills"
|
|
244
288
|
}
|
|
245
289
|
]
|
|
246
290
|
}
|
|
@@ -257,14 +301,27 @@ Skills CLI provides:
|
|
|
257
301
|
- **Git integration** - Pull updates from remote repos with `skills update`
|
|
258
302
|
- **Subdirectory support** - Install specific skills from large mono-repos
|
|
259
303
|
- **Status tracking** - Know which targets are synced or outdated
|
|
304
|
+
- **Auto-detection** - No need to remember paths for common tools
|
|
260
305
|
|
|
261
|
-
###
|
|
306
|
+
### What happens when I run `skills sync`?
|
|
262
307
|
|
|
263
|
-
|
|
308
|
+
The contents of `~/.skills/store/` are copied to all registered target directories, maintaining the folder structure:
|
|
264
309
|
|
|
265
|
-
|
|
310
|
+
```
|
|
311
|
+
~/.skills/store/my-skill/ → ~/.cursor/skills/my-skill/
|
|
312
|
+
→ ~/.claude/skills/my-skill/
|
|
313
|
+
→ ~/.gemini/skills/my-skill/
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### How do I handle naming conflicts?
|
|
266
317
|
|
|
267
|
-
|
|
318
|
+
Use the `--name` flag when adding skills:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
# Two different "utils" skills from different repos
|
|
322
|
+
skills source add https://github.com/user1/repo --remote --name user1-utils
|
|
323
|
+
skills source add https://github.com/user2/repo --remote --name user2-utils
|
|
324
|
+
```
|
|
268
325
|
|
|
269
326
|
### How do I update skills from remote sources?
|
|
270
327
|
|
|
@@ -273,13 +330,12 @@ skills update # Pulls latest from all remote sources
|
|
|
273
330
|
skills sync # Pushes to all targets
|
|
274
331
|
```
|
|
275
332
|
|
|
276
|
-
###
|
|
333
|
+
### Can I add a tool that's not in the predefined list?
|
|
277
334
|
|
|
278
|
-
|
|
335
|
+
Yes! Just specify the path:
|
|
279
336
|
|
|
280
337
|
```bash
|
|
281
|
-
skills
|
|
282
|
-
skills source add https://github.com/owner/new-skill --remote
|
|
338
|
+
skills target add mytool ~/path/to/mytool/skills
|
|
283
339
|
```
|
|
284
340
|
|
|
285
341
|
---
|
|
@@ -290,25 +346,33 @@ skills source add https://github.com/owner/new-skill --remote
|
|
|
290
346
|
|
|
291
347
|
Install Git from [git-scm.com](https://git-scm.com/) or via your package manager.
|
|
292
348
|
|
|
293
|
-
### "
|
|
349
|
+
### "Skill already exists"
|
|
294
350
|
|
|
295
|
-
|
|
351
|
+
Either remove it first or use `--name` to give it a different name:
|
|
296
352
|
|
|
297
353
|
```bash
|
|
298
|
-
skills source remove
|
|
354
|
+
skills source remove old-skill
|
|
299
355
|
skills source add <url> --remote
|
|
356
|
+
|
|
357
|
+
# Or use a different name
|
|
358
|
+
skills source add <url> --remote --name new-name
|
|
300
359
|
```
|
|
301
360
|
|
|
302
|
-
### "
|
|
361
|
+
### "Unknown target"
|
|
362
|
+
|
|
363
|
+
The target isn't in the predefined list. Specify the path:
|
|
303
364
|
|
|
304
|
-
|
|
365
|
+
```bash
|
|
366
|
+
skills target add mytool ~/path/to/skills
|
|
367
|
+
```
|
|
305
368
|
|
|
306
369
|
### Need help?
|
|
307
370
|
|
|
308
371
|
```bash
|
|
309
|
-
skills doctor
|
|
310
|
-
skills status
|
|
311
|
-
skills
|
|
372
|
+
skills doctor # Run diagnostics
|
|
373
|
+
skills status # Check current state
|
|
374
|
+
skills target available # See predefined targets
|
|
375
|
+
skills --help # Show all commands
|
|
312
376
|
```
|
|
313
377
|
|
|
314
378
|
---
|
|
@@ -316,12 +380,17 @@ skills --help # Show all commands
|
|
|
316
380
|
## Contributing
|
|
317
381
|
|
|
318
382
|
```bash
|
|
319
|
-
git clone https://github.com/
|
|
383
|
+
git clone https://github.com/dhruvwill/skills.git
|
|
320
384
|
cd skills
|
|
321
385
|
bun install
|
|
322
386
|
bun test
|
|
323
387
|
```
|
|
324
388
|
|
|
389
|
+
## Links
|
|
390
|
+
|
|
391
|
+
- **npm**: [npmjs.com/package/@dhruvwill/skills-cli](https://www.npmjs.com/package/@dhruvwill/skills-cli)
|
|
392
|
+
- **GitHub**: [github.com/dhruvwill/skills](https://github.com/dhruvwill/skills)
|
|
393
|
+
|
|
325
394
|
---
|
|
326
395
|
|
|
327
396
|
## License
|
package/_config.yml
ADDED
package/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Re-export CLI for programmatic use
|
|
1
|
+
// Re-export CLI for programmatic use
|
|
2
2
|
export * from "./src/cli.ts";
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { sourceAdd, sourceRemove, sourceList } from "./commands/source.ts";
|
|
5
|
-
import { targetAdd, targetRemove, targetList } from "./commands/target.ts";
|
|
5
|
+
import { targetAdd, targetRemove, targetList, targetAvailable } from "./commands/target.ts";
|
|
6
6
|
import { sync } from "./commands/sync.ts";
|
|
7
7
|
import { update } from "./commands/update.ts";
|
|
8
8
|
import { doctor } from "./commands/doctor.ts";
|
|
9
9
|
import { status } from "./commands/status.ts";
|
|
10
10
|
|
|
11
|
-
const VERSION = "1.
|
|
11
|
+
const VERSION = "1.1.0";
|
|
12
12
|
|
|
13
13
|
function printHelp() {
|
|
14
14
|
console.log(`
|
|
@@ -18,47 +18,65 @@ ${chalk.bold("USAGE")}
|
|
|
18
18
|
${chalk.cyan("skills")} <command> [options]
|
|
19
19
|
|
|
20
20
|
${chalk.bold("COMMANDS")}
|
|
21
|
-
${chalk.cyan("status")} Show overview of
|
|
21
|
+
${chalk.cyan("status")} Show overview of skills, targets & sync state
|
|
22
22
|
${chalk.cyan("doctor")} Diagnose configuration issues
|
|
23
23
|
|
|
24
|
-
${chalk.bold("
|
|
25
|
-
${chalk.cyan("source list")} List all registered
|
|
26
|
-
${chalk.cyan("source add")} <url> ${chalk.dim("--remote")} Add a
|
|
27
|
-
${chalk.cyan("source add")} <path> ${chalk.dim("--local")} Add a local folder
|
|
28
|
-
${chalk.cyan("source remove")} <
|
|
24
|
+
${chalk.bold("Skill Management")}
|
|
25
|
+
${chalk.cyan("source list")} List all registered skills
|
|
26
|
+
${chalk.cyan("source add")} <url> ${chalk.dim("--remote")} Add a skill from Git repository
|
|
27
|
+
${chalk.cyan("source add")} <path> ${chalk.dim("--local")} Add a skill from local folder
|
|
28
|
+
${chalk.cyan("source remove")} <name> Remove a skill by name
|
|
29
29
|
|
|
30
30
|
${chalk.bold("Target Management")}
|
|
31
31
|
${chalk.cyan("target list")} List all targets with sync status
|
|
32
|
-
${chalk.cyan("target
|
|
32
|
+
${chalk.cyan("target available")} Show predefined targets (cursor, claude, etc.)
|
|
33
|
+
${chalk.cyan("target add")} <name> Add a predefined target (auto-detects path)
|
|
34
|
+
${chalk.cyan("target add")} <name> <path> Add a custom target with specific path
|
|
33
35
|
${chalk.cyan("target remove")} <name> Remove a target
|
|
34
36
|
|
|
35
37
|
${chalk.bold("Synchronization")}
|
|
36
38
|
${chalk.cyan("sync")} Push skills from store to all targets
|
|
37
|
-
${chalk.cyan("update")} Refresh all
|
|
39
|
+
${chalk.cyan("update")} Refresh all skills from origin
|
|
38
40
|
|
|
39
41
|
${chalk.bold("OPTIONS")}
|
|
42
|
+
${chalk.cyan("--name <name>")} Custom name for the skill (avoids conflicts)
|
|
43
|
+
${chalk.cyan("--remote")} Source is a Git repository
|
|
44
|
+
${chalk.cyan("--local")} Source is a local folder
|
|
40
45
|
${chalk.cyan("--help, -h")} Show this help message
|
|
41
46
|
${chalk.cyan("--version, -v")} Show version
|
|
42
47
|
|
|
43
48
|
${chalk.bold("EXAMPLES")}
|
|
44
|
-
${chalk.dim("# Add
|
|
45
|
-
${chalk.cyan("skills source add")} https://github.com/
|
|
46
|
-
${chalk.cyan("skills source add")} https://github.com/user/repo/tree/main/skills/my-skill --remote
|
|
49
|
+
${chalk.dim("# Add a skill from GitHub")}
|
|
50
|
+
${chalk.cyan("skills source add")} https://github.com/user/repo/tree/main/skills/react --remote
|
|
47
51
|
|
|
48
|
-
${chalk.dim("# Add
|
|
52
|
+
${chalk.dim("# Add with custom name (to avoid conflicts)")}
|
|
53
|
+
${chalk.cyan("skills source add")} https://github.com/user/repo --remote --name my-react-skill
|
|
54
|
+
|
|
55
|
+
${chalk.dim("# Add from GitLab or Bitbucket")}
|
|
49
56
|
${chalk.cyan("skills source add")} https://gitlab.com/user/repo --remote
|
|
50
57
|
${chalk.cyan("skills source add")} https://bitbucket.org/user/repo --remote
|
|
51
58
|
|
|
52
59
|
${chalk.dim("# Add local skills folder")}
|
|
53
60
|
${chalk.cyan("skills source add")} ./my-local-skills --local
|
|
54
61
|
|
|
55
|
-
${chalk.dim("# Add targets
|
|
56
|
-
${chalk.cyan("skills target add")} cursor
|
|
57
|
-
${chalk.cyan("skills target add")} claude
|
|
62
|
+
${chalk.dim("# Add predefined targets (path auto-detected)")}
|
|
63
|
+
${chalk.cyan("skills target add")} cursor
|
|
64
|
+
${chalk.cyan("skills target add")} claude
|
|
65
|
+
${chalk.cyan("skills target add")} gemini
|
|
66
|
+
|
|
67
|
+
${chalk.dim("# Add custom target with specific path")}
|
|
68
|
+
${chalk.cyan("skills target add")} myapp ~/myapp/skills
|
|
69
|
+
|
|
70
|
+
${chalk.dim("# Sync to all targets")}
|
|
58
71
|
${chalk.cyan("skills sync")}
|
|
59
72
|
|
|
73
|
+
${chalk.bold("FOLDER STRUCTURE")}
|
|
74
|
+
${chalk.dim("After sync, skills are stored as:")}
|
|
75
|
+
~/.cursor/skills/skill-name/SKILL.md
|
|
76
|
+
~/.claude/skills/skill-name/SKILL.md
|
|
77
|
+
|
|
60
78
|
${chalk.bold("DOCUMENTATION")}
|
|
61
|
-
${chalk.dim("https://github.com/
|
|
79
|
+
${chalk.dim("https://github.com/dhruvwill/skills")}
|
|
62
80
|
`);
|
|
63
81
|
}
|
|
64
82
|
|
|
@@ -122,9 +140,15 @@ async function main() {
|
|
|
122
140
|
async function handleSourceCommand(subcommand: string, args: string[]) {
|
|
123
141
|
switch (subcommand) {
|
|
124
142
|
case "add": {
|
|
125
|
-
|
|
143
|
+
// Filter out flags to get the path/URL
|
|
144
|
+
const nonFlagArgs = args.filter(a => !a.startsWith("--"));
|
|
145
|
+
const pathOrUrl = nonFlagArgs[0];
|
|
126
146
|
const isRemote = args.includes("--remote");
|
|
127
147
|
const isLocal = args.includes("--local");
|
|
148
|
+
|
|
149
|
+
// Extract --name value
|
|
150
|
+
const nameIndex = args.findIndex(a => a === "--name");
|
|
151
|
+
const customName = nameIndex !== -1 ? args[nameIndex + 1] : undefined;
|
|
128
152
|
|
|
129
153
|
if (!pathOrUrl) {
|
|
130
154
|
console.error("Missing path or URL for source add");
|
|
@@ -141,17 +165,17 @@ async function handleSourceCommand(subcommand: string, args: string[]) {
|
|
|
141
165
|
process.exit(1);
|
|
142
166
|
}
|
|
143
167
|
|
|
144
|
-
await sourceAdd(pathOrUrl, isRemote ? "remote" : "local");
|
|
168
|
+
await sourceAdd(pathOrUrl, isRemote ? "remote" : "local", customName);
|
|
145
169
|
break;
|
|
146
170
|
}
|
|
147
171
|
|
|
148
172
|
case "remove": {
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
151
|
-
console.error("Missing
|
|
173
|
+
const name = args[0];
|
|
174
|
+
if (!name) {
|
|
175
|
+
console.error("Missing skill name for source remove");
|
|
152
176
|
process.exit(1);
|
|
153
177
|
}
|
|
154
|
-
await sourceRemove(
|
|
178
|
+
await sourceRemove(name);
|
|
155
179
|
break;
|
|
156
180
|
}
|
|
157
181
|
|
|
@@ -170,10 +194,11 @@ async function handleTargetCommand(subcommand: string, args: string[]) {
|
|
|
170
194
|
switch (subcommand) {
|
|
171
195
|
case "add": {
|
|
172
196
|
const name = args[0];
|
|
173
|
-
const path = args[1];
|
|
197
|
+
const path = args[1]; // Optional - if not provided, uses known target
|
|
174
198
|
|
|
175
|
-
if (!name
|
|
176
|
-
console.error("Usage: skills target add <name>
|
|
199
|
+
if (!name) {
|
|
200
|
+
console.error("Usage: skills target add <name> [path]");
|
|
201
|
+
console.log(`\nRun ${chalk.cyan("skills target available")} to see predefined targets.`);
|
|
177
202
|
process.exit(1);
|
|
178
203
|
}
|
|
179
204
|
|
|
@@ -195,9 +220,13 @@ async function handleTargetCommand(subcommand: string, args: string[]) {
|
|
|
195
220
|
await targetList();
|
|
196
221
|
break;
|
|
197
222
|
|
|
223
|
+
case "available":
|
|
224
|
+
await targetAvailable();
|
|
225
|
+
break;
|
|
226
|
+
|
|
198
227
|
default:
|
|
199
228
|
console.error(`Unknown target subcommand: ${subcommand}`);
|
|
200
|
-
console.log("Available: add, remove, list");
|
|
229
|
+
console.log("Available: add, remove, list, available");
|
|
201
230
|
process.exit(1);
|
|
202
231
|
}
|
|
203
232
|
}
|
package/src/commands/doctor.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { $ } from "bun";
|
|
3
3
|
import { getSources, getTargets } from "../lib/config.ts";
|
|
4
|
-
import {
|
|
4
|
+
import { getSkillPath, SKILLS_ROOT, SKILLS_STORE, CONFIG_PATH } from "../lib/paths.ts";
|
|
5
5
|
import { directoryExists } from "../lib/hash.ts";
|
|
6
6
|
|
|
7
7
|
interface DiagnosticResult {
|
|
@@ -176,18 +176,18 @@ async function checkSources(): Promise<DiagnosticResult[]> {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
for (const source of sources) {
|
|
179
|
-
const path =
|
|
179
|
+
const path = getSkillPath(source.name);
|
|
180
180
|
const exists = await directoryExists(path);
|
|
181
181
|
|
|
182
182
|
if (exists) {
|
|
183
183
|
results.push({
|
|
184
|
-
name: `
|
|
184
|
+
name: `Skill: ${source.name}`,
|
|
185
185
|
status: "ok",
|
|
186
186
|
message: `${source.type} → ${path}`,
|
|
187
187
|
});
|
|
188
188
|
} else {
|
|
189
189
|
results.push({
|
|
190
|
-
name: `
|
|
190
|
+
name: `Skill: ${source.name}`,
|
|
191
191
|
status: "error",
|
|
192
192
|
message: `Missing directory: ${path}. Run: skills update`,
|
|
193
193
|
});
|