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

@wentools/worktree

v0.1.2

Published

CLI tool for managing git worktree-based workflows

Readme

@wentools/worktree

A CLI for managing git worktree-based workflows — each branch gets its own directory instead of switching in place.

Why

Switching branches in a monorepo means reinstalling dependencies, restarting dev servers, and losing your place. Git worktrees solve this by giving each branch its own checkout, but setting them up by hand is tedious. wt automates the setup, symlinking shared config files and running post-switch commands so new worktrees are ready to use immediately.

Quick start

deno install -g -A jsr:@wentools/worktree    # or: npx @wentools/worktree

wt init [email protected]:org/my-project.git
cd my-project
wt switch my-feature   # creates branch + worktree, prints its path

Commands

wt init <remote> [directory]

Clones the remote as a bare repo, creates the worktrees/ subdirectory, and writes a default .worktree.json config.

wt init [email protected]:org/my-project.git
wt init [email protected]:org/my-project.git custom-name

wt switch <name> [--run-hooks]

Switches to (or creates) a worktree. Can be run from anywhere inside the project tree — it walks up to find the project root.

  • If the branch exists (local or remote), checks it out into worktrees/<name>
  • If the branch doesn't exist, creates it
  • If the worktree already exists, prints its path without recreating it

On new worktrees, symlinks and post-switch hooks run automatically. Pass --run-hooks to re-run hooks on an existing worktree.

Path preservation: If you're inside worktrees/beta/website/src/, switching to main lands you in worktrees/main/website/src/ (if it exists), otherwise the worktree root.

wt switch beta
wt switch my-feature
wt switch main --run-hooks

The switch command prints the target path to stdout. Wrap it in a shell function to cd automatically — see Shell wrapper.

wt remove <name>

Removes a worktree and deletes the branch if it was fully merged.

wt remove my-feature

wt list

Lists all active worktrees.

Shell wrapper

A CLI tool can't change your shell's directory. Add this function to your shell config (.bashrc, .zshrc, etc.) to make switching seamless:

wt() { cd "$(command wt switch "$@")" }

Then just:

wt my-feature    # creates/switches and cd's into the worktree

Config

The .worktree.json file lives in the project root (created by init, edited by hand).

{
  "symlinks": [
    {
      "source": "~/.env/my-project/.env",
      "target": "website/.env"
    }
  ],
  "postSwitch": [
    {
      "command": "pnpm install",
      "workdir": "website"
    }
  ]
}

symlinks

Creates symbolic links inside each new worktree. target is relative to the worktree root. source supports ~ for home directory. Useful for .env files and other gitignored config that won't be present in new checkouts.

postSwitch

Commands to run after a worktree is created. workdir is relative to the worktree root (defaults to the root itself). Commands run in order; if one fails, the rest are skipped.

Install

From JSR (Deno):

deno install -g -A jsr:@wentools/worktree

From npm:

npm install -g @wentools/worktree

License

MIT