Skip to content

Repository files navigation

session-sync

Sync ZCode conversations across devices via Cloudflare Workers.

Install the plugin on every machine. Set the same Cloudflare Worker URL in settings. Your sessions automatically stay in sync — no manual export/import needed.

How it works

Machine A (desktop)          Cloudflare Worker          Machine B (laptop)
     │                             │                         │
     ├─ push session ─────────────►│                         │
     │                             │ (stores in KV)          │
     │                             │                         │
     │                             │◄──── pull session ─────┤
     │◄──── push response ────────│                         │
  • Push after every prompt you send and after every AI response
  • Pull when you open a session on another machine

Setup

1. Deploy the Cloudflare Worker

# Install Wrangler if you haven't
npm install -g wrangler

# Clone this repo
git clone https://github.com/Thebored1/session-sync
cd session-sync

# Create KV namespace
wrangler kv:namespace create "SYNC_DATA"

# Copy the output binding ID into wrangler.toml, then:
wrangler deploy

# Optional: set an API key for auth
wrangler secret put API_KEY

Note your Worker URL (e.g. https://zcode-session-sync.your-name.workers.dev).

2. Install the plugin

zcode plugins add https://github.com/Thebored1/session-sync
zcode plugins enable session-sync

3. Configure

In ZCode → Settings → Plugin Management → session-sync, set:

Field Value
Sync URL https://zcode-session-sync.your-name.workers.dev
API Key (same secret you set in the Worker)
Sync on prompt
Sync on response
Fetch on start

Repeat on every machine using the same Sync URL.

Viewing sessions from a phone

Open https://zcode-session-sync.your-name.workers.dev/ in a browser for a session list. Each session's JSON data is available at /pull?session_id=....

Files

.zcode-plugin/plugin.json   — Plugin manifest with user config
hooks/hooks.json            — Hook events (push & pull triggers)
scripts/push.sh             — Push session to Cloudflare Worker
scripts/pull.sh             — Pull session from Cloudflare Worker
worker/index.js             — Cloudflare Worker (KV-backed)
wrangler.toml               — Worker deployment config

License

MIT

About

Sync ZCode conversations across devices via Cloudflare Workers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages