{"id":48924119,"url":"https://github.com/loongxjin/forksync","last_synced_at":"2026-04-26T18:00:40.837Z","repository":{"id":351226109,"uuid":"1209187648","full_name":"loongxjin/forksync","owner":"loongxjin","description":"🔄 Auto-sync GitHub fork repos with upstream. Resolve merge conflicts using AI agents (Claude Code, OpenCode, Droid, Codex). Desktop app (Electron) + CLI.","archived":false,"fork":false,"pushed_at":"2026-04-26T16:13:57.000Z","size":12526,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T17:27:44.414Z","etag":null,"topics":["ai-agent","auto-sync","github-fork","merge-conflict"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loongxjin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T07:17:08.000Z","updated_at":"2026-04-26T16:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/loongxjin/forksync","commit_stats":null,"previous_names":["loongxjin/forksync"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/loongxjin/forksync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loongxjin%2Fforksync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loongxjin%2Fforksync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loongxjin%2Fforksync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loongxjin%2Fforksync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loongxjin","download_url":"https://codeload.github.com/loongxjin/forksync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loongxjin%2Fforksync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32307015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T17:23:19.671Z","status":"ssl_error","status_checked_at":"2026-04-26T17:23:19.195Z","response_time":129,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","auto-sync","github-fork","merge-conflict"],"created_at":"2026-04-17T06:04:24.127Z","updated_at":"2026-04-26T18:00:40.831Z","avatar_url":"https://github.com/loongxjin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🔀 ForkSync\n\n**Auto-sync your GitHub fork repos — resolve conflicts with AI.**\n\n[English](./README.md) · [中文](./README_zh.md)\n\n[![Go](https://img.shields.io/badge/Go-1.22+-00ADD8?logo=go\u0026logoColor=white)](https://go.dev/)\n[![Electron](https://img.shields.io/badge/Electron-31-47848F?logo=electron\u0026logoColor=white)](https://www.electronjs.org/)\n[![React](https://img.shields.io/badge/React-18-61DAFB?logo=react\u0026logoColor=black)](https://react.dev/)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"image/README/1776830486988.png\" alt=\"ForkSync Desktop App\" width=\"720\"\u003e\n\u003c/p\u003e\n\n---\n\n## Why ForkSync?\n\nMaintaining forked repositories is tedious. Upstream authors keep shipping changes, and every sync risks merge conflicts. You either:\n\n- ❌ **Forget to sync** — your fork falls behind, missing bug fixes and features\n- ❌ **Resolve conflicts manually** — reading `\u003c\u003c\u003c\u003c\u003c\u003c\u003c` markers for hours\n- ❌ **Give up and re-fork** — losing your local modifications\n\n**ForkSync solves this.** It automatically syncs your forks and uses AI coding agents (Claude Code, OpenCode, Droid, Codex) to resolve merge conflicts — so you never have to touch conflict markers again.\n\n## ✨ Key Features\n\n| Feature | Description |\n|---------|-------------|\n| 🔄 **Auto Sync** | Periodically fetches and merges upstream changes (configurable interval) |\n| 🤖 **AI Conflict Resolution** | Delegates merge conflicts to AI agents (Claude Code, OpenCode, Droid, Codex) |\n| 🖥️ **Desktop App** | Polished Electron GUI — dashboard, conflict viewer, settings |\n| ⌨️ **CLI** | Full-featured command-line tool for terminal workflows |\n| 🔍 **Directory Scanner** | Recursively scans any directory to discover and batch-add fork repos |\n| 📝 **Sync History** | SQLite-backed history with filters, AI-generated summaries, and cleanup |\n| 🔔 **System Notifications** | macOS native alerts on sync success, conflicts, or errors |\n| 🖥️ **IDE Integration** | Open repos directly in VSCode, Cursor, or Trae |\n| 🌐 **i18n** | Multi-language interface |\n| ⚙️ **Flexible Strategies** | `preserve_ours` / `preserve_theirs` / `balanced` / `agent_resolve` |\n\n---\n\n## 📦 Install\n\n### Download\n\nGrab the latest release for your platform:\n\n| Platform | Format | Link |\n|----------|--------|------|\n| macOS | `.dmg` | [Releases](https://github.com/loongxjin/forksync/releases) |\n| Linux | `.AppImage` | [Releases](https://github.com/loongxjin/forksync/releases) |\n| Windows | `.exe` (NSIS) | [Releases](https://github.com/loongxjin/forksync/releases) |\n\n### Build from Source\n\n```bash\ngit clone https://github.com/loongxjin/forksync.git\ncd forksync\n\n# Full build (Go engine + Electron app)\nmake build\n# Output: app/dist/\n```\n\n### CLI Only\n\n```bash\ncd engine \u0026\u0026 go build -o forksync . \u0026\u0026 ./forksync --help\n```\n\n---\n\n## 🚀 Quick Start\n\n### 1. Configure GitHub Token (Recommended)\n\n```bash\nmkdir -p ~/.forksync\n```\n\nEdit `~/.forksync/config.yaml`:\n\n```yaml\ngithub:\n  token: \"ghp_your_token_here\"\n```\n\n\u003e Token is optional but recommended — it enables automatic upstream detection via GitHub API.\n\n### 2. Add Repos\n\n```bash\n# Add a single repo\nforksync add ~/projects/my-fork\n\n# Scan a directory to batch-discover fork repos\nforksync scan ~/projects\n```\n\n### 3. Sync\n\n```bash\n# Sync all repos\nforksync sync --all\n\n# Sync a specific repo\nforksync sync my-fork\n\n# Start background sync service (every 30 min)\nforksync serve\n```\n\n### 4. Resolve Conflicts with AI\n\n```bash\n# Resolve conflicts using AI (interactive)\nforksync resolve my-fork\n\n# Use a specific agent, auto-commit\nforksync resolve my-fork --agent claude --no-confirm\n```\n\n### 5. Launch Desktop App\n\n```bash\ncd app \u0026\u0026 npm install \u0026\u0026 npm run dev\n```\n\n---\n\n## 🤖 AI Conflict Resolution\n\nThis is the core feature that sets ForkSync apart. When a sync produces merge conflicts, ForkSync can automatically delegate resolution to an AI coding agent:\n\n```\n┌─────────────┐    conflict     ┌───────────────┐    resolve    ┌────────────────┐\n│   Upstream   │ ──────────────▶ │  ForkSync     │ ────────────▶│  AI Agent      │\n│   Change     │                 │  detects      │              │  (Claude/etc.) │\n└─────────────┘                 │  conflict     │              └───────┬────────┘\n                                └───────────────┘                      │\n                                                                       │ resolved\n                                                                       ▼\n                                ┌───────────────┐              ┌────────────────┐\n                                │  ForkSync     │ ◀───────────│  Verify \u0026      │\n                                │  commits      │   commit    │  Commit        │\n                                └───────────────┘              └────────────────┘\n```\n\n**Supported Agents:**\n\n| Agent | Binary | Auto-detected |\n|-------|--------|:------------:|\n| Claude Code | `claude` | ✅ |\n| OpenCode | `opencode` | ✅ |\n| Droid | `droid` | ✅ |\n| Codex | `codex` | ✅ |\n\nAgents are auto-discovered via `PATH`. Set a preferred agent in config:\n\n```yaml\nagent:\n  preferred: \"claude\"\n  conflict_strategy: \"agent_resolve\"\n```\n\n**Resolution strategies:**\n\n| Strategy | Behavior |\n|----------|----------|\n| `preserve_ours` | Keep local changes, accept non-conflicting upstream |\n| `preserve_theirs` | Prefer upstream changes |\n| `balanced` | Smart merge preserving both sides |\n| `agent_resolve` | Delegate to AI agent |\n\n---\n\n## 🖥️ Desktop App\n\nBuilt with **Electron** + **React** + **TypeScript** + **Tailwind CSS** + **shadcn/ui**.\n\n| Page | Description |\n|------|-------------|\n| **Dashboard** | Overview: synced/conflict counts, recent activity, agent status |\n| **Repos** | Add, scan, sync, remove repositories |\n| **Conflicts** | List repos with conflicts, resolve via agents |\n| **Conflict Detail** | Diff viewer, agent summary, accept/reject resolution |\n| **History** | Sync timeline with filters and cleanup |\n| **Settings** | General settings, agent config, IDE preferences, theme |\n\n**Architecture:**\n\n```\n┌───────────────────────────────────┐\n│       Electron UI (React)          │\n│  Dashboard · Repos · Conflicts     │\n│  History · Settings · Detail       │\n└───────────────┬───────────────────┘\n                │ IPC (contextBridge)\n┌───────────────▼───────────────────┐\n│     EngineClient (TypeScript)      │\n│  Spawns Go binary, parses JSON     │\n└───────────────┬───────────────────┘\n                │ --json flag\n┌───────────────▼───────────────────┐\n│        Go CLI Engine (Cobra)       │\n│  add · sync · resolve · serve      │\n│  agent · config · history          │\n└───────────────────────────────────┘\n```\n\n---\n\n## ⌨️ CLI Reference\n\nAll commands support `--json` for structured output.\n\n```bash\n# Repository management\nforksync add \u003cpath\u003e [--upstream \u003curl\u003e]       # Add repo\nforksync remove \u003cname\u003e                       # Remove from tracking\nforksync scan \u003cdirectory\u003e                    # Batch-discover fork repos\n\n# Sync\nforksync sync [--all | \u003cname\u003e]              # Sync repos\nforksync serve [--interval 15m]             # Background sync service\nforksync status                             # Show all repo statuses\n\n# AI conflict resolution\nforksync resolve \u003cname\u003e [--agent claude] [--no-confirm] [--accept] [--reject]\n\n# Agent management\nforksync agent list                         # Detect installed agents\nforksync agent sessions                     # List active sessions\nforksync agent cleanup                      # Remove expired sessions\n\n# Configuration\nforksync config get                         # Show all config\nforksync config set \u003ckey\u003e \u003cvalue\u003e           # Set config value\nforksync config keys                        # List available keys\n\n# History\nforksync history [--limit 20] [--cleanup [--keep-days 30]]\n```\n\n---\n\n## ⚙️ Configuration\n\n**Location:** `~/.forksync/config.yaml`\n\n```yaml\nsync:\n  default_interval: \"30m\"\n  sync_on_startup: true\n\nagent:\n  preferred: \"claude\"\n  priority: [claude, opencode, droid, codex]\n  timeout: \"10m\"\n  conflict_strategy: \"agent_resolve\"\n  confirm_before_commit: true\n  session_ttl: \"24h\"\n\ngithub:\n  token: \"\"\n\nnotification:\n  enabled: true\n\nproxy:\n  enabled: false\n  url: \"\"\n```\n\n**Data files:**\n\n| Path | Purpose |\n|------|---------|\n| `~/.forksync/config.yaml` | User configuration |\n| `~/.forksync/repos.json` | Managed repository list |\n| `~/.forksync/sessions/\u003cid\u003e.json` | Agent session records |\n| `~/.forksync/db/forksync.db` | SQLite sync history |\n| `~/.forksync/logs/sync-*.log` | Daily-rotated log files |\n\n---\n\n## 🏗️ Project Structure\n\n```\nforksync/\n├── engine/                      # Go CLI engine\n│   ├── cmd/                     # Cobra commands\n│   ├── internal/\n│   │   ├── agent/               # AI agent adapters (Claude, OpenCode, Droid, Codex)\n│   │   │   └── session/         # Session lifecycle management\n│   │   ├── config/              # Viper-based YAML config\n│   │   ├── conflict/            # Merge conflict detection\n│   │   ├── git/                 # Git operations (go-git + CLI fallback)\n│   │   ├── github/              # GitHub REST API client\n│   │   ├── history/             # SQLite sync history store\n│   │   ├── logger/              # File logger with daily rotation\n│   │   ├── notify/              # macOS system notifications\n│   │   ├── repo/                # Repository JSON store (thread-safe)\n│   │   ├── scheduler/           # Background sync scheduler\n│   │   └── sync/                # Core sync pipeline\n│   └── pkg/types/               # Shared types\n│\n├── app/                         # Electron desktop app\n│   ├── src/main/                # Electron main process + EngineClient\n│   ├── src/preload/             # Context bridge (window.api)\n│   └── src/renderer/            # React UI (pages, components, contexts)\n│\n├── build/                       # Build scripts\n└── docs/                        # Documentation\n```\n\n---\n\n## 🧪 Testing\n\n```bash\ncd engine \u0026\u0026 go test ./... -v\n```\n\n**146 tests** across 15 test files — covering sync pipeline, agent adapters, session management, git operations, conflict detection, config, history, and more.\n\n---\n\n## 🛠️ Development\n\nSee [Development Guide](./docs/DEVELOPMENT.md) for setup instructions and architecture details.\n\n## 📝 License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floongxjin%2Fforksync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floongxjin%2Fforksync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floongxjin%2Fforksync/lists"}