Skip to content

feat: git-backed sync — conversations, prompts, and settings versioned in a local git repo #34

@andrewchumchal

Description

@andrewchumchal

Summary

Use a local git repository as a sync and backup backend for conversations, system prompts, personas, and settings. No cloud infrastructure required — users point the app at a private GitHub/GitLab/Gitea repo and the app handles push/pull automatically.

Motivation

Multi-device use today requires a full cloud backend. Git-backed sync gives users backup, version history, and cross-device sync using infrastructure they already own and trust, with zero server costs.

Proposed behaviour

Settings

A new Sync section in Settings:

  • Repo path — local path to a git repo (initialised by the app if it doesn't exist)
  • Remote URL — optional upstream (e.g. git@github.com:user/openconduit-data.git)
  • Auto-sync toggle — push after every conversation update (default: on)
  • Sync now button — manual pull + push

Data layout inside the repo

conversations/
  <id>.json          # one file per conversation (messages, metadata)
prompts/
  <id>.json          # saved system prompts
personas/
  <id>.json          # persona definitions
settings.json        # non-sensitive settings snapshot (no API keys)

Sync behaviour

  • On launch: git pull to get latest data, merge into stores
  • After save: git add -A && git commit -m "sync: <timestamp>" && git push (debounced, non-blocking)
  • Conflict strategy: last-write-wins per file (timestamp in filename/metadata); surface conflicts as a notification (feat: notification system #33)
  • API keys are never written to the repo — only non-sensitive settings

Main process (ipc.ts / new sync.ts)

  • isomorphic-git (pure JS, no git binary required) for all git operations
  • IPC channels: sync:pull, sync:push, sync:status
  • preload.ts exposes window.api.sync.*

Renderer

  • Sync status indicator in StatusBar (e.g. ↑ synced / ⟳ syncing… / ⚠ conflict)
  • Settings panel Sync tab

Acceptance criteria

  • User can configure a local repo path and optional remote URL in Settings
  • App pulls on launch and pushes after each conversation save
  • Conversations, prompts, and personas round-trip correctly through JSON files
  • API keys and sensitive fields are excluded from the repo
  • Sync status shown in StatusBar
  • Conflicts surfaced as notifications (see feat: notification system #33)
  • Works without a remote (local-only history / undo)

Notes

  • isomorphic-git runs in Node (main process) — no native git binary dependency
  • SSH key auth can be handled via ssh-agent passthrough or token-based HTTPS
  • This is a self-hostable alternative to a cloud backend; cloud sync (#TBD) can build on top of the same file layout

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions