Add optional sync between Macs with a shared 8-digit code

Notes and photos were stuck on one machine. A small Go/Postgres backend
stores each group's payload under a code that doubles as the shared
secret, so a second Mac just needs the code — no account or login.

Applying a remote change must not push it straight back, otherwise the
two Macs would bump the version back and forth forever, so payloads are
fingerprinted and identical ones are skipped.

💘 Generated with Crush

Assisted-by: Crush:kimi-k3
This commit is contained in:
2026-10-08 09:56:08 +08:00
parent 4934ad916a
commit 15ad9f355c
11 changed files with 747 additions and 3 deletions
+28
View File
@@ -12,6 +12,8 @@ to your work. Click anything to copy it back to your clipboard.
(or Shift+Cmd+C) for a numbered list ready to paste into a chat.
- **Merge Notes, Mark as Done, Edit, Move To** — right-click any item.
- **Search** — Cmd+F searches across all sections.
- **Sync (optional)** — generate an 8-digit code (`1234-5678`) on one Mac and
enter it on the other; no account, no login. The code is the only secret.
- **Local & private** — everything lives in
`~/Library/Application Support/Prompt/` (`store.json` + `Images/`). No
account, no sync, no telemetry.
@@ -42,6 +44,32 @@ brew trust TZGyn/tap
brew install --cask prompt
```
## Sync server
Sync is optional and needs the small Go backend in `Server/`. There is no
authentication: a sync group is identified by an 8-digit code, and whoever has
the code can read and write the group.
```bash
createdb prompt_sync
cd Server
PROMPT_SYNC_DATABASE_URL="postgres://localhost:5432/prompt_sync?sslmode=disable" \
go run . # listens on :8080
```
Then in the panel: click the sync icon, set the server URL (e.g.
`http://192.168.1.10:8080` or an HTTPS host), and either **Generate Code** on
the first Mac or paste the code into **Join** on the other.
Notes:
- Both Macs must be able to reach the server. A LAN address or a Tailscale
hostname works; `localhost` only works if the server runs on the same Mac.
- Joining a group that already has notes replaces what's on that Mac.
- The app polls every 5 seconds and pushes 1.5s after a change; last write
wins. Changes that came from the server are not echoed back.
- Verify sync from a terminal with `Prompt --sync-check`.
## Build from source
```bash