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 🙏

© 2025 – Pkg Stats / Ryan Hefner

git-sw-plugin

v1.0.0

Published

Interactive CLI tool to install git skip-worktree aliases and prompt info

Downloads

96

Readme

git-sw-plugin

Interactive CLI tool to install git skip-worktree aliases and prompt info for bash and zsh shells.

Features

  • Git Aliases: Convenient commands for managing skip-worktree files

    • git-sw-list - List all skip-worktree files
    • git-sw - Add modified files to skip-worktree
    • git-unsw - Remove all files from skip-worktree
  • Prompt Info: Display skip-worktree file count in your shell prompt

    • Customizable icon/emoji
    • Customizable colors
    • Automatic integration with Oh-My-Zsh themes (bullet-train, agnoster, etc.)
    • Live preview during configuration

Installation

Using npx (Recommended)

npx git-sw-plugin install

Uninstall

npx git-sw-plugin uninstall

Supported Shells

  • Bash (with .bashrc, .bash_profile, or .profile)
  • Zsh (with .zshrc)
  • Oh-My-Zsh themes (automatic detection)

How It Works

  1. Auto-Detection: Detects your shell, RC files, and Oh-My-Zsh setup
  2. Interactive Configuration: Choose features, icons, and colors with live preview
  3. Smart Installation: Uses the best strategy for your prompt setup:
    • Oh-My-Zsh with prompt order: Fully automatic
    • Oh-My-Zsh themes: Segment function + instructions
    • Custom prompts: Function + manual integration guide
  4. Safe Modifications: Creates backups before making changes

Usage Examples

Git Aliases

After installation:

# List skip-worktree files
git-sw-list

# Add modified files to skip-worktree
git-sw

# Remove all files from skip-worktree
git-unsw

Prompt Display

When you have files marked as skip-worktree, your prompt will show:

~/projects/myapp (main) 🔒 SW:3 ❯

The count updates automatically as you add/remove skip-worktree files.

What is skip-worktree?

Git's skip-worktree feature allows you to tell Git to ignore changes to tracked files. This is useful for:

  • Local configuration files you don't want to commit
  • Development environment customizations
  • Temporary modifications for testing

Unlike .gitignore, skip-worktree works on tracked files.

Development

Project Structure

install-git-sw-plugin/
├── bin/
│   └── cli.js              # Executable entry point
├── src/
│   ├── index.js            # Main orchestrator
│   ├── shell-detector.js   # Shell and environment detection
│   ├── rc-file-manager.js  # Safe RC file modifications
│   ├── prompt-parser.js    # Parse existing prompts
│   ├── prompt-builder.js   # Generate shell-specific code
│   ├── preview.js          # Preview system (hybrid)
│   ├── ui.js               # Interactive UI with enquirer
│   └── installer.js        # Installation logic
├── package.json
└── README.md

Technologies

  • enquirer: Interactive CLI prompts
  • chalk: Terminal colors and styling
  • Node.js built-in modules for shell execution and file operations

Troubleshooting

"No RC file found"

Create an RC file first:

# For bash
touch ~/.bashrc

# For zsh
touch ~/.zshrc

"Cannot write to RC file"

Check file permissions:

chmod u+w ~/.zshrc  # or ~/.bashrc

Prompt not showing skip-worktree info

  1. Make sure you've reloaded your shell: source ~/.zshrc
  2. Check if manual integration is required (shown during installation)
  3. For Oh-My-Zsh: Verify gitskipworktree was added to your prompt order

Contributing

This is a local development project. To contribute:

  1. Make changes in the appropriate module
  2. Test with both bash and zsh
  3. Test with and without Oh-My-Zsh

License

MIT