CtxRelay is a small CLI tool for cross-AI collaboration.
It treats markdown chat archives as the core unit, then packages them into continuation prompts for different AI tools.
Different AI products have inconsistent export behavior. Even when you can export markdown, moving context across tools and devices is still annoying. CtxRelay helps you store, package, and sync those archives.
ctxrelay ingest: save a chat archive markdownctxrelay list: list recent archivesctxrelay show: preview latest archivectxrelay export: generate continuation prompt from archivectxrelay relay: one-shot clipboard relay (ingest + export + copy)ctxrelay watch: monitor plugin export folder and auto-relay new filesctxrelay checkpoint-show: show incremental relay checkpoint for a routectxrelay checkpoint-reset: reset incremental relay checkpoint for a routectxrelay project-show: show stable latest files for one projectctxrelay sync-status: check local archive + Git sync statusctxrelay state-init: initialize shared memory boardctxrelay state-show: view current shared statectxrelay state-prompt: generate AI prompt for state updatectxrelay state-update: apply JSON update from AIctxrelay state-history: list state snapshots
python -m venv .venv
source .venv/bin/activate
pip install -e .# Ingest from a file
ctxrelay ingest --input chat.md --project my-server-migration --source gemini
# Or ingest from stdin
pbpaste | ctxrelay ingest --project my-server-migration --source chatgpt
# List and preview
ctxrelay list
ctxrelay show
# Export prompt for next AI
ctxrelay export --target chatgpt --project my-server-migration
# One-shot relay from clipboard (recommended for web/app chat)
ctxrelay relay --from chatgpt --to gemini --project my-server-migration
# Then directly paste in Gemini; relay text is already in clipboard.
# Incremental auto relay (only new part after last checkpoint)
ctxrelay relay --from chatgpt --to gemini --project my-server-migration --auto
ctxrelay checkpoint-show --from chatgpt --to gemini --project my-server-migration
ctxrelay project-show --project my-server-migration
# Auto-monitor export folder (plugin-friendly workflow)
ctxrelay watch --dir ~/Downloads --pattern "*.md" --from chatgpt --to gemini --project my-server-migration
# Dry-run once:
ctxrelay watch --dir ~/Downloads --pattern "*.md" --from chatgpt --to gemini --project my-server-migration --once
# Note: do not watch `.ctxrelay/` itself (loop protection is enabled).
# Exported prompt contains sync metadata:
# - route (from -> to)
# - transfer mode (full / incremental)
# - previous sync timestamp (if auto mode)
# - fallback reason (when auto-match is weak and system falls back)
# Check sync readiness
ctxrelay sync-status
# Initialize shared state board
ctxrelay state-init --project my-server-migration --goal "finish server migration"
# Generate prompt for GPT/Gemini to update state
ctxrelay state-prompt --target chatgpt --output state_update_prompt.md
# Paste AI JSON response back into state
pbpaste | ctxrelay state-update --editor chatgpt
# Review current board and history
ctxrelay state-show
ctxrelay state-historyCtxRelay stores local data in:
.ctxrelay/conversations/archived markdown logs.ctxrelay/exports/packaged prompt outputs.ctxrelay/latest_conversation.txtlatest pointer.ctxrelay/checkpoints.jsonincremental relay checkpoints.ctxrelay/projects/<project>/latest_conversation.mdstable latest conversation file.ctxrelay/projects/<project>/latest_export_<from>_to_<to>.mdstable latest export file.ctxrelay/state/current.jsonshared memory board.ctxrelay/state/history/board snapshots
Legacy compatibility:
- If
.ctxrelay/does not exist but.mindbridge/exists, CtxRelay auto-migrates data from.mindbridge/into.ctxrelay/on first run.
This MVP is fully local and does not require running any model. For cross-device sync, use a private Git repo (recommended) or your preferred cloud folder.
If you want browser-side one-click export, use the included unpacked Chrome extension:
extensions/chrome-chatgpt-export
Quick setup:
- Open
chrome://extensions - Enable Developer mode
- Load unpacked
extensions/chrome-chatgpt-export - On ChatGPT page, click
Export to .md - Start watcher:
ctxrelay watch --dir ~/Downloads/ctxrelay-exports --pattern "*.md" --from chatgpt --to gemini --project my-project
Edge support:
- This extension also works in Edge (
edge://extensions) because Edge is Chromium-based.