Summary
New users frequently hit silent failures: missing rclone/git binaries, bad credentials, wrong repo URL format, missing SSH keys, uninitialised state. A doctor command that checks prerequisites and reports problems would dramatically reduce setup friction.
Proposed Output
opendotsync doctor
Checking configuration...
✓ Config file found: ~/.config/opendotsync/config.yaml
✓ Paths file found: ~/.config/opendotsync/paths.yaml
✓ State dir exists: ~/.local/share/opendotsync/
Checking backend (github)...
✓ git binary found: /usr/bin/git (version 2.47.1)
✓ Repo URL valid: https://github.com/user/repo.git
✓ Cache dir exists: ~/.local/share/opendotsync/github-cache/...
✓ Remote reachable: github.com (SSH)
✗ Push access: permission denied — check credentials or SSH key
Checking tracked paths...
✓ 2 files matched (703 B projected)
⚠ .zsh_history listed but file not found
Checking encryption...
✓ Encryption disabled
Local version: 4 Remote version: 4 (in sync)
Implementation Notes
- Add
Doctor variant to cli::Command in src/cli.rs
- Add
cmd_doctor() in src/sync.rs
- Each backend should expose a
check_connectivity() -> Result<(), BackendError> method on the StorageBackend trait
- For the github backend: run
git ls-remote <repo> to verify read access, attempt a dummy operation to check write access
- For rclone: run
rclone lsd <remote>:<path> to verify access
Affected Files
src/cli.rs — add Doctor command
src/sync.rs — add cmd_doctor()
src/backend/mod.rs — add check_connectivity() to trait
src/backend/github.rs, rclone.rs, local.rs — implement check_connectivity()
src/main.rs — wire dispatch
Summary
New users frequently hit silent failures: missing
rclone/gitbinaries, bad credentials, wrong repo URL format, missing SSH keys, uninitialised state. Adoctorcommand that checks prerequisites and reports problems would dramatically reduce setup friction.Proposed Output
Implementation Notes
Doctorvariant tocli::Commandinsrc/cli.rscmd_doctor()insrc/sync.rscheck_connectivity() -> Result<(), BackendError>method on theStorageBackendtraitgit ls-remote <repo>to verify read access, attempt a dummy operation to check write accessrclone lsd <remote>:<path>to verify accessAffected Files
src/cli.rs— addDoctorcommandsrc/sync.rs— addcmd_doctor()src/backend/mod.rs— addcheck_connectivity()to traitsrc/backend/github.rs,rclone.rs,local.rs— implementcheck_connectivity()src/main.rs— wire dispatch