Skip to main content

Sync private scratch/ folders across machines using Syncthing over Tailscale

Project description

scratch-sync

Sync private scratch/ folders across multiple machines using Syncthing over Tailscale.

The Problem

Working across multiple machines (Linux workstation, Mac laptop, Windows desktop) with code repositories in different locations:

Machine Example Repo Paths
Linux ~/code/sleap-io, ~/repo1
Mac ~/sleap-io, ~/code/my-repo
Windows D:\sleap-io, C:\Users\me\code\repo1

Each repo has a scratch/ subfolder that's .gitignored — notes, experiments, temp files, WIP that shouldn't be in version control but should sync privately across machines.

Solution

  • Sync scratch/ folders without git
  • Single CLI command to add folders to sync
  • Works across Linux, macOS, and Windows
  • Uses Tailscale for secure direct connections (no cloud relay)
  • Minimal ongoing maintenance

Quick Start

Prerequisites

  • Tailscale installed and connected on all machines
  • All machines on the same Tailnet

Install

macOS / Linux:

curl -LsSf https://scratch.tlab.sh/install.sh | sh

Windows (PowerShell):

iwr -useb https://scratch.tlab.sh/install.ps1 | iex

The installer will download Syncthing, set up auto-start, and show you the status of all dependencies:

Dependencies

  uv           installed 0.9.18     ~/.local/bin/uv
  tailscale    running   1.92.3     your-tailnet.org / you@example.com
  syncthing    running   v2.0.12    ~/.local/bin/syncthing / autostart: launchd

After installation, remember to set up a password for the Syncthing dashboard at http://127.0.0.1:8384/.

Uninstall (macOS / Linux):

curl -LsSf https://scratch.tlab.sh/install.sh | sh -s -- --uninstall

Uninstall (Windows):

$env:UNINSTALL=1; iwr -useb https://scratch.tlab.sh/install.ps1 | iex

Check dependency status:

curl -LsSf https://scratch.tlab.sh/install.sh | sh -s -- --status

Install the CLI

The scratch-sync CLI helps you manage synced folders. Choose your preferred installation method:

Permanent install (recommended):

uv tool install scratch-sync

This installs scratch-sync globally so you can run it from anywhere.

Run without installing:

uvx scratch-sync --help

If you prefer not to install permanently, use uvx to run the latest version on-demand.

Update to latest version:

uv tool upgrade scratch-sync

Uninstall:

uv tool uninstall scratch-sync

Usage

# Inside a git repo with a scratch/ folder
scratch-sync init

# Add a specific scratch folder
scratch-sync add ~/code/myrepo/scratch

How It Works

Syncthing folder IDs just need to match across devices. The actual filesystem paths can be different:

  • scratch-sleap-io on Linux at ~/code/sleap-io/scratch
  • Same folder ID on Windows at D:\sleap-io\scratch
┌─────────────────┐     Tailscale      ┌─────────────────┐
│  Linux Box      │◄──────────────────►│  Mac Laptop     │
│ ~/code/sleap-io │                    │ ~/sleap-io      │
│   └── scratch/  │   folder-id:       │   └── scratch/  │
│                 │  "scratch-sleap-io"│                 │
└────────┬────────┘                    └────────┬────────┘
         │            Tailscale                 │
         └──────────────┬───────────────────────┘
                        ▼
              ┌─────────────────┐
              │  Windows PC     │
              │ D:\sleap-io     │
              │   └── scratch/  │
              └─────────────────┘

Documentation

Full documentation at scratch.tlab.sh.

Development

Setup

Clone the repository and install dependencies:

git clone https://github.com/talmolab/scratch-sync.git
cd scratch-sync
uv sync

This creates a virtual environment and installs all dependencies.

Running in development

Run the CLI directly from source:

uv run scratch-sync --help

Install from GitHub

Install the latest development version from the main branch:

uv tool install git+https://github.com/talmolab/scratch-sync.git

Or run without installing:

uvx --from git+https://github.com/talmolab/scratch-sync.git scratch-sync --help

Local editable install

For development, install as an editable tool from your local checkout:

uv tool install --editable .

This installs scratch-sync globally but uses your local source files, so changes take effect immediately.

To uninstall and reinstall after making changes to entry points:

uv tool uninstall scratch-sync
uv tool install --editable .

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scratch_sync-0.2.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scratch_sync-0.2.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file scratch_sync-0.2.0.tar.gz.

File metadata

  • Download URL: scratch_sync-0.2.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scratch_sync-0.2.0.tar.gz
Algorithm Hash digest
SHA256 75821776d11526a1e16f5f3626e01e3e7330bfe2c4a617454883c54752544327
MD5 58d1fc477a6cf1448cb62945cf3bbe35
BLAKE2b-256 a30cb36b804c6f7db18ed6b74ed8633b677ca189422b0e5028f070720723af38

See more details on using hashes here.

Provenance

The following attestation bundles were made for scratch_sync-0.2.0.tar.gz:

Publisher: publish.yml on talmolab/scratch-sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scratch_sync-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: scratch_sync-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scratch_sync-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dfc3cb4b6aa1c0e75f8ebe22a8aff4c4c3d19cfbefe4a634162799469b621ee5
MD5 0f52a79b7278277cb767ddf0c439b4c5
BLAKE2b-256 a2df50e68581c2477ca16dda369ffafd8357325ec8795607a990aedc069f8a90

See more details on using hashes here.

Provenance

The following attestation bundles were made for scratch_sync-0.2.0-py3-none-any.whl:

Publisher: publish.yml on talmolab/scratch-sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page