A lightweight, cross-platform tool that automatically syncs one or more Git repositories on every local file change. Written in Go as a single static binary with an embedded dark-monochrome Web UI dashboard, native OS file pickers, and zero external runtime dependencies.
Designed for note-taking vaults (Obsidian, Logseq, Foam, plain Markdown), office documents (.docx, .xlsx), and personal config folders where you want continuous, hands-off backup to remote Git repositories without having to touch the command line.
edit file → detected → gitignore & lock-file check → debounce → add (exclude secrets) → scan staged → commit → pull --rebase (retry) → push (retry) → live streamed & notified
- Features
- Web UI Dashboard
- Requirements
- Quick start
- Installation
- Usage & Flags
- How it works
- Watching multiple folders
- Office & Binary file support
- Handling conflicts
- Running as a background service
- Reducing binary size
- Development & Tests
- Project structure
- License
| Feature | Description |
|---|---|
| Embedded Web Dashboard | Single-page modern dark-monochrome web UI (http://localhost:8989) served directly from the binary via Go embed. Zero npm/NodeJS dependencies. |
| Password Authentication | Session-based login with HMAC tokens in HTTP-only cookies and in-dashboard password management. |
| Cross-Platform Browsing | Add folders via native OS pickers (PowerShell on Windows, AppleScript on macOS, Zenity/KDialog on Linux) or the built-in Web Directory Explorer. |
| Dynamic Repository Management | Add and remove watched Git repositories on the fly from the UI without restarting the binary. |
| Live SSE Terminal | Real-time log streaming using Server-Sent Events (SSE) directly in the web dashboard. |
| Multi-folder watching | Watch any number of independent Git repositories in a single process. |
| Recursive watching | Automatically discovers and watches all subdirectories on startup and registers newly created ones at runtime. |
| Debounce per repo | Rapid successive edits collapse into a single commit once the cooldown window passes (-debounce, default 2s). |
| Descriptive commit messages | Generates human-readable commit messages from the staged diff (e.g. Update notes.md (+12/-3); Add todo.md (+5) — 2026-08-31 10:15:00). |
| Binary file friendly | Handles binary files like .docx, .xlsx, .pdf, and images cleanly with descriptive (binary) commit summaries. |
| Office lock-file filtering | Automatically ignores temporary lock files created by Word and Excel (~$*.docx, ~$*.xlsx) to prevent sync noise. |
| Gitignore aware | Uses git check-ignore so repository-level and global ignore rules are respected without reimplementing them. |
| Secret protection | Appends :(exclude) pathspecs for sensitive patterns (.env*, *.pem, *.key, credentials) on git add, plus secondary staged content scanning. |
| Push/Pull retry | Automatically retries transient network failures on git pull --rebase and git push with exponential backoff (1s, 2s, 4s). |
| Safe rebase on conflict | If git pull --rebase runs into a merge conflict, it automatically runs git rebase --abort to keep the local repo clean, preserving your commit. |
| Desktop notifications | Cross-platform notifications on success, conflicts, and errors via native system notifications. |
By default, launching funk-auto-sync starts the embedded HTTP server and automatically opens your browser at:
http://localhost:8989
- Default credentials: Password is
admin. A prominent banner will prompt you to change it on first login. - Controls:
- Live / Paused Toggle: Pause watcher during heavy editing sessions or resume with one click.
- Sync All / Sync Now: Manually trigger immediate sync for one or all repositories.
- Add Repository: Select folders using the native OS file picker (
Browse...) or use the built-in directory explorer (Explorer). - Live Terminal: Monospace streaming terminal showing real-time Git actions and status.
- Settings Modal: Update your dashboard password and adjust sync debounce seconds.
- Go 1.21 or newer (to build from source)
- Git installed and available on your
PATH - A configured Git repository with an
originremote for every folder you want to watch
# Clone the repository
git clone https://github.com/funk71on/funk-auto-sync.git
cd funk-auto-sync
# Build the binary
go build -o funk-auto-sync .
# Run (opens web dashboard automatically)
./funk-auto-syncOn Windows, simply double-click funk-auto-sync.exe in File Explorer.
git clone https://github.com/funk71on/funk-auto-sync.git
cd funk-auto-sync
go build -o funk-auto-sync .The compiled binary will be placed at ./funk-auto-sync (or funk-auto-sync.exe on Windows).
To install it directly into your $GOPATH/bin:
go install .# Start with Web UI (default, auto-opens browser)
./funk-auto-sync
# Specify custom web port
./funk-auto-sync -port 9090
# Start without opening browser window automatically
./funk-auto-sync -no-browser
# Headless pure CLI mode (no web server)
./funk-auto-sync -cli -path /path/to/notes
# Watch multiple directories directly via CLI
./funk-auto-sync -path /path/to/notes -path /path/to/journal
# Adjust debounce window (supports ms, s, m)
./funk-auto-sync -debounce 5s
# Check version
./funk-auto-sync -version
# Show help
./funk-auto-sync -help| Flag | Type | Default | Description |
|---|---|---|---|
-port |
int | 8989 |
Port for the Web UI dashboard (overrides saved config). |
-cli |
bool | false |
Run in headless CLI mode without starting the Web UI server. |
-no-browser |
bool | false |
Do not automatically launch the web browser on startup. |
-path |
string | . |
Initial path(s) to watch. Repeatable (-path a -path b) or comma-separated (-path a,b). |
-debounce |
duration | 2s |
How long to wait for changes to settle before syncing. |
-version |
bool | false |
Print the version number and exit. |
When funk-auto-sync starts:
- Config initialization: Loads or creates
funk-sync.jsoncontaining saved watch paths, debounce delay, and hashed credentials. - Pre-flight validation: Checks that
gitis on yourPATHand verifies each watched path is an existing Git repository with anoriginremote. - Recursive watcher: Recursively registers all subdirectories with
fsnotify. Any new folders created later are picked up automatically. - Event filtering: Temporary editor swap files (
*~,.*), office lock files (~$*), and files matched by.gitignoreare immediately skipped. - Per-repo debounce: Waits for the debounce duration without new changes in that repository before triggering the pipeline.
- Git Add with secret exclude: Runs
git add .with:(exclude)pathspecs for sensitive files (.env,*.key,*.pem, etc.). - Staged content scan: Inspects staged files for credentials/private keys. If found, resets staging and aborts for safety.
- Descriptive commit: Generates a commit message summarizing changed files and line additions/deletions (e.g.
Update notes.md (+12/-3); Add report.docx (binary) — 2026-08-31 10:15:00). - Pull with rebase & retry: Executes
git pull origin <branch> --rebasewith exponential backoff retries. - Push with retry: Executes
git push origin <branch>with exponential backoff retries. - Live broadcast & notification: Streams output to all connected dashboard SSE clients and fires native desktop alerts.
funk-auto-sync works seamlessly with binary documents (such as .docx, .xlsx, .pptx, .pdf, and images):
- Lock-file exclusion: Word and Excel create temporary lock files (e.g.
~$Annual_Report.docx) during editing. These files are filtered out automatically to avoid commit noise and race conditions. - Commit formatting: Since binary files do not have line diffs, they are formatted as
Update Annual_Report.docx (binary)instead of misleading(+0/-0). - Debounce tip for large files: Saving large Office documents involves writing temporary files before renaming. If commits trigger prematurely during large saves, increase the debounce delay via UI settings or CLI flag:
./funk-auto-sync -debounce 5s
A single process can watch several independent Git repositories at once — each keeps its own branch, remote, and commit history. You can manage them directly inside the Web Dashboard or supply them via CLI:
./funk-auto-sync -path ~/notes -path ~/journal -path ~/dotfilesAutomated background sync tools must never perform blind conflict resolution (such as --strategy-option=ours or theirs). Forcing an auto-merge risks silent data loss, particularly with binary documents (.docx, .xlsx) and structured notes where three-way text merges can silently clobber content without the user realizing it.
When git pull --rebase encounters conflicts against remote changes:
- Immediate abort: Automatically executes
git rebase --abortto return the working tree cleanly to your local commit without leaving unresolved<<<<<<<conflict markers. - Notification & Log: Dispatches a desktop alert (
Git CONFLICT!) and logs details of the conflicting branch and file. - Preservation: Your local work remains safely committed in your local repository history so no keystrokes are lost.
Linux (systemd user service)
Create ~/.config/systemd/user/funk-auto-sync.service:
[Unit]
Description=Funk Auto Sync
[Service]
ExecStart=/absolute/path/to/funk-auto-sync -no-browser
Restart=on-failure
[Install]
WantedBy=default.targetEnable and start:
systemctl --user enable --now funk-auto-sync.servicemacOS (launchd)
Create ~/Library/LaunchAgents/com.funk.funk-auto-sync.plist pointing to the compiled binary with -no-browser, then load it:
launchctl load ~/Library/LaunchAgents/com.funk.funk-auto-sync.plistWindows (Startup / Task Scheduler)
Create a shortcut to funk-auto-sync.exe in your shell:startup folder or use Task Scheduler to launch at logon.
Build a stripped, fully static binary without CGO:
# Linux / macOS
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o funk-auto-sync .
# Windows (PowerShell)
$env:CGO_ENABLED=0; go build -trimpath -ldflags="-s -w" -o funk-auto-sync.exe .Run the complete unit test suite:
go test ./... -v.
├── main.go # Entry point, flag parsing, and startup orchestration
├── server.go # Embedded HTTP server, routes, and OS folder dialog
├── manager.go # Dynamic sync engine, log ring-buffer, and SSE stream
├── config.go # JSON configuration persistence and password hashing
├── auth.go # Authentication, HMAC sessions, and password change
├── web/ # Embedded web frontend assets (HTML, CSS, JS)
│ └── index.html # Dark monochrome single-page dashboard
├── auth_test.go # Authentication and session unit tests
├── config_test.go # Configuration manager unit tests
├── main_test.go # Git sync pipeline and watcher unit tests
├── go.mod # Go module definition
├── .gitignore # Git ignore rules (ignores funk-sync.json, logs, binaries)
└── README.md # Documentation
MIT — feel free to use, modify, and distribute.