mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
BREAKING CHANGE: Command restructure for clearer symmetry - Local sync: sync/collect (Source ↔ Targets) - Remote sync: push/pull (Source ↔ Git Remote) Changes: - Add `collect` command (was `pull <target>`) - Simplify `pull` to git remote only (was `pull --remote`) - Add spinner effects to pull and push commands - Update all documentation and skill references - Add CHANGELOG.md - Update help examples with practical workflows Migration: pull claude → collect claude pull --all → collect --all pull --remote → pull
11 KiB
11 KiB
Cross-Machine Sync
Sync your skills across multiple computers using git.
Overview
┌──────────────────────────────────────────────────────────────┐
│ CROSS-MACHINE SYNC │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Machine A │ │ Machine B │ │
│ │ (Work) │ │ (Home) │ │
│ │ │ │ │ │
│ │ ┌───────────┐ │ │ ┌───────────┐ │ │
│ │ │ Claude │ │ │ │ Claude │ │ │
│ │ │ Cursor │ │ │ │ Codex │ │ │
│ │ └─────┬─────┘ │ │ └─────┬─────┘ │ │
│ │ │ │ │ │ │ │
│ │ ▼ │ │ ▼ │ │
│ │ ┌───────────┐ │ push pull │ ┌───────────┐ │ │
│ │ │ Source │──┼────────►───────────┼──│ Source │ │ │
│ │ │ (git) │ │ ┌──────────┐ │ │ (git) │ │ │
│ │ └───────────┘ │ │ GitHub │ │ └───────────┘ │ │
│ │ │ │ Remote │ │ │ │
│ └─────────────────┘ └──────────┘ └─────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────┘
Setup
Option 1: New Setup with Remote
skillshare init --remote git@github.com:you/my-skills.git
This:
- Creates source directory
- Initializes git
- Adds remote
- Auto-detects and configures targets
Option 2: Add Remote to Existing
cd ~/.config/skillshare/skills
git init
git remote add origin git@github.com:you/my-skills.git
git add .
git commit -m "Initial commit"
git push -u origin main
Daily Workflow
Machine A: Make Changes and Push
# Edit skills in source or any target
# Then push to remote:
skillshare push -m "Add new pdf skill"
Machine B: Pull and Sync
skillshare pull
That's it. Your skills are now synced across machines.
Commands
Push
Commit and push local changes to remote.
skillshare push # Auto-generated commit message
skillshare push -m "Add pdf" # Custom message
What happens:
┌─────────────────────────────────────────────────────────────────┐
│ skillshare push -m "Add pdf skill" │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ cd ~/.config/skillshare/skills │
│ git add . │
│ git commit -m "Add pdf skill" │
│ git push origin main │
└─────────────────────────────────────────────────────────────────┘
Pull from Remote
Pull remote changes and sync to all targets.
skillshare pull
What happens:
┌─────────────────────────────────────────────────────────────────┐
│ skillshare pull │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 1. cd ~/.config/skillshare/skills │
│ git pull origin main │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 2. skillshare sync (automatic) │
│ Updates all targets with new/changed skills │
└─────────────────────────────────────────────────────────────────┘
Second Machine Setup
Setting up a new machine to use your shared skills:
# 1. Clone your skills repo
git clone git@github.com:you/my-skills.git ~/.config/skillshare/skills
# 2. Initialize skillshare (uses existing source)
skillshare init --source ~/.config/skillshare/skills
# 3. Sync to all local targets
skillshare sync
Flow diagram:
┌─────────────────────────────────────────────────────────────────┐
│ SECOND MACHINE SETUP │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 1. git clone │
│ │
│ GitHub ─────────────────► ~/.config/skillshare/skills/ │
│ Remote (your skills are here now) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 2. skillshare init --source ~/.config/skillshare/skills │
│ │
│ • Detects existing source directory │
│ • Auto-detects installed AI CLIs │
│ • Creates config.yaml │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 3. skillshare sync │
│ │
│ Source ─────────────────► Claude, Cursor, Codex, ... │
│ (symlinks created) │
└─────────────────────────────────────────────────────────────────┘
Conflict Handling
Push Fails (Remote Ahead)
$ skillshare push
Error: remote has changes. Run 'skillshare pull' first.
Solution:
skillshare pull # Get remote changes first
skillshare push # Now push works
Pull Fails (Local Uncommitted Changes)
$ skillshare pull
Error: local has uncommitted changes. Run 'skillshare push' first.
Solution:
skillshare push -m "Save local changes"
skillshare pull
Merge Conflicts
If git encounters merge conflicts:
cd ~/.config/skillshare/skills
git status # See conflicted files
# Edit files to resolve conflicts
git add .
git commit -m "Resolve conflicts"
skillshare sync # Sync resolved changes
Tips
Private Repository
Use SSH URL for private repos:
skillshare init --remote git@github.com:you/private-skills.git
Check Remote Status
skillshare status
# Shows: Git: clean (remote: origin) or Git: 2 commits ahead
Multiple Remotes
You can add multiple remotes manually:
cd ~/.config/skillshare/skills
git remote add backup git@gitlab.com:you/skills-backup.git
git push backup main
Related
- sync.md — Sync operations
- team-edition.md — Team sharing with tracked repos
- configuration.md — Config file reference