Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

585 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ForkSync

Auto-sync your GitHub fork repos β€” resolve conflicts with AI.

English Β· δΈ­ζ–‡

Go Wails React License

ForkSync Desktop App


Why ForkSync?

Maintaining forked repositories is tedious. Upstream authors keep shipping changes, and every sync risks merge conflicts. You either:

  • Forget to sync β€” your fork falls behind, missing bug fixes and features
  • Resolve conflicts manually β€” reading <<<<<<< markers for hours
  • Give up and re-fork β€” losing your local modifications

ForkSync solves this. It automatically syncs your forks and uses AI coding agents (Claude Code, OpenCode, Codex) to resolve merge conflicts β€” so you never have to touch conflict markers again.

Key Features

Feature Description
Auto Sync Periodically fetches and merges upstream changes (configurable interval)
AI Conflict Resolution Delegates merge conflicts to AI agents with git-aware prompts
Workflow-guided UI Step-by-step workflow: fetch β†’ merge β†’ detect conflicts β†’ agent resolve β†’ review β†’ commit
Live Agent Terminal Real-time streaming view of agent output (stdout, tool calls, errors) during resolution
Desktop App Polished Wails GUI β€” dashboard, workflow steps, settings
HTTP API REST + WebSocket server for programmatic access
Directory Scanner Recursively scans any directory to discover and batch-add fork repos
Sync History SQLite-backed history with filters, AI-generated summaries, and cleanup
System Notifications Desktop native alerts on sync success, conflicts, or errors
IDE Integration Open repos directly in VSCode, Cursor, or Trae
Post-sync Commands Execute custom scripts after a successful sync (e.g. pip install, npm build)
i18n Multi-language interface (Chinese / English)
Multiple Agents Switch between Claude Code and OpenCode freely

Install

Download

Grab the latest release for your platform:

Platform Format Link
macOS .dmg Releases
Windows .exe (NSIS) Releases

Build from Source

git clone https://github.com/loongxjin/forksync.git
cd forksync

# Wails build (single binary, ~18MB)
make wails
# Output: build/bin/

Standalone HTTP Server

The engine can also run as a headless HTTP server for programmatic access:

cd engine && go build -o forksync .
./forksync -addr 127.0.0.1:8080
# Prints FORKSYNC_HTTP_ADDR=127.0.0.1:8080 at startup
# Then all engine ops are available via REST β€” see engine/README.md

Quick Start

1. Configure GitHub Token (Recommended)

mkdir -p ~/.forksync

Edit ~/.forksync/config.yaml:

github:
  token: "ghp_your_token_here"

Token is optional but recommended β€” it enables automatic upstream detection via GitHub API.

2. Launch the App

# Dev mode (hot reload)
make wails-dev

# Or build and run
make wails && open build/bin/forksync.app

The Wails app embeds the Go engine directly β€” no separate server process, no HTTP bridge. All engine operations are native Go function calls.


AI Conflict Resolution

This is the core feature that sets ForkSync apart. When a sync produces merge conflicts, ForkSync can automatically delegate resolution to an AI coding agent:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    conflict     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    resolve    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Upstream   β”‚ ──────────────▢ β”‚  ForkSync     β”‚ ────────────▢│  AI Agent      β”‚
β”‚   Change     β”‚                 β”‚  detects      β”‚              β”‚  (Claude /     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚  conflict     β”‚              β”‚   OpenCode)    β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                                       β”‚ resolved
                                                                       β–Ό
                                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                β”‚  ForkSync     β”‚ ◀───────────│  Verify &      β”‚
                                β”‚  commits      β”‚   commit    β”‚  Stage         β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Supported Agents:

Agent Binary Auto-detected
Claude Code claude βœ…
OpenCode opencode βœ…
Codex codex βœ…

Agents are auto-discovered via PATH. Set a preferred agent in config:

agent:
  preferred: "claude"

Conflict resolution strategies:

Strategy Config key Behavior
Auto-resolve with agent conflict_strategy: agent_resolve Agent resolves conflicts automatically
Manual resolve conflict_strategy: manual Pause at workflow β€” user chooses to resolve with agent or manually
Preserve local resolve_strategy: preserve_ours Agent told to keep local changes, accept upstream non-conflicting
Preserve upstream resolve_strategy: preserve_theirs Agent told to prefer upstream changes
Balanced resolve_strategy: balanced Agent told to smart-merge preserving both sides

Confirmation modes:

Config Behavior
confirm_before_commit: true After agent resolves, wait for user review and accept/reject
confirm_before_commit: false Auto-commit immediately after agent resolves
**Post-sync Commands:** Configured per-repo in the settings dialog of the desktop app (add/edit/delete shell commands to run after each successful sync).

Desktop App

Built with Wails v2 + React + TypeScript + Tailwind CSS + shadcn/ui.

Section Description
Dashboard Overview: repo statuses, recent sync activity
Repo List Expandable repo cards with workflow steps or detail panel
Workflow Steps Step-by-step progress: fetch β†’ merge β†’ check conflicts β†’ resolve strategy β†’ agent resolve β†’ accept β†’ commit
Agent Terminal Real-time streaming view of agent output during resolution
AI Summary After resolution, agent's git-history-aware summary in workflow
Diff Viewer Side-by-side diff preview when reviewing changes
History Sync timeline with filters, AI-generated summaries, and cleanup
Settings General, agent config, post-sync commands, IDE preferences

Architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Wails UI (React)                 β”‚
β”‚  Dashboard Β· Repos Β· Workflow               β”‚
β”‚  Agent Terminal Β· History Β· Settings        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚ Wails binding (direct Go call)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Go Engine (same process, no IPC)        β”‚
β”‚  App struct with 34 bound methods            β”‚
β”‚  Internal: sync Β· resolve Β· agent            β”‚
β”‚            history Β· scheduler Β· eventbus    β”‚
β”‚            ide Β· config Β· summarize          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

In the Wails desktop app, the engine runs in-process β€” all 34 methods are Go struct methods bound to the frontend via Wails auto-generated TypeScript bindings, with no HTTP/IPC between them. Streaming uses Wails Events instead of WebSocket.

The same engine can also run as a standalone HTTP server for headless or programmatic access (cd engine && go build). See Standalone HTTP Server above.


Engine API

All engine operations are available as Wails bindings (direct Go calls from the React frontend). A standalone HTTP server is also available for headless use. See engine/README.md for the HTTP API reference.

Operation HTTP Route
Status GET /status
Scan POST /scan
Add repo POST /repos
Remove repo DELETE /repos/{name}
Sync all POST /sync/all
Sync one POST /sync/repos/{name}
Resolve POST /repos/{name}/resolve
Resolve stream WS /stream/resolve/{name}
Agents GET /agents
History GET /history?repo=&limit=
Config GET /config / PUT /config
Post-sync GET/POST/DELETE /repos/{name}/post-sync
Summarize POST /repos/{name}/summarize

About

πŸ”„ Auto-sync GitHub fork repos with upstream. Resolve merge conflicts using AI agents (Claude Code, OpenCode, Codex). Desktop app.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages