Requirements
Product Goal
Keep many local Git repositories safely synchronized with their remote default branch using a background service, with full control through CLI and TUI.
Functional Requirements
- Detect provider type per repository (GitHub/Azure DevOps for v1).
- Authenticate provider operations via PAT tokens.
- Support multiple provider sources at the same time (multiple GitHub and Azure DevOps accounts).
- Support both personal/private and corporate/team/organization account contexts.
- Resolve remote default branch dynamically (
main,master, or other). - Periodically fetch and update local refs in a background daemon.
- Update current branch when behind its upstream branch using fast-forward-only behavior.
- Update default branch when behind remote.
- Skip all mutating operations when repository is dirty.
- Detect stale local branch after it is merged into default branch.
- If stale branch is currently checked out: switch to default branch safely, then delete stale local branch.
- Before any branch deletion, verify no unique local commits would be lost.
- Manage repositories in a clean, navigable workspace layout.
- Provide CLI commands for all daemon actions and all config operations.
- Provide lightweight TUI dashboard for status, actions, logs, and cache controls.
- Support cache visibility and force-refresh actions for relevant data.
- Run on Linux and Windows.
- Support self-update for distributed binaries.
- Provide installer/registration flow that requests required privileges.
- Support explicit
userandsystemservice modes with documented access implications.
Safety Requirements
- Never use destructive sync operations (
reset --hard, force checkout, forced branch delete). - Never auto-stash user changes.
- Never run sync if worktree/index is dirty.
- Never delete local branches with unpublished commits.
- Always log explicit reason when a repo/action is skipped.
- Always use per-repository locking to avoid concurrent mutations.
Operational Requirements
- Logging and traceability are mandatory from phase 1.
- Structured logs must include correlation IDs/job IDs and skip/action reasons.
- Action/event history must be queryable from CLI and visible in TUI.
- Configurable sync interval with jitter and retry backoff.
- Timeouts for provider and git operations.
- Retry budget caps and transient/permanent error classification for network/provider failures.
- Health/status endpoint or local control API for CLI/TUI.
- Dry-run mode for diagnostics.
- Persist non-sensitive configuration and runtime state in config file and/or local database.
- Document permission troubleshooting for install/service operations.
Security Requirements
- Store PAT tokens only in OS-backed secure credential storage when available.
- Provide secure fallback only when OS credential storage is unavailable.
- Never write tokens to logs.
- Redact secrets from command output and telemetry.
- Support token validation and rotation flow.
Non-Goals (v1)
- Auto-merge/rebase workflows.
- Forceful conflict resolution.
- Pull request management.
- Auto-push local commits.