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

screen-manager-tui

v1.1.1

Published

Screen Manager TUI - Interactive GNU Screen session management tool with React-based terminal UI

Downloads

515

Readme

sm — Screen Manager

SSH 登录后的交互式 GNU Screen 会话管理器。基于 Ink (React for CLI) 构建,为手机竖屏 SSH 操作优化。

 sm (3)
 > 1 🌻 ● sm-0412-1249    12:49
   2 🔥 ● llm-0412-1300   13:00
   3 🐳 ○ work-0411-0900  09:00
 ────────────────────────────
   4 + sm claude
   5 + sm
   6 + llm claude
   7 + llm
 1-9 go  jk sel  n new  x kill  r ref  q quit

安装

推荐通过 npm 全局安装:

npm install -g screen-manager-tui

安装后即可使用 sm 命令。

git clone https://github.com/m2kar/sm.git
cd sm
npm install
npm run build
npm link

使用

sm                          # 启动
SM_HOME=/home/zhiqing sm    # 指定项目根目录

首页

| 按键 | 操作 | |------|------| | 1-9 | 直接连接已有会话 / 快速新建会话 | | j k / | 上下选择 | | Enter | 连接选中会话 | | n | 新建会话(选择目录) | | x | 终止选中会话 | | r | 刷新列表 | | q | 退出到 Shell |

首页分为两个区域:

  • 已有会话 — 每个会话前有基于名称哈希的固定 emoji、状态标识( 可连接 / 已占用 / 已死亡)
  • 快速新建 — 最近使用的 top 2 收藏目录 × 是否启动 Claude Code = 4 个选项,按数字一键创建并进入

新建会话

n 进入目录选择:

| 按键 | 操作 | |------|------| | 1-9 / Enter | 选择目录 | | j k / | 上下选择 | | Tab / c | 切换 [x] claude 启动选项 | | Esc | 返回首页 |

  • 会话名自动生成:目录名-月日-时分(如 sm-0412-1249
  • 收藏目录显示完整路径,路径过长时自动缩写(/h/z/p/subfolder
  • 选择 "Other..." 可输入自定义路径,该路径自动加入收藏
  • [x] claude 默认开启,创建会话后自动执行 claude 命令

连接已占用会话

选择状态为 ○ Attached 的会话时:

| 按键 | 操作 | |------|------| | 1 | 共享会话(多屏同显) | | 2 | 强制接管(踢掉另一端) | | Esc | 取消 |

核心交互循环

SSH 登录 → sm 启动 → 选择/新建会话 → 进入 screen
         ↑                                    ↓
         └──── Ctrl-A D 从 screen 断开 ────────┘
                        按 q → 退出到 Shell

从 screen 会话 detach 后自动回到 sm 界面,无需重新输入命令。

收藏与排序

  • 新建会话和连接会话都会记录目录的使用时间
  • 自定义路径自动保存为收藏
  • 收藏按最近使用时间排序,首页快速新建始终展示 top 2
  • 数据存储在 $SM_HOME/.sm-data.json

SSH 自动启动

~/.zshrc 末尾添加:

if [[ -n "$SSH_CLIENT" ]] && [[ -z "$STY" ]] && [[ -z "$SM_SKIP" ]] && command -v sm &>/dev/null; then
  export SM_HOME=/home/zhiqing
  sm
fi

条件说明:

  • $SSH_CLIENT — 仅 SSH 会话触发
  • $STY — 已在 screen 中则跳过
  • $SM_SKIP=1 — 临时跳过 sm

发版

npm version patch   # 或 minor / major
git push && git push --tags

推送 v* tag 后,GitHub Actions 会自动通过 Trusted Publisher 发布到 npm。

技术栈

  • Ink 7 (React for CLI) + React 19 + TypeScript
  • GNU Screen 命令封装
  • ESM + Node.js 24

项目结构

src/
├── index.tsx                 # 入口 + attach/re-render 主循环
├── app.tsx                   # App 组件,视图状态机
├── components/
│   ├── SessionList.tsx       # 会话列表 + 快速新建
│   ├── NewSession.tsx        # 目录选择 + claude 开关
│   ├── AttachModeDialog.tsx  # 已占用会话的连接方式选择
│   ├── ConfirmDialog.tsx     # 终止确认
│   ├── Header.tsx            # 标题栏
│   └── Footer.tsx            # 快捷键提示
├── hooks/
│   └── useScreenSessions.ts  # screen 会话数据 hook
└── utils/
    ├── screen.ts             # screen 命令封装
    └── dirs.ts               # 目录扫描、收藏、路径缩写、emoji