Skip to content

feat: add clone command to fetch remote skills repository#20

Merged
pixincreate merged 15 commits intomasterfrom
feature/clone
Apr 11, 2026
Merged

feat: add clone command to fetch remote skills repository#20
pixincreate merged 15 commits intomasterfrom
feature/clone

Conversation

@pixincreate
Copy link
Copy Markdown
Owner

  • Add 'capsync clone ' 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)

- 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)
@pixincreate pixincreate self-assigned this Apr 8, 2026
@pixincreate pixincreate requested a review from Copilot April 8, 2026 18:45
@pixincreate pixincreate added the enhancement New feature or request label Apr 8, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 clone module + capsync clone CLI subcommand with branch selection / auto-detection and post-clone sync.
  • Adds git2 dependency 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.

Comment thread src/clone.rs Outdated
Comment thread src/clone.rs Outdated
Comment thread src/clone.rs Outdated
Comment thread src/clone.rs
Comment thread src/clone.rs Outdated
Comment thread src/clone.rs
Comment thread README.md
Comment thread Cargo.toml Outdated
Comment thread src/cli.rs
Comment thread src/clone.rs Outdated
- 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
Copilot AI review requested due to automatic review settings April 8, 2026 19:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/clone.rs
Comment thread src/clone.rs
Comment thread src/clone.rs Outdated
Comment thread src/clone.rs Outdated
Comment thread src/clone.rs Outdated
Comment thread src/clone.rs
Comment thread tests/clone_test.rs Outdated
Comment thread documentation/agents.md
- 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
- 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)
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/clone.rs
Comment thread src/clone.rs
Comment thread README.md
Comment thread README.md Outdated
@pixincreate pixincreate merged commit a008de7 into master Apr 11, 2026
6 checks passed
@pixincreate pixincreate deleted the feature/clone branch April 11, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants