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

@skauffmann/worktree

v1.13.0

Published

CLI tool for managing Git worktrees with interactive prompts

Readme

worktree

A delightful CLI for managing Git worktrees. Stop stashing, start shipping.

Why worktree?

Working on multiple branches simultaneously shouldn't be painful. Git worktrees let you check out multiple branches at once in separate directories, but setting them up manually is tedious: creating the worktree, copying environment files, installing dependencies, opening your editor...

worktree handles all of that with a single command and beautiful interactive prompts.

Features

  • Interactive prompts — Guided setup with sensible defaults
  • Environment file handling — Automatically symlink or copy your .env files from all directories and subdirectories
  • Dependency installation — Detects your package manager and installs dependencies
  • Editor integration — Opens your new worktree in Cursor, VS Code, or Zed
  • Terminal integration — Option to open the worktree in a new terminal tab
  • Smart detection — Knows when you're inside a worktree and offers relevant actions
  • Auto-fetch — Fetches latest from origin before creating a worktree
  • Update notifications — Keeps you informed about new versions

Installation

# npm
npm install -g @skauffmann/worktree

# bun
bun install -g @skauffmann/worktree

# pnpm
pnpm add -g @skauffmann/worktree

# yarn
yarn global add @skauffmann/worktree

Or run it directly without installing:

# npx
npx @skauffmann/worktree

# bunx
bunx @skauffmann/worktree

Usage

# Start the interactive workflow
worktree

# Pre-fill the branch name
worktree feature/awesome-feature

What happens when you run it?

  1. Enter a branch name — Creates the worktree directory named after your branch
  2. Fetch latest — Automatically fetches from origin to ensure up-to-date branches
  3. Choose branch action — Track an existing remote branch or create a new one
  4. Handle environment files — Symlink (recommended) or copy your .env files from all directories and subdirectories
  5. Install dependencies — Automatically runs your package manager
  6. Open in editor — Jump straight into coding
  7. Open in terminal — Optionally open a new terminal tab in the worktree directory

Managing existing worktrees

When you run worktree from inside an existing worktree (or when worktrees exist), you get additional options:

  • Create new worktree — Start a new worktree from the current branch or origin/main
  • Open — Open the worktree in your editor
  • Replace — Delete and recreate the worktree
  • Delete — Remove the worktree completely

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | WORKTREE_EDITOR | Editor to open worktrees in (cursor, code, zed) | Auto-detected | | WORKTREE_SKIP_UPDATE_CHECK | Skip the update check on startup | false |

Examples

# Always use VS Code
export WORKTREE_EDITOR=code

# Disable update checks
export WORKTREE_SKIP_UPDATE_CHECK=1

How it works

your-repo/                    # Main repository
├── .git/
├── .env                      # Root environment file
├── apps/
│   └── web/.env              # Nested environment files too!
└── src/

your-repo-feature/            # Worktree created by this CLI
├── .env → ../your-repo/.env              # Symlinked!
├── apps/
│   └── web/.env → ../your-repo/apps/web/.env
└── src/

Worktrees are created as siblings to your main repository, with branch names converted to directory-safe formats (slashes become dashes).

Supported tools

Package managers

The CLI auto-detects your package manager from lock files:

| Lock file | Package manager | |-----------|-----------------| | bun.lockb or bun.lock | bun | | pnpm-lock.yaml | pnpm | | yarn.lock | yarn | | package-lock.json | npm |

If no lock file is found, bun is used by default.

Editors

Editors are auto-detected in this order: CursorVS CodeZed

You can override this with the WORKTREE_EDITOR environment variable.

If no editor is found, the worktree directory opens in your system file explorer.

License

MIT