npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ihwbox/opencode-config-sync

v0.1.0

Published

OpenCode configuration sync plugin for multi-device config roaming via WebDAV

Downloads

169

Readme

@ihwbox/opencode-config-sync


功能特性

| 特性 | 说明 | |------|------| | 🔄 自动同步 | 启动时拉取,退出时推送 | | 📁 整个目录同步 | 自动同步所有配置文件 | | 🔐 独立配置 | 配置独立于 opencode.json | | ⚡ 增量同步 | 只传输变更文件 | | 🛡️ 冲突处理 | 时间戳优先策略 | | 📊 速率限制 | 保护 API 配额 | | 🔧 手动命令 | 支持手动推送/拉取 |


安装

NPM

npm install @ihwbox/opencode-config-sync

Git

git clone [email protected]:AI_Tools/OpenCode_Sync.git
cd OpenCode_Sync
npm install && npm run build

Quick Start

1. 创建配置文件

创建 ~/.config/opencode/config-sync.json

{
  "server": "https://your-webdav-server.com/dav/",
  "remotePath": "/opencode-config",
  "timeout": 30000,
  "username": "your-username",
  "password": "your-app-password"
}

| 参数 | 必填 | 说明 | 默认值 | |------|:----:|------|--------| | server | ✅ | WebDAV 服务器地址 | - | | remotePath | ❌ | 远程存储路径 | /opencode-config | | timeout | ❌ | 请求超时 (ms) | 30000 | | username | ✅ | WebDAV 用户名 | - | | password | ✅ | WebDAV 密码(应用密码) | - |

⚠️ 安全警告

  • config-sync.json 包含敏感认证信息,切勿提交到 Git
  • 已自动添加到 .gitignore,但请确保不要手动提交
  • 建议使用应用密码而非主密码(如坚果云需在安全选项中生成)
  • 配置文件权限应设置为仅当前用户可读

2. 启用插件并重启

{
  "plugin": ["@ihwbox/opencode-config-sync"]
}

重启 opencode,配置自动同步!


同步范围

同步

| 路径 | 说明 | |------|------| | ~/.config/opencode/*.json | 配置文件 | | ~/.config/opencode/skill/ | 技能目录 | | ~/.config/opencode/plugin/ | 插件目录 |

排除

  • node_modules/ - 依赖目录
  • *.lock - 锁文件
  • *.db* - 数据库文件
  • .git/ - Git 目录
  • log/ - 日志目录
  • snapshot/ - 快照目录

手动同步

| 命令 | 说明 | |------|------| | /sync | 查看同步状态 | | /sync push | 推送到云端 | | /sync pull | 从云端拉取 | | /sync 推送 | 中文别名 | | /sync 拉取 | 中文别名 |


支持的 WebDAV

| 服务 | 地址 | 说明 | |------|------|------| | 坚果云 | https://dav.jianguoyun.com/dav/ | 免费 1GB | | Nextcloud | 自定义 | 开源 | | 其他 | - | 标准 WebDAV |

坚果云提示:需在「账户信息 → 安全选项」生成应用密码。


故障排除

同步失败 / 连接超时

→ 检查服务器地址、网络、防火墙

认证失败

→ 确认用户名密码,使用应用密码

文件冲突

→ 时间戳优先:本地更新时跳过拉取

重置同步状态

rm ~/.config/opencode/sync-state.json

开发

npm install
npm run build
npm test

贡献

欢迎 Issue 和 PR!


许可证

MIT © hujunpeng

仓库: [email protected]:AI_Tools/OpenCode_Sync.git