@bao-x/opencode-webdav-sync
v0.2.0
Published
Sync opencode config, skills, agents, commands, and history across devices via WebDAV.
Maintainers
Readme
@bao-x/opencode-webdav-sync
Sync your opencode config, skills, agents, commands, plugins, and history across devices via WebDAV.
Status: v0.2.0 — all three categories (A/B/C) implemented and tested.
init/status/push/pull/diffall shipped.
Why
opencode stores everything on the local disk — custom skills, agents, command templates, the conversation SQLite DB. Moving between machines (laptop ↔ desktop, macOS ↔ Windows ↔ Linux) means redoing that setup, or losing history. This tool mirrors the relevant directories to any WebDAV server, so a new machine is one pull away from feeling like home.
Install
npm install -g @bao-x/opencode-webdav-syncThen, once:
ocsync init # interactive: asks for WebDAV URL, credentials, presetUsage
ocsync status # show local manifest + last sync time
ocsync push # upload local → webdav (all categories)
ocsync push --only A # upload only config dirs (skills/agents/...)
ocsync pull # download webdav → local (overwrites, with backup)
ocsync pull --only B --dry-run # preview what would change for opencode.json
ocsync diff # compare local vs remote manifestsCategories:
| Flag | What it syncs |
|------|---------------|
| A | skills/, agent(s)/, command(s)/, plugin(s)/ (your customizations) |
| B | opencode.json (with secrets redacted — see below) |
| C | History: opencode.db, storage/, prompt-history.jsonl, frecency.jsonl |
Security
opencode.jsonis synced with secrets stripped (mcp.*.headers.Authorization,*.environment.*,provider.*.options.apiKey). Placeholders mark redacted fields;pullkeeps your local real values for those.auth.jsonand API tokens are never synced.- Credentials for the WebDAV server itself live in
~/.config/opencode-webdav-sync/config.json(chmod 600). Keychain integration is a roadmap item.
Cross-platform paths
opencode follows XDG conventions on all platforms. This tool resolves the same paths:
| Platform | Config | Data | State |
|----------|--------|------|-------|
| Linux | ~/.config/opencode | ~/.local/share/opencode | ~/.local/state/opencode |
| macOS | ~/.config/opencode | ~/.local/share/opencode | ~/.local/state/opencode |
| Windows | C:\Users\<User>\.config\opencode | C:\Users\<User>\.local\share\opencode | C:\Users\<User>\.local\state\opencode |
opencode uses xdg-basedir on every platform (no process.platform branching), so it stores under Unix-style dot-prefixed dirs even on Windows. This tool mirrors that resolution exactly — verified against opencode's packages/core/src/global.ts source.
License
MIT
