Skip to content

christopherkmoore/devsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devsync

Bidirectional dev environment sync over SSH. Built for syncing code between two machines on the same network.

Quick Start

Personal machine (SSH server)

  1. Enable Remote Login: System Settings > General > Sharing > Remote Login
  2. Note your IP: ipconfig getifaddr en0

Work machine (SSH client)

One-command bootstrap:

scp user@<personal-ip>:/path/to/devsync/setup.sh ~/setup.sh
bash ~/setup.sh

This copies devsync, installs it, adds a shell alias, and generates an SSH key.

Set up passwordless auth (one time):

ssh-keygen -t ed25519
ssh-copy-id user@<personal-ip>

Usage

# Check trusted hosts (and fix stale IPs)
devsync scan

# Create a sync profile
devsync init myproject \
  --host user@10.0.0.20 \
  --remote /Users/user/Code/myproject \
  --local ~/Documents/Github/myproject

# Sync files
devsync push myproject       # local -> remote
devsync pull myproject       # remote -> local

# Preview changes without syncing
devsync status myproject

# Manage profiles
devsync list                 # show all profiles
devsync remove myproject     # delete a profile

# Detailed help with examples
devsync help

IP Changed?

DHCP assigns new IPs when you switch networks or routers restart. Just run:

devsync scan

It checks all trusted hosts, flags any unreachable profiles, and prompts you to pick a reachable host to update them to. One command, all profiles fixed.

Or edit the config directly:

vim devsync.json

Configuration

Profiles are stored as JSON. Two locations are supported:

  • Global: ~/.config/devsync/profiles.json
  • Local: ./devsync.json (takes priority when present)

Use --local-config with init to create a local config file you can edit directly:

devsync init myproject --host user@10.0.0.20 --remote /path --local /path --local-config
vim devsync.json  # easy to update IPs, paths, excludes

Default excludes

Every profile starts with these excludes:

.git  node_modules  __pycache__  .venv  venv  .DS_Store  *.pyc  .env  *.md

Add more with --exclude:

devsync init myproject --host user@10.0.0.20 --remote /path --local /path \
  --exclude "*.xcuserstate" --exclude "Pods"

Troubleshooting

  • Sync times out: Run devsync scan to check if the remote host is reachable. IP may have changed.
  • VPN breaks connectivity: Disconnect VPN on the machine initiating the connection. VPN reroutes local traffic.
  • Remote Login on but SSH not working: Toggle Remote Login off and on, or run sudo systemsetup -setremotelogin off && sudo systemsetup -setremotelogin on.
  • Password every time: Set up SSH keys with ssh-keygen -t ed25519 and ssh-copy-id user@host.

Files

devsync/
├── devsync.py      # CLI tool (single file, stdlib only)
├── pyproject.toml  # pip install config
├── start.sh        # runs devsync without manually activating venv
├── setup.sh        # one-command bootstrap for new machines
└── .gitignore

Requirements

  • Python 3.8+
  • rsync (pre-installed on macOS and most Linux)
  • SSH access between machines

About

Bidirectional dev environment sync over SSH — keep code in sync between machines on the same network with one command

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors