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

dsh-console

v0.1.0

Published

Console commands for DeepSeek Harness: web service / SSH tunnel management, one-shot ask, and the dsh-tui launcher.

Readme

dsh-console

DeepSeek Harness 的控制台命令插件:网页服务管理、SSH 隧道管理、一次性问答、可选的控制台 TUI 启动——全部在斜杠命令里完成。

快速接入

# 1. 安装 bundle
dsh plugin --profile web add dsh-console

# 2. 重启 dsh web,然后直接用命令
/web status
/tunnel status

开箱即用:/web/tunnel status 零配置可用(插件自动探测运行中的 dsh 入口)。隧道主机和控制台 TUI 路径在 profile 的 cordis.patch.yml 里配置:

- id: dsh-console
  config:
    tunnelHost: '192.168.1.100'        # 你的 SSH 服务器
    tunnelUser: 'root'
    tunnelKey: 'C:\\Users\\you\\.ssh\\id_rsa'
    consoleCommand: 'python C:\\tools\\dsh-tui\\main.py'

再次 dsh plugin --profile web 并重启后,/tunnel start/console 即可用。

命令

| 命令 | 说明 | | --- | --- | | /web status | 网页界面是否在运行(端口 + PID) | | /web start | 后台启动网页界面(node <dshBin> web --port <webPort>) | | /web stop | 停止网页界面进程 | | /web restart | 重启 | | /tunnel status | 隧道是否在运行 | | /tunnel start | 启动 SSH 隧道(需配置 tunnelHost) | | /tunnel stop | 停止隧道 | | /ask <问题> | 走 headless 的一次性问答(有超时保护) | | /console | 启动控制台 TUI(需配置 consoleCommand) |

配置

所有键都有合理默认值;在 profile 的 cordis.patch.yml(或 --patch 覆盖)里修改本 bundle 添加的行的 config:

- id: dsh-console
  config:
    webPort: 3080            # dsh 网页界面端口
    dshBin: ''               # apps/cli/lib/bin.js 路径;为空时自动探测
    tunnelHost: '192.168.1.100'
    tunnelUser: 'root'
    tunnelKey: 'C:\\Users\\you\\.ssh\\id_rsa'
    tunnelLocalPort: 3081
    tunnelRemotePort: 3080
    askTimeout: 150
    consoleCommand: 'python C:\\tools\\dsh-tui\\main.py'

| 键 | 默认 | 含义 | | --- | --- | --- | | webPort | 3080 | dsh 网页界面默认监听 127.0.0.1:3080/web start 在此启动。 | | dshBin | 自动 | 你代码仓库里 apps/cli/lib/bin.js 的绝对路径。为空时从运行进程探测(process.argv[1]),源码方式跑的 dsh 一般无需配置。 | | tunnelHost | '' | SSH 服务器地址。为空禁用 /tunnel start。 | | tunnelUser | root | 服务器上的 SSH 用户。 | | tunnelKey | '' | SSH 私钥绝对路径(-i)。用 agent/其他认证时可省略。 | | tunnelLocalPort | 3081 | 隧道本地监听端口(127.0.0.1:3081)。 | | tunnelRemotePort | 3080 | 隧道转发到的远程端口(服务器上的 127.0.0.1:3080)。 | | askTimeout | 150 | /ask 超时秒数,超时自动终止。 | | consoleCommand | '' | 启动你的控制台 TUI 的 shell 命令。 |

隧道接线方式

你的机器                          SSH 服务器 (tunnelHost)
127.0.0.1:3081  ──ssh -L──▶  127.0.0.1:3080
   ▲                               ▲
   │  /tunnel start 在此监听        │  dsh web 或其他服务跑在这里

/tunnel start 会执行 ssh -N -L <tunnelLocalPort>:127.0.0.1:<tunnelRemotePort> <tunnelUser>@<tunnelHost>(配置了 tunnelKey 时加 -i)作为后台进程。/tunnel stop 找到并杀掉监听 tunnelLocalPort 的进程。

典型场景

  • 本机启动器(CLI/headless profile)——终端里管理网页:/web start → 打开 http://127.0.0.1:3080/web stop 停止。
  • 远程网页(本机要访问另一台机器)——把 tunnelHost 指向远程,浏览器访问 http://127.0.0.1:<tunnelLocalPort>
  • 在 web profile 自身里——/web status/tunnel status 安全;/web stop|restart 会杀掉正在服务当前界面的进程,请谨慎。

安全提示

  • /web stop / /web restart 在 web profile 里执行会杀掉正在服务当前界面的进程。
  • /tunnel start 会用你配置的密钥执行 ssh——只配置可信来源的密钥。
  • /ask 会跑 headless 并消耗模型额度;结果由命令平面渲染,不进入模型历史。

开发

npm test          # 后端原语 node 测试(只读)
pnpm pack         # 打出可安装的 tarball

本 bundle 无构建步骤:纯 ESM,发布 index.js + lib/ + cordis.patch.yml