@dhruvwill/skills-cli 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 +132 -69
- package/_config.yml +9 -0
- 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 +84 -5
- package/src/commands/update.ts +12 -12
- package/src/lib/config.ts +67 -6
- package/src/lib/known-targets.ts +106 -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
|
|
|
@@ -48,7 +50,7 @@ skills sync # Done! Skills synced to all targets
|
|
|
48
50
|
|
|
49
51
|
```bash
|
|
50
52
|
# Clone the repository
|
|
51
|
-
git clone https://github.com/
|
|
53
|
+
git clone https://github.com/dhruvwill/skills.git
|
|
52
54
|
cd skills
|
|
53
55
|
|
|
54
56
|
# Install dependencies
|
|
@@ -72,12 +74,12 @@ skills doctor
|
|
|
72
74
|
## Quick Start
|
|
73
75
|
|
|
74
76
|
```bash
|
|
75
|
-
# 1. Add a skill
|
|
77
|
+
# 1. Add a skill from GitHub
|
|
76
78
|
skills source add https://github.com/vercel-labs/agent-skills/tree/main/skills/react-best-practices --remote
|
|
77
79
|
|
|
78
|
-
# 2. Add your targets (
|
|
79
|
-
skills target add cursor
|
|
80
|
-
skills target add claude
|
|
80
|
+
# 2. Add your targets (path auto-detected for known tools)
|
|
81
|
+
skills target add cursor
|
|
82
|
+
skills target add claude
|
|
81
83
|
|
|
82
84
|
# 3. Sync!
|
|
83
85
|
skills sync
|
|
@@ -86,7 +88,7 @@ skills sync
|
|
|
86
88
|
Check your setup anytime:
|
|
87
89
|
|
|
88
90
|
```bash
|
|
89
|
-
skills status # Overview of
|
|
91
|
+
skills status # Overview of skills & targets
|
|
90
92
|
skills doctor # Diagnose issues
|
|
91
93
|
```
|
|
92
94
|
|
|
@@ -104,8 +106,7 @@ skills doctor # Diagnose issues
|
|
|
104
106
|
┌─────────────────────────────────────────────────────────────┐
|
|
105
107
|
│ ~/.skills/store/ │
|
|
106
108
|
│ │
|
|
107
|
-
│
|
|
108
|
-
│ └── react-best-... └── cursor-... └── my-skill/ │
|
|
109
|
+
│ react-best-practices/ my-custom-skill/ local-skill/ │
|
|
109
110
|
│ │
|
|
110
111
|
│ ⬆ Single Source of Truth ⬆ │
|
|
111
112
|
└─────────────────────────────────────────────────────────────┘
|
|
@@ -114,7 +115,7 @@ skills doctor # Diagnose issues
|
|
|
114
115
|
┌─────────────────────┼─────────────────────┐
|
|
115
116
|
▼ ▼ ▼
|
|
116
117
|
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
|
|
117
|
-
│ Cursor │ │
|
|
118
|
+
│ Cursor │ │ Claude Code │ │ Gemini CLI │
|
|
118
119
|
│ ~/.cursor/ │ │ ~/.claude/ │ │ ~/.gemini/ │
|
|
119
120
|
│ skills/ │ │ skills/ │ │ skills/ │
|
|
120
121
|
└───────────────┘ └───────────────┘ └───────────────┘
|
|
@@ -128,31 +129,69 @@ skills doctor # Diagnose issues
|
|
|
128
129
|
|
|
129
130
|
| Command | Description |
|
|
130
131
|
|---------|-------------|
|
|
131
|
-
| `skills status` | Show overview of
|
|
132
|
+
| `skills status` | Show overview of skills, targets & sync state |
|
|
132
133
|
| `skills doctor` | Diagnose configuration issues |
|
|
133
134
|
| `skills sync` | Push skills from store to all targets |
|
|
134
|
-
| `skills update` | Refresh all
|
|
135
|
+
| `skills update` | Refresh all skills from origin |
|
|
135
136
|
|
|
136
|
-
###
|
|
137
|
+
### Skill Management
|
|
137
138
|
|
|
138
139
|
| Command | Description |
|
|
139
140
|
|---------|-------------|
|
|
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
|
|
141
|
+
| `skills source list` | List all registered skills |
|
|
142
|
+
| `skills source add <url> --remote` | Add a skill from Git repository |
|
|
143
|
+
| `skills source add <path> --local` | Add a skill from local folder |
|
|
144
|
+
| `skills source add <url> --remote --name <name>` | Add with custom name |
|
|
145
|
+
| `skills source remove <name>` | Remove a skill by name |
|
|
144
146
|
|
|
145
147
|
### Target Management
|
|
146
148
|
|
|
147
149
|
| Command | Description |
|
|
148
150
|
|---------|-------------|
|
|
149
151
|
| `skills target list` | List all targets with sync status |
|
|
150
|
-
| `skills target
|
|
152
|
+
| `skills target available` | Show predefined targets with paths |
|
|
153
|
+
| `skills target add <name>` | Add a predefined target (auto-detects path) |
|
|
154
|
+
| `skills target add <name> <path>` | Add a custom target with specific path |
|
|
151
155
|
| `skills target remove <name>` | Remove a target |
|
|
152
156
|
|
|
153
157
|
---
|
|
154
158
|
|
|
155
|
-
##
|
|
159
|
+
## Supported Tools
|
|
160
|
+
|
|
161
|
+
Run `skills target available` to see all supported tools:
|
|
162
|
+
|
|
163
|
+
| Tool | Path | Status |
|
|
164
|
+
|------|------|--------|
|
|
165
|
+
| **Cursor** | `~/.cursor/skills/` | GA |
|
|
166
|
+
| **Claude Code** | `~/.claude/skills/` | GA |
|
|
167
|
+
| **GitHub Copilot** | `~/.copilot/skills/` | GA |
|
|
168
|
+
| **OpenCode** | `~/.config/opencode/skills/` | GA |
|
|
169
|
+
| **Windsurf** | `~/.windsurf/skills/` | GA |
|
|
170
|
+
| **Gemini CLI** | `~/.gemini/skills/` | Beta |
|
|
171
|
+
| **Aider** | `~/.aider/skills/` | Beta |
|
|
172
|
+
| **Goose** | `~/.config/goose/skills/` | Beta |
|
|
173
|
+
| **Amp** | `~/.amp/skills/` | Beta |
|
|
174
|
+
| **Antigravity** | `~/.gemini/antigravity/` | Experimental |
|
|
175
|
+
|
|
176
|
+
### Adding Predefined Targets
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Just use the name - path is auto-detected
|
|
180
|
+
skills target add cursor
|
|
181
|
+
skills target add claude
|
|
182
|
+
skills target add gemini
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Adding Custom Targets
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# For tools not in the list, specify the path
|
|
189
|
+
skills target add mytool ~/path/to/mytool/skills
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Adding Skills
|
|
156
195
|
|
|
157
196
|
### From GitHub
|
|
158
197
|
|
|
@@ -161,7 +200,10 @@ skills doctor # Diagnose issues
|
|
|
161
200
|
skills source add https://github.com/owner/repo --remote
|
|
162
201
|
|
|
163
202
|
# Specific subdirectory (great for mono-repos)
|
|
164
|
-
skills source add https://github.com/owner/repo/tree/main/skills/
|
|
203
|
+
skills source add https://github.com/owner/repo/tree/main/skills/my-skill --remote
|
|
204
|
+
|
|
205
|
+
# With custom name (to avoid conflicts)
|
|
206
|
+
skills source add https://github.com/owner/repo --remote --name my-custom-name
|
|
165
207
|
```
|
|
166
208
|
|
|
167
209
|
### From GitLab
|
|
@@ -187,26 +229,6 @@ skills source add /absolute/path/to/skills --local
|
|
|
187
229
|
|
|
188
230
|
---
|
|
189
231
|
|
|
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
232
|
## Configuration
|
|
211
233
|
|
|
212
234
|
### Directory Structure
|
|
@@ -214,11 +236,28 @@ skills target add myapp ~/myapp/ai-skills
|
|
|
214
236
|
```
|
|
215
237
|
~/.skills/
|
|
216
238
|
├── store/ # Central repository for all skills
|
|
217
|
-
│ ├──
|
|
218
|
-
│
|
|
239
|
+
│ ├── react-best-practices/ # Each skill in its own folder
|
|
240
|
+
│ │ ├── SKILL.md
|
|
241
|
+
│ │ └── rules/
|
|
242
|
+
│ └── my-custom-skill/
|
|
243
|
+
│ └── SKILL.md
|
|
219
244
|
└── config.json # Registry of sources and targets
|
|
220
245
|
```
|
|
221
246
|
|
|
247
|
+
### Skill Folder Structure
|
|
248
|
+
|
|
249
|
+
Each skill should follow this structure:
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
skill-name/
|
|
253
|
+
├── SKILL.md # Main skill definition (required)
|
|
254
|
+
├── AGENTS.md # Agent behavior (optional)
|
|
255
|
+
├── rules/ # Additional rules (optional)
|
|
256
|
+
│ ├── rule-1.md
|
|
257
|
+
│ └── rule-2.md
|
|
258
|
+
└── metadata.json # Skill metadata (optional)
|
|
259
|
+
```
|
|
260
|
+
|
|
222
261
|
### Config File
|
|
223
262
|
|
|
224
263
|
Located at `~/.skills/config.json`:
|
|
@@ -229,18 +268,22 @@ Located at `~/.skills/config.json`:
|
|
|
229
268
|
{
|
|
230
269
|
"type": "remote",
|
|
231
270
|
"url": "https://github.com/owner/repo/tree/main/skills/my-skill",
|
|
232
|
-
"
|
|
271
|
+
"name": "my-skill"
|
|
233
272
|
},
|
|
234
273
|
{
|
|
235
274
|
"type": "local",
|
|
236
275
|
"path": "/home/user/my-skills",
|
|
237
|
-
"
|
|
276
|
+
"name": "my-local-skill"
|
|
238
277
|
}
|
|
239
278
|
],
|
|
240
279
|
"targets": [
|
|
241
280
|
{
|
|
242
281
|
"name": "cursor",
|
|
243
282
|
"path": "/home/user/.cursor/skills"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "claude",
|
|
286
|
+
"path": "/home/user/.claude/skills"
|
|
244
287
|
}
|
|
245
288
|
]
|
|
246
289
|
}
|
|
@@ -257,14 +300,27 @@ Skills CLI provides:
|
|
|
257
300
|
- **Git integration** - Pull updates from remote repos with `skills update`
|
|
258
301
|
- **Subdirectory support** - Install specific skills from large mono-repos
|
|
259
302
|
- **Status tracking** - Know which targets are synced or outdated
|
|
303
|
+
- **Auto-detection** - No need to remember paths for common tools
|
|
260
304
|
|
|
261
|
-
###
|
|
305
|
+
### What happens when I run `skills sync`?
|
|
262
306
|
|
|
263
|
-
|
|
307
|
+
The contents of `~/.skills/store/` are copied to all registered target directories, maintaining the folder structure:
|
|
264
308
|
|
|
265
|
-
|
|
309
|
+
```
|
|
310
|
+
~/.skills/store/my-skill/ → ~/.cursor/skills/my-skill/
|
|
311
|
+
→ ~/.claude/skills/my-skill/
|
|
312
|
+
→ ~/.gemini/skills/my-skill/
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### How do I handle naming conflicts?
|
|
266
316
|
|
|
267
|
-
|
|
317
|
+
Use the `--name` flag when adding skills:
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# Two different "utils" skills from different repos
|
|
321
|
+
skills source add https://github.com/user1/repo --remote --name user1-utils
|
|
322
|
+
skills source add https://github.com/user2/repo --remote --name user2-utils
|
|
323
|
+
```
|
|
268
324
|
|
|
269
325
|
### How do I update skills from remote sources?
|
|
270
326
|
|
|
@@ -273,13 +329,12 @@ skills update # Pulls latest from all remote sources
|
|
|
273
329
|
skills sync # Pushes to all targets
|
|
274
330
|
```
|
|
275
331
|
|
|
276
|
-
###
|
|
332
|
+
### Can I add a tool that's not in the predefined list?
|
|
277
333
|
|
|
278
|
-
|
|
334
|
+
Yes! Just specify the path:
|
|
279
335
|
|
|
280
336
|
```bash
|
|
281
|
-
skills
|
|
282
|
-
skills source add https://github.com/owner/new-skill --remote
|
|
337
|
+
skills target add mytool ~/path/to/mytool/skills
|
|
283
338
|
```
|
|
284
339
|
|
|
285
340
|
---
|
|
@@ -290,25 +345,33 @@ skills source add https://github.com/owner/new-skill --remote
|
|
|
290
345
|
|
|
291
346
|
Install Git from [git-scm.com](https://git-scm.com/) or via your package manager.
|
|
292
347
|
|
|
293
|
-
### "
|
|
348
|
+
### "Skill already exists"
|
|
294
349
|
|
|
295
|
-
|
|
350
|
+
Either remove it first or use `--name` to give it a different name:
|
|
296
351
|
|
|
297
352
|
```bash
|
|
298
|
-
skills source remove
|
|
353
|
+
skills source remove old-skill
|
|
299
354
|
skills source add <url> --remote
|
|
355
|
+
|
|
356
|
+
# Or use a different name
|
|
357
|
+
skills source add <url> --remote --name new-name
|
|
300
358
|
```
|
|
301
359
|
|
|
302
|
-
### "
|
|
360
|
+
### "Unknown target"
|
|
361
|
+
|
|
362
|
+
The target isn't in the predefined list. Specify the path:
|
|
303
363
|
|
|
304
|
-
|
|
364
|
+
```bash
|
|
365
|
+
skills target add mytool ~/path/to/skills
|
|
366
|
+
```
|
|
305
367
|
|
|
306
368
|
### Need help?
|
|
307
369
|
|
|
308
370
|
```bash
|
|
309
|
-
skills doctor
|
|
310
|
-
skills status
|
|
311
|
-
skills
|
|
371
|
+
skills doctor # Run diagnostics
|
|
372
|
+
skills status # Check current state
|
|
373
|
+
skills target available # See predefined targets
|
|
374
|
+
skills --help # Show all commands
|
|
312
375
|
```
|
|
313
376
|
|
|
314
377
|
---
|
|
@@ -316,7 +379,7 @@ skills --help # Show all commands
|
|
|
316
379
|
## Contributing
|
|
317
380
|
|
|
318
381
|
```bash
|
|
319
|
-
git clone https://github.com/
|
|
382
|
+
git clone https://github.com/dhruvwill/skills.git
|
|
320
383
|
cd skills
|
|
321
384
|
bun install
|
|
322
385
|
bun test
|
package/_config.yml
ADDED
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
|
});
|