Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Document Sync

Document sync keeps notes and docs synchronized with Postgram entities.

How to run directory sync, how the manifest protocol works, and what to expect on large repositories.

  1. Run sync against a directory:
Terminal window
pgm sync ~/Documents/personal-notes
  1. Optionally set repository name:
Terminal window
pgm sync ~/Documents/cf-notes --repo cf-notes --quiet
  1. Postgram sync protocol:

    • POST /api/sync/diff to compare file hashes,
    • batched POST /api/sync/upload,
    • POST /api/sync/finalize to archive stale documents.
  2. Check repository state:

Terminal window
curl http://127.0.0.1:3100/api/sync/status/personal-notes \
-H "Authorization: Bearer $PGM_API_KEY"
  • The CLI walks .md files recursively and computes SHA-256 hashes locally.
  • Batches are capped to protect large payload size.
  • Use --dry-run for safe validation before upload.