opencode-plugin-auto-updateOpenCode plugin that auto-updates plugins in the background
6
299
近 7 天 56
31.5
生态多维模型
6 个月前
2026-02-04
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-auto-update@0.3.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-auto-update@0.3.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-plugin-auto-updateopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Keep your OpenCode environment fresh without lifting a finger.
opencode-plugin-auto-update is a lightweight, background-running plugin that
ensures your OpenCode plugins are always up-to-date. Zero-latency background
updates for your OpenCode plugins. Includes 24h throttling and concurrency
locking. It handles the heavy lifting of dependency management in the
background, so you can focus on building.
🚀 Why use this?
- Set and Forget: Once installed, your plugins stay updated automatically.
- Zero Latency: Updates run in a detached background process—no startup delay for your OpenCode session.
- Smart Throttling: Only checks for updates once every 24 hours (configurable) to save bandwidth and resources.
- Safe & Reliable: Uses lock files to prevent concurrent update runs and handles config migrations automatically.
✨ Key Features
- Background Execution: Updates are detached from the main process. No prompts, no blocking IO, and minimal noise.
- Bun-First Performance: Automatically detects and uses
bunfor lightning-fast installs, with a reliablenpmfallback. - Intelligent Filtering: Automatically skips local paths, git repositories, and workspace plugins to avoid breaking development setups.
- Update History: Maintains a circular history of the last 5 updates, including metadata and timestamps.
- Config Migration: Seamlessly handles transitions between
pluginandpluginskeys in youropencode.json. - Toast Notifications: Provides a brief, non-intrusive summary after a successful update pass.
📦 Installation
🤖 For LLM Agents (Recommended)
If you are using an AI agent (OpenCode, Claude Code, Cursor, etc.), simply paste this:
Install the opencode-plugin-auto-update plugin by following: https://raw.githubusercontent.com/AnganSamadder/opencode-plugin-auto-update/main/README.md
Detailed Agent Instructions
Install the NPM package globally:
bun add -g opencode-plugin-auto-update || npm install -g opencode-plugin-auto-updateEnable in OpenCode Config: Add
"opencode-plugin-auto-update"to thepluginarray in~/.config/opencode/opencode.json.{ "plugin": [ "opencode-plugin-auto-update" ] }Verify: Inform the user: "Installation complete! Your OpenCode plugins will now update automatically in the background."
👤 Manual Installation
Install the package:
bun add -g opencode-plugin-auto-update # or npm install -g opencode-plugin-auto-updateEnable the plugin: Add
"opencode-plugin-auto-update"to your~/.config/opencode/opencode.json:{ "plugin": [ "opencode-plugin-auto-update" ] }Restart OpenCode: The plugin will trigger its first check on the next startup.
⚙️ Configuration
You can fine-tune the behavior using environment variables:
| Variable | Default | Description |
|---|---|---|
OPENCODE_AUTO_UPDATE_DISABLED |
false |
Set to true to completely disable background updates. |
OPENCODE_AUTO_UPDATE_INTERVAL_HOURS |
24 |
How often to check for updates (in hours). |
OPENCODE_AUTO_UPDATE_PINNED |
false |
If true, preserves pinned versions in your config. |
OPENCODE_AUTO_UPDATE_BYPASS_THROTTLE |
false |
Force an update check on every startup (useful for debugging). |
Local Override
For persistent overrides without environment variables, create:
~/.config/opencode/opencode-plugin-auto-update.json
{
"ignoreThrottle": true
}
🛠️ How It Works
- Trigger: On OpenCode startup, the plugin schedules a background task.
- Lock & Throttle: It checks if an update is already running or if the 24h interval has passed.
- Fetch: It identifies registry-based plugins and fetches their latest versions.
- Install: Updates are installed into
~/.config/opencode/node_modules. - Sync: Updates
opencode.jsonwith the new versions (unless pinning is enabled).
❓ Troubleshooting
- Updates not running? Check if
OPENCODE_AUTO_UPDATE_DISABLEDis set. - No logs? The plugin is designed to be quiet. Check the "Auto-update logs" output in your agent's console for details.
- Testing? Use
OPENCODE_AUTO_UPDATE_BYPASS_THROTTLE=trueto force a run.
📄 License
MIT © Angan Samadder
Inspired by the OpenCode plugin ecosystem.