feat: add autosync daemon with file watching and launchd support#1
Open
nateGeorge wants to merge 1 commit intoGareArc:mainfrom
Open
feat: add autosync daemon with file watching and launchd support#1nateGeorge wants to merge 1 commit intoGareArc:mainfrom
nateGeorge wants to merge 1 commit intoGareArc:mainfrom
Conversation
a1665b2 to
8c7bcd6
Compare
Adds a background autosync daemon that can: - Watch OpenCode config directory for changes (via fsnotify) - Sync periodically on an interval (default 5m) - Debounce rapid changes to avoid excessive syncs - Install/uninstall as a macOS launchd service New commands: - opencode-sync watch # run daemon in foreground - opencode-sync autosync install # install launchd service - opencode-sync autosync uninstall # remove launchd service - opencode-sync autosync status # show service status New config section (autosync): - enabled: bool # default false - pollInterval: string # default 5m - debounceDelay: string # default 3s - watchFiles: bool # default true
8c7bcd6 to
3e4d31d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a background autosync daemon that keeps OpenCode config in sync automatically.
Features
~/.config/opencode/for changes viafsnotify(native kqueue on macOS)autosync install/uninstall/statuscommands manage a macOS launchd serviceNew Commands
New Config Section
{ "autosync": { "enabled": false, "pollInterval": "5m", "debounceDelay": "3s", "watchFiles": true } }Design Notes
sync(pull + push) on triggersfsnotifywhich uses native kqueue on macOS — no polling, no external depswatchcommand can be run manually or via launchdKeepAliveso the daemon restarts if it crashes~/Library/Logs/opencode-sync/autosync.logTesting
go build ./...passesRelated
Inspired by the
oc-syncplugin's auto-sync behavior, but implemented as a native CLI feature so it works without OpenCode running and supports any git host.