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

pi-var

v1.0.1

Published

Copy-on-write variations for pi — work on multiple features simultaneously with isolated workspaces

Readme

🌿 pi-var

AI-driven copy-on-write variations for pi

Work on multiple features simultaneously with isolated workspaces — automatically.

pi extension license



Philosophy: The AI Does It

Traditional variation management requires you to:

  • Name the variation
  • Remember to switch contexts
  • Manually merge and clean up

pi-var removes all of that. The AI detects when isolated work is needed and handles everything:

  • Creates variations with semantic names
  • Redirects all file operations automatically
  • Suggests merge when work is complete

You just say what you want. The AI manages the workspace.


How It Works

User: "Work on the new dashboard feature while I fix this bug in main"
         │
         ▼
   ┌─────────────┐
   │  pi-var     │  ← AI decides isolation is needed
   └──────┬──────┘
          │
    ┌─────┴─────┐
    ▼           ▼
┌───────┐   ┌─────────┐
│ main  │   │ 🌿 dash │  ← CoW clone (instant, zero copy)
│ (src) │   │  (src') │
└───┬───┘   └────┬────┘
    │            │
    │ bug fix    │ dashboard feature
    │            │
    ▼            ▼
  merge ◄──────┘

Auto-detected method (fastest available):

  1. CoW (APFS clonefile / Linux reflink) — fastest, instant
  2. Git worktree — for git projects on non-CoW filesystems
  3. Full copy — universal fallback

Installation

pi install https://github.com/monotykamary/pi-var

Or project-local:

pi install -l https://github.com/monotykamary/pi-var

Usage

Natural Language

Just describe what you need:

"Work on the new dashboard feature while I fix this bug in main"

The AI automatically:

  1. Creates a variation for the dashboard work
  2. Redirects all operations to that variation
  3. When you mention the bug fix, creates another variation
  4. Switches between them transparently
  5. Merges completed work back

Dev Server Isolation

"Run this experiment on a different port so my main dev server keeps running"

The AI:

  1. Creates a variation
  2. Allocates a unique port via npx portless
  3. Runs the dev server
  4. All without touching your main server

For Users: Manual Commands

If you need to intervene or check status:

| Command | Purpose | | ---------------------- | ----------------------------------- | | /var | Show status and active variation | | /var list | List all variations | | /var clean <name> | Delete a variation | | /var clean --stale 7 | Delete variations older than 7 days | | /var stop | Return to source directory |


For the AI: Tools Reference

create_variation

Create an isolated workspace automatically.

{
  purpose: string;           // "fix auth redirect bug"
  type?: 'cow' | 'worktree' | 'copy';  // Auto-detected if omitted
  createBranch?: boolean;    // Create git branch for worktrees
}

Auto-generated name: Creates semantic names from purpose (e.g., fix-auth-redirect-bug).

Port isolation: For dev servers, use npx portless via bash:

export PORT=$(npx portless --json | jq -r '.port')
npm run dev

merge_variation

Merge current variation back to source.

{
  dryRun?: boolean;   // Preview changes
}

Variations persist after merge. They are never automatically deleted to protect against data loss. Use /var clean to remove old variations.


Environment Synchronization

Copied files: .env, .envrc, .npmrc, .tool-versions, .node-version

Symlinked directories: node_modules, .next, .nuxt, target/, .venv/

This saves gigabytes of disk space while ensuring each variation has isolated environment configuration.


Transparent Redirection

When a variation is active:

  • read → reads from variation directory
  • edit → modifies files in variation
  • write → creates files in variation
  • bash → executes in variation directory
  • External paths (outside project) → accessed directly

The footer shows: 🌿 variation-name


Comparison

vs Git Worktrees Alone

| Feature | Git Worktrees | pi-var | | ---------------- | ------------------- | -------------------------- | | Setup | Manual branching | Automatic | | File redirection | Manual cd | Transparent | | Environment sync | Manual copy/symlink | Automatic | | Port conflicts | Manual management | AI handles via portless | | Best method | Git only | CoW > worktree > copy | | Cleanup | Manual git commands | AI-managed or /var clean |

vs Docker/Dev Containers

  • pi-var: Native filesystem performance, instant startup, same environment
  • Docker: True OS isolation, image builds, slower startup

Use pi-var for parallel development work. Use Docker for different OS/toolchain environments.


Configuration

Create .varconfig.yaml in project root for custom sync rules:

# Files to copy
copy:
  - .env.local
  - secrets.json

# Directories to symlink
symlink:
  - node_modules
  - .turbo

Development

# Install dependencies
npm install

# Run tests
npm test

# Type check
npm run typecheck

License

MIT