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.1.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.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scratch_sync-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8ceb883c78016c07a278b9c514668fb47ca34719070274c0dfe3e9682e2b6218
MD5 5b4f76739ee298d840897777a204383e
BLAKE2b-256 6b1be62b59178a5ab4286f8c93a17edae283e930e0552e56ac29c97c07cafbc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scratch_sync-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: scratch_sync-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 18.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3270152bdc634d2db6f2c312854e643d3883fa1d308668c06b2ef6346a8297ce
MD5 5a96a8fa70c0194da02efaec4eba4aed
BLAKE2b-256 1ca22e2675f224a8d4973e5849aa892b6bf19fef277fe6d9e5284d6bc10af8ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for scratch_sync-0.2.1-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