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

xsheel

v0.1.8

Published

A tiny collection of shell helpers runnable via npx.

Readme

mwt

一个小脚本:从当前仓库的 HEAD 创建一个新分支,并用 git worktree 在固定目录创建一个新的工作区,分支名和工作区目录都使用 6 位短 ID 避免重复。

默认工作区路径(不当作临时目录清理):

~/Library/Application Support/mwt/worktrees/<project>/<id6>

例如:

  • ~/Library/Application Support/mwt/worktrees/app1/abc123
  • ~/Library/Application Support/mwt/worktrees/app1/def456 (示例中 ID 仅示意)

用法

方式 1:本地放到 PATH

把脚本放到 PATH(例如 ~/bin)并赋予可执行权限:

chmod +x mwt

运行(默认会进入新 worktree 并打开一个交互 shell):

./mwt

方式 2:通过 npx 使用(推荐)

发布到 npm 后,可以直接运行仓库里的脚本:

npx xsh mwt

也可以直接执行脚本同名的 bin(需要 npm 的 exec/npx 支持;更通用的写法是 -p):

npx -p xsh mwt

发布到 npm

首次在本机发布需要登录:

npm login

发布(公开包):

npm publish --access public

说明:

  • 每次发布前会自动运行 tools/sync-bins.mjs,把当前目录(以及可选的 scripts/ 目录)里所有“可执行文件”同步到 package.jsonbin 字段;后续新增脚本只要 chmod +x 并重新发布即可通过 npx 使用。

删除指定分支对应的 worktree 并删除该分支:

./mwt delete wt-<id6>

强制删除(worktree 有未提交改动/分支不可 fast-forward 删除时用):

./mwt delete wt-<id6> --force

删除当前项目在默认根目录下的所有 worktree(需要确认):

./mwt delete-all

强制删除:

./mwt delete-all --force

只创建 worktree,不开启新 shell:

./mwt --no-shell

打印新 worktree 路径(方便你自己 cd):

./mwt --print-path --no-shell

指定基于哪个 ref 创建(默认 HEAD):

./mwt --base main

额外拷贝文件/目录

默认配置随脚本一起发布,位于 mwt 脚本同目录的 .mwt-copy.default,创建 worktree 时会按其中规则拷贝(如果存在且目标不存在):

CLAUDE.md
.claude

如果你在仓库根目录创建了 .mwt-copy,会完全覆盖默认规则。每行一个相对路径,支持注释 #

# 例如
.env.local
docs/private-notes