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-web-service

v0.2.6

Published

Set up and manage OpenCode web server as a reliable systemd service

Readme


快速开始

npx opencode-web-service setup

交互式向导将配置端口、主机名、工作目录和密码,然后创建具有开机自启和故障自动重启功能的 systemd 服务。

全局安装

npm i -g opencode-web-service
ocweb setup

命令

| 命令 | 说明 | |------|------| | ocweb setup | 交互式设置向导 | | ocweb start | 启动服务 | | ocweb stop | 停止服务 | | ocweb restart | 重启服务 | | ocweb status | 显示服务状态(状态、PID、运行时间、URL) | | ocweb logs | 显示日志 | | ocweb password | 更改密码 | | ocweb config | 显示当前配置 | | ocweb config set <key> <value> | 修改设置(port、hostname、workdir) | | ocweb upgrade | 升级 OpenCode 并重启服务 | | ocweb upgrade --schedule "<cron>" | 通过 systemd timer 设置自动升级 | | ocweb uninstall | 删除服务和所有配置 |

命令示例

下面是一组覆盖完整使用流程的常用命令:

ocweb setup
ocweb start
ocweb status
ocweb logs
ocweb password
ocweb config
ocweb config set port 5000
ocweb restart
ocweb stop
ocweb upgrade
ocweb upgrade --schedule "0 3 * * *"
ocweb uninstall

安全

  • 必须设置密码 — 安装时强制校验密码复杂度(8+ 字符、数字、特殊字符)
  • 受保护的本地凭据~/.config/ocweb/env600 权限写入,配置元数据中还会保存一个 scrypt 密码哈希
  • 0.0.0.0 保护 — 绑定所有接口时强制启用认证

[!CAUTION] 使用 --hostname 0.0.0.0 时,服务器可从网络访问。请使用 Tailscale 或 ngrok 进行安全的远程访问。


远程访问

Tailscale(推荐)

# 安装:https://tailscale.com
# 访问:http://your-machine.tailnet.ts.net:4096

ngrok

ngrok http 4096

自动升级

# 每天凌晨 3:00
ocweb upgrade --schedule "0 3 * * *"

# 每周日凌晨 2:00
ocweb upgrade --schedule "0 2 * * 0"

要求

  • Linux,systemd 245+(Ubuntu 20.04+、Debian 11+、Fedora 33+、Arch)
  • Node.js 18+
  • OpenCode 已安装并认证(opencode.ai

免责声明

本项目非 OpenCode 团队开发,与 OpenCode 无任何关联。

许可证

MIT