Sync OpenCode settings and session contexts across devices via GitHub Gist
npm install opencodesync
Start coding on your laptop. Continue on your desktop. Never lose context.
Seamlessly sync your OpenCode settings, custom agents, and AI session contexts across all your devices.
---
You're deep in a coding session on your work machine. You've built up context with your AI assistant - it understands your architecture, your decisions, your next steps. Then you need to switch to your home computer.
Without opencodesync: Start from scratch. Re-explain everything. Lose momentum.
With opencodesync: One command. Full context restored. Keep building.
---
``bash`
npm install -g opencodesync
opencodesync init
That's it. The wizard walks you through setup and automatically syncs your settings.
First device? → Creates a new Gist and offers to push your current config
Second device? → Finds your existing Gist and offers to pull everything down
---
| What | Synced |
|------|--------|
| Main config (opencode.json) | ✅ |agent/*.md
| Custom agents () | ✅ |command/*.md
| Custom commands () | ✅ |AGENTS.md
| Global instructions () | ✅ |*.jsonc
| Plugin configs (, oh-my-opencode.json) | ✅ |skills/**
| Skills directory () | ✅ |
| Session contexts | ✅ |
Export your session before switching devices:
``
/context-export "Auth Implementation" --guidance "focus on OAuth decisions"
Resume on any machine:
``
/context-import "Auth Implementation"
Your AI picks up exactly where you left off.
- AES-256-GCM encryption - Your data is encrypted before it leaves your machine
- Private GitHub Gists - Only you can access your sync storage
- Zero plaintext - Even if someone gets your Gist, they can't read it without your passphrase
---
Morning at the office:
`bash`
opencodesync pull # Get latest from home... work on features ...
/context-export "Feature Progress" # Save your context
opencodesync push # Sync to cloud
Evening at home:
`bash`
opencodesync pull # Get settings + context
/context-import "Feature Progress" # Resume with full context... continue seamlessly ...
---
| Command | What it does |
|---------|--------------|
| opencodesync init | Set up GitHub token and encryption passphrase |opencodesync push
| | Upload your settings to the cloud |opencodesync pull
| | Download settings from the cloud |opencodesync status
| | Check what's changed since last sync |
Use --verbose on any command for detailed output.
---
| Command | What it does |
|---------|--------------|
| /context-export [name] | Save current session as a portable context |/context-import [name]
| | Load a saved context into your session |/context-list
| | See all your saved contexts |/context-prune
| | Delete old contexts |
---
Context exports are AI-generated summaries, not raw data. They capture:
- Goals and objectives
- Technical approaches and decisions
- Progress and next steps
They never include:
- Code snippets or implementations
- API keys, tokens, or secrets
- Database strings or internal URLs
- Raw file contents
Your intellectual property stays safe.
---
| Error | Solution |
|-------|----------|
| "Not configured" | Run opencodesync init |gist
| "Decryption failed" | Use the same passphrase as your other devices |
| "Invalid token" | Create a new GitHub token with scope |
Need to start fresh? opencodesync init --force && opencodesync push --force
---
`typescript
import { createPluginTools, addContext, getAllContexts } from "opencodesync";
const tools = createPluginTools();
const context = addContext("My Context", "Summary...");
const all = getAllContexts();
``
---
MIT
---
Stop context-switching. Start syncing.