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

opencode-bgtask

v1.0.1

Published

OpenCode plugin for running shell commands in the background without blocking the AI session

Readme

opencode-bgtask

在 OpenCode 中后台运行 Shell 命令,不阻塞 AI 会话。支持完整的作业生命周期管理:启动、列表、查看输出、终止。

安装

在线安装(推荐)

opencode.json 中添加:

{
  "plugin": ["opencode-bgtask"]
}

重启 OpenCode 即可。npm 包由 OpenCode 自动安装。

本地安装

index.ts 放到 .opencode/plugins/ 目录下,重启 OpenCode。

工具

bg_start

启动后台命令。

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | command | string | 是 | 要执行的 shell 命令 | | shell | string | 否 | 指定 shell:pwsh, powershell, cmd, bash, sh, zsh。不指定则自动检测 | | cwd | string | 否 | 工作目录,默认为项目根目录 | | timeout | number | 否 | 超时秒数,超时后自动终止作业 |

bg_list

列出所有后台作业及状态(运行中/已完成/失败/已终止/超时)。

bg_output

查看作业输出。

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | id | string | 是 | 作业 ID | | lines | number | 否 | 返回最近 N 行,默认 50,最大 500 |

bg_stop

终止运行中的作业。

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | id | string | 是 | 要终止的作业 ID |

支持 Shell

| Shell | Windows | Linux/macOS | |-------|---------|-------------| | pwsh (PowerShell 7+) | ✅ 默认 | — | | powershell (Windows PowerShell 5.1) | ✅ 备选 | — | | cmd | ✅ 备选 | — | | bash | ✅ (Git Bash) | ✅ 默认 | | sh | — | ✅ 备选 | | zsh | — | ✅ |

限制

  • 最大并发作业数:20
  • 日志文件上限:50MB(超出后截头保尾)
  • 历史记录保留:最近 100 条
  • 输出文件存储于 ~/opencode/bg/,不污染项目目录

许可

MIT