Summary
Add a dwell sync command that auto-commits changes and pushes to the configured git remote. Also add remote repo setup during dwell init so the user can provide a remote URL upfront.
Motivation
Currently dwell init creates a local git repo but does not configure a remote. Users must manually run git remote add and git push after adding dotfiles. There is also no command to auto-commit and push changes — users must shell out to git manually.
Proposed behavior
1. dwell init — remote repo setup
Extend dwell init to accept a --remote flag:
dwell init # local only (current behavior)
dwell init --remote https://github.com/user/dotfiles.git # + set up origin
dwell init --remote git@github.com:user/dotfiles.git # SSH
dwell init --clone https://github.com/user/dotfiles.git # existing (works)
When --remote is provided:
- Create/init the local repo as before
- Set
origin to the provided URL
- Optionally do an initial push
2. dwell sync — commit and push
dwell sync # auto-commit + push
dwell sync -m "Custom commit message" # with message
dwell sync --dry-run # preview what would be committed
The sync command should:
- Stage all changed files in the source directory (
git add -A)
- Commit changes with a descriptive auto-message (or custom via
-m)
- Push to the configured remote
Auto-commit message format: "dwell: sync [N] file(s) — [YYYY-MM-DD HH:MM]" or use the custom message.
3. dwell status — show git sync status
Extend dwell status (or add dwell status --sync) to show:
- Whether the source directory has a remote configured
- Whether there are uncommitted changes
- Whether the local branch is ahead/behind the remote
- Last sync timestamp
Implementation notes
GitRepo in dwell-store already has add(), commit(), status_summary() methods
- Need to add:
remote_url(), has_remote(), push(), is_ahead(), is_behind()
dwell sync should be a no-op if no changes are detected
dwell sync should fail early if no remote is configured
- The
dwell.toml config should store the remote URL for dwell sync to use (as an alternative to git remote)
Acceptance criteria
Summary
Add a
dwell synccommand that auto-commits changes and pushes to the configured git remote. Also add remote repo setup duringdwell initso the user can provide a remote URL upfront.Motivation
Currently
dwell initcreates a local git repo but does not configure a remote. Users must manually rungit remote addandgit pushafter adding dotfiles. There is also no command to auto-commit and push changes — users must shell out to git manually.Proposed behavior
1.
dwell init— remote repo setupExtend
dwell initto accept a--remoteflag:When
--remoteis provided:originto the provided URL2.
dwell sync— commit and pushThe sync command should:
git add -A)-m)Auto-commit message format:
"dwell: sync [N] file(s) — [YYYY-MM-DD HH:MM]"or use the custom message.3.
dwell status— show git sync statusExtend
dwell status(or adddwell status --sync) to show:Implementation notes
GitRepoindwell-storealready hasadd(),commit(),status_summary()methodsremote_url(),has_remote(),push(),is_ahead(),is_behind()dwell syncshould be a no-op if no changes are detecteddwell syncshould fail early if no remote is configureddwell.tomlconfig should store the remote URL fordwell syncto use (as an alternative to git remote)Acceptance criteria
dwell init --remote <url>creates the repo + sets origindwell synccommits all changes with auto-messagedwell sync -m "msg"uses custom messagedwell sync --dry-runshows what would change without committingdwell syncpushes to remote after commitdwell syncexits cleanly with "nothing to sync" if no changesdwell statusshows sync status (remote, uncommitted, ahead/behind)