feat: add clone command to fetch remote skills repository#20
feat: add clone command to fetch remote skills repository#20pixincreate merged 15 commits intomasterfrom
Conversation
- Add 'capsync clone <repo>' command to clone remote GitHub repos - Auto-detect default branch (main/master) from remote - Support --branch flag for specific branch - Handle existing source: update vs override with backup - Warn when local has unpushed changes before override - Auto-sync after clone unless --no-sync is passed - Add git2 dependency for programmatic git operations Also: - Rename detailed-working.md to how-it-works.md - Add agents.md documentation for AI agents - Remove unused docs/ directory - Fix clippy warnings (unused fields)
There was a problem hiding this comment.
Pull request overview
This PR adds a new capsync clone <repo> workflow so users can pull a remote skills repository into their configured skills_source, then optionally run a sync to wire those skills into all enabled tool destinations.
Changes:
- Introduces
clonemodule +capsync cloneCLI subcommand with branch selection / auto-detection and post-clone sync. - Adds
git2dependency to perform clone/fetch/reset operations programmatically. - Updates/introduces documentation under
documentation/and adjusts README examples.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/main.rs |
Wires in the new clone module for the binary. |
src/lib.rs |
Exposes clone module from the library crate. |
src/clone.rs |
Implements repo URL parsing, default-branch detection, clone/update/override flows. |
src/cli.rs |
Adds capsync clone subcommand and integrates clone + optional sync into CLI. |
README.md |
Adjusts example paths (casing) in the symlink walkthrough + config snippet. |
documentation/how-it-works.md |
Adds detailed architecture/behavior narrative (needs an update for new clone behavior). |
documentation/agents.md |
Adds agent-oriented command/config reference including clone. |
Cargo.toml |
Adds git2 dependency. |
Cargo.lock |
Locks new transitive dependencies (libgit2/openssl/etc). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix URL parsing to handle owner/repo.git without doubling .git - Fix has_unpushed_changes to use proper bitflag methods - Check for dirty tree before update (hard reset would lose changes) - Prompt for confirmation when skills_source is not a git repo - Fix remote ref lookup using find_branch with Remote type - Propagate fetch errors instead of ignoring silently - Fix override prompt text mismatch - Improve clone_repo error handling (distinguish file-not-found) - Fix README case consistency (~/Dev/ -> ~/dev/) - Remove GitHub hardcoding, accept any valid git URL
Test parse_repo_url with: - Full https/http URLs - Git SSH URLs - Non-GitHub providers (Codeberg, GitLab, Bitbucket) - Whitespace/trailing slash trimming - Invalid URL handling
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 10 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add owner/repo shorthand support in parse_repo_url - Filter out origin/HEAD in find_default_branch - Use actual remote name in fetch refspec (not hardcoded origin) - Fix error message to say 'uncommitted or unpushed changes' - Change get_remote_url to return Result<Option<String>> to distinguish no remote (None) from not a git repo (error) - Add test for owner/repo shorthand
732f593 to
cd1b4f6
Compare
- Look up local branch first, then its upstream (fixes update existing) - Use if let instead of match for single patterns - Remove redundant comments that state the obvious
Changed 'fresh clone' to 'download new' to match actual behavior (backup is only created when local changes exist)
- Fix prompt text in agents.md (fresh clone → download new)
6bf3d26 to
cccefe9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Also: