Skip to content

Commit a008de7

Browse files
authored
feat: add clone command to fetch remote skills repository (#20)
1 parent cd6cd80 commit a008de7

11 files changed

Lines changed: 1608 additions & 25 deletions

File tree

Cargo.lock

Lines changed: 403 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dirs = "6.0"
2323
anyhow = "1.0"
2424
tempfile = "3.27"
2525
shellexpand = "3.1"
26+
git2 = "0.20.4"
2627

2728
[dev-dependencies]
2829
tempfile = "3.27"

README.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ CapSync solves this by creating a single source of truth for your skills and com
3131

3232
**What CapSync Is Not:**
3333

34-
- A skill or command discovery tool. CapSync does not find or download skills/commands from the internet
34+
- A skill or command discovery tool. CapSync does not search registries or catalogs for skills/commands on your behalf
3535
- A skill or command installer. You must already have skills/commands in your source directories
3636
- A skill or command creator. CapSync only syncs what you already have
3737

3838
**Prerequisites:**
3939
You need to have skills (and optionally commands) already installed in local directories before using CapSync. CapSync assumes you have:
4040

41-
- A directory containing your skills (e.g., `~/Dev/scripts/skills`)
42-
- Optionally, a directory containing your commands (e.g., `~/Dev/scripts/commands`)
41+
- A directory containing your skills (e.g., `~/dev/scripts/skills`)
42+
- Optionally, a directory containing your commands (e.g., `~/dev/scripts/commands`)
4343
- Skills and commands formatted for your AI tools
4444

45-
If you are looking for a tool to discover and install skills from a registry or repository, that is not what CapSync does. That may be a future feature, but for now, CapSync only syncs skills you already possess.
45+
If you already know which Git repository you want, `capsync clone` can download it into your configured skills source. CapSync still does not browse, rank, or discover skills for you.
4646

4747
## Installation
4848

@@ -99,7 +99,7 @@ cargo install --path .
9999

100100
Run `capsync init` to create your configuration. The tool will:
101101

102-
1. Ask for your skills directory path (supports `$HOME`, `~`, and other shell variables)
102+
1. Ask for your skills source directory path (supports `$HOME`, `~`, and other shell variables)
103103
2. Automatically detect if a `commands/` subdirectory exists in your skills directory
104104
3. Prompt to enable commands if found
105105
4. Scan your system for installed AI coding tools
@@ -110,7 +110,7 @@ Run `capsync init` to create your configuration. The tool will:
110110
$ capsync init
111111
Welcome to CapSync! Let's set up your configuration.
112112
113-
Enter your skills directory: $HOME/Dev/scripts/skills
113+
Enter your skills source directory: $HOME/dev/scripts/skills
114114
115115
Detecting installed tools...
116116
Detected and enabled: claude, opencode
@@ -124,9 +124,10 @@ If a `commands/` subdirectory is found in your skills directory:
124124
$ capsync init
125125
Welcome to CapSync! Let's set up your configuration.
126126

127-
Enter your skills directory: $HOME/Dev/scripts/skills
127+
Enter your skills source directory: $HOME/dev/scripts/skills
128128

129-
Found commands/ subdirectory. Enable commands? [Y/n]: Y
129+
Found commands/ subdirectory in skills source.
130+
Enable commands? [Y/n]: Y
130131

131132
Detecting installed tools...
132133
Detected and enabled: claude, opencode
@@ -190,7 +191,7 @@ CapSync uses directory symlinks (symbolic links) to connect your skills to each
190191

191192
### The Setup
192193

193-
1. You designate one directory as your skills source (e.g., `~/Dev/scripts/skills/skills`)
194+
1. You designate one directory as your skills source (e.g., `~/dev/scripts/skills/skills`)
194195
2. CapSync creates symlinks from that directory to each tool's expected skills location
195196
3. Each tool sees your skills as if they were native to that tool
196197

@@ -207,7 +208,7 @@ CapSync uses directory symlinks (symbolic links) to connect your skills to each
207208
Before CapSync:
208209

209210
```
210-
~/Dev/scripts/skills/
211+
~/dev/scripts/skills/
211212
├── my-skill/
212213
│ └── SKILL.md
213214
@@ -223,24 +224,24 @@ Before CapSync:
223224
After CapSync:
224225

225226
```
226-
~/Dev/scripts/skills/
227+
~/dev/scripts/skills/
227228
└── my-skill/
228229
└── SKILL.md (original)
229230
230231
~/.config/opencode/skill/
231-
└── my-skill -> ~/Dev/scripts/skills/my-skill (symlink)
232+
└── my-skill -> ~/dev/scripts/skills/my-skill (symlink)
232233
233234
~/.claude/skills/
234-
└── my-skill -> ~/Dev/scripts/skills/my-skill (symlink)
235+
└── my-skill -> ~/dev/scripts/skills/my-skill (symlink)
235236
```
236237

237238
## Configuration File
238239

239240
CapSync stores its configuration at `~/.config/capsync/config.toml`:
240241

241242
```toml
242-
skills_source = "/Users/you/Dev/scripts/skills"
243-
commands_source = "/Users/you/Dev/scripts/commands"
243+
skills_source = "/Users/you/dev/scripts/skills"
244+
commands_source = "/Users/you/dev/scripts/commands"
244245

245246
[destinations.opencode]
246247
enabled = true
@@ -308,6 +309,24 @@ Scan system for installed AI coding tools without modifying config.
308309

309310
Create or update symlinks for all enabled tools.
310311

312+
### `capsync clone <repo>`
313+
314+
Clone a remote Git repository into your configured skills source.
315+
316+
Supported inputs:
317+
318+
- `owner/repo`
319+
- `https://...`
320+
- `http://...`
321+
- `git@...`
322+
323+
Options:
324+
325+
- `--branch <name>`: Clone a specific branch instead of auto-detecting the remote default branch
326+
- `--no-sync`: Skip running `capsync sync` after the clone finishes
327+
328+
If the skills source already exists, CapSync prompts before replacing it. During override, it offers a backup when local changes would otherwise be lost.
329+
311330
### `capsync add <tool>`
312331

313332
Add a tool to configuration and sync automatically.

0 commit comments

Comments
 (0)