dbx is a lightweight CLI tool designed for developers who work across GitHub and Dropbox. It bridges the gap by allowing you to synchronize your Git branches directly to Dropbox folders with a single command.
Ideal for scenarios where you need to share code with collaborators who use Dropbox for privacy or convenience, while you maintain your workflow in Git.
- Branch-Specific Syncing: Automatically detects your current Git branch and syncs it to a corresponding
.<branch_name>folder in Dropbox. - Delta Sync (Push): By default, only uploads changes since your last commit to save bandwidth and time.
- Smart Pull: Downloads files from Dropbox only if they are newer than your local copies.
- Full Sync Support: Automatically performs a full upload if a branch folder doesn't yet exist on Dropbox.
- Simple CLI: Clean commands (
dbx push,dbx pull) for a seamless workflow.
-
Clone the repository:
git clone https://github.com/your-username/dbx-sync.git cd dbx-sync -
Install the package:
pip install -e . -
Configure your environment: Create a
.envfile in the root directory:DROPBOX_APP_KEY=your_app_key DROPBOX_APP_SECRET=your_app_secret DROPBOX_REFRESH_TOKEN=your_refresh_token DROPBOX_BASE_DIR=my_project_sync
Sync local changes from the current branch to Dropbox:
dbx pushNote: This defaults to syncing HEAD~1..HEAD. To sync a specific range:
dbx push <start_commit> <end_commit>Download newer files from the corresponding branch folder in Dropbox:
dbx pullTo use this tool, you need a Dropbox Scoped App:
- Create an app in the Dropbox App Console.
- Permissions: Enable
files.content.write,files.content.read,files.metadata.write, andfiles.metadata.read. - Refresh Token: Since access tokens expire, you must generate a long-lived refresh token.
- Use the OAuth2 flow to get an authorization code.
- Exchange the code for a
refresh_tokenusing the/oauth2/tokenendpoint withtoken_access_type=offline.
This project is licensed under the MIT License - see the LICENSE file for details.