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

undoai

v1.0.2

Published

Free, local undo button for AI coding

Readme

undoai

Free, local undo button for AI coding

A zero-friction CLI tool that automatically creates snapshots when AI tools modify your code, allowing instant rollback when things break. Like mrq, but 100% free, open-source, and local.

🎯 Why undoai?

AI coding assistants (Cursor, Claude, Copilot) are powerful but can break working code. When AI modifies 5+ files at once and something breaks, you need an instant undo button.

undoai solves this by:

  • 🔒 100% Local & Private - Your code never leaves your machine
  • 📸 Auto-Snapshots - Detects AI burst changes (≥5 files) automatically
  • Instant Restore - One command to rollback all changes
  • 💰 Free Forever - No accounts, no cloud, no subscriptions

🚀 Quick Start

# Install dependencies
pnpm install

# Build the project
pnpm build

# Start watching for changes
node dist/cli/index.js watch

# (In another terminal) Trigger AI changes...
# When AI breaks something:
node dist/cli/index.js restore

📦 Installation

From Source

git clone <your-repo-url>
cd undoai
pnpm install
pnpm build

Install Globally (Optional)

pnpm link --global

# Now you can use 'undoai' anywhere
undoai watch

💻 Commands

undoai watch

Start watching for file changes in current directory.

undoai watch

What it does:

  • Monitors all files in current directory
  • Ignores node_modules, .git, dist, build
  • Auto-creates snapshot when ≥5 files change within 2 seconds
  • Runs in foreground (Press Ctrl+C to stop)

Example output:

✅ undoai is now watching
📁 Project: /home/user/my-project
💾 Storage: /home/user/.undoai
🔒 100% local - your code never leaves this machine

ℹ️  Watching for file changes... (Press Ctrl+C to stop)

  📝 [change] src/auth.ts
  📝 [change] src/db.ts
  📝 [add] src/new-feature.ts
  📝 [change] package.json
  📝 [change] README.md
📸 Snapshot saved (5 files changed)

undoai restore

Restore files from a snapshot (interactive).

undoai restore

What it does:

  • Shows list of available snapshots
  • Displays relative time and file count
  • Confirms before restoring
  • Overwrites current files with snapshot contents

Example output:

ℹ️  Available snapshots:

? Which snapshot do you want to restore? (Use arrow keys)
❯ 1. [2 mins ago]   5 files   🤖 AI
  2. [15 mins ago]  8 files   🤖 AI  
  3. [1 hour ago]   3 files   🤖 AI
  ❌ Cancel

✅ Restored 5 files
From: 2 mins ago

undoai status

Show current status and info.

undoai status

Example output:

undoai Status

🟢 Running (PID: 12345)

💾 Storage:
   Location: /home/user/.undoai
   Snapshots: 3
   Size: 24.5 KB

📝 Commands:
   undoai watch    - Start watching
   undoai restore  - Restore snapshot
   undoai stop     - Stop watching
   undoai status   - Show this status

undoai stop

Stop the watching daemon.

undoai stop

🏗️ How It Works

Architecture

undoai/
├── src/
│   ├── watcher.ts          # File watching with chokidar
│   ├── core/
│   │   ├── storage.ts      # Local file storage (~/.undoai)
│   │   ├── snapshot.ts     # Snapshot creation & restore
│   │   └── daemon.ts       # Process management
│   ├── cli/
│   │   ├── index.ts        # CLI entry point
│   │   └── commands/       # watch, restore, stop, status
│   └── utils/
│       └── logger.ts       # Pretty console output

Storage Structure

~/.undoai/
├── daemon.pid                    # PID of running watcher
└── snapshots/
    ├── 1703265420000/           # Timestamp-based ID
    │   ├── metadata.json        # Snapshot info
    │   └── files/               # Copied files
    │       ├── src__auth.ts
    │       ├── src__db.ts
    │       └── ...
    └── 1703265480000/
        └── ...

metadata.json:

{
  "timestamp": 1703265420000,
  "date": "2024-12-22T14:30:20.000Z",
  "projectRoot": "/home/user/my-project",
  "changedFiles": [
    "/home/user/my-project/src/auth.ts",
    "/home/user/my-project/src/db.ts"
  ],
  "fileCount": 5,
  "label": "AI_BURST"
}

Burst Detection

  1. File watcher detects changes
  2. Buffers changes in a Set (prevents duplicates)
  3. Debounces for 2 seconds
  4. If ≥5 files changed → create snapshot
  5. Snapshot contains: metadata + file copies

🆚 undoai vs Alternatives

| Feature | Git Stash | mrq | undoai | |---------|-----------|-----|------------| | Cost | Free | $15-50/mo | ✅ Free | | Privacy | Local | Cloud (encrypted) | ✅ 100% Local | | Automatic | ❌ Manual | ✅ Auto | ✅ Auto | | Offline | ✅ Yes | ❌ No | ✅ Yes | | Setup | Complex | Account required | ✅ Zero config | | Open Source | Yes | ❌ No | ✅ MIT |

❓ FAQ

Q: How is this different from git?
A: Git requires manual commits and is polluted by intermediate snapshots. undoai is automatic and keeps snapshots separate from your git history.

Q: Does this replace git?
A: No! undoai complements git. Use git for version control, undoai for instant AI change rollback.

Q: Where are snapshots stored?
A: In ~/.undoai/snapshots/ on your local machine. Never sent to cloud.

Q: How much disk space does it use?
A: Each snapshot contains only changed files. Typical snapshot: 10-100KB. Use undoai status to check.

Q: Can I use this with Cursor/Claude/Copilot?
A: Yes! Works with any AI coding tool that modifies files.

Q: Does this work on Windows?
A: Yes! Fully compatible with Windows, macOS, and Linux. Storage paths adapt automatically:

  • Windows: C:\Users\username\.undoai
  • macOS/Linux: ~/.undoai

Q: What if I want to clean up old snapshots?
A: Currently manual: rm -rf ~/.undoai/snapshots/<snapshot-id>. Auto-cleanup coming in Phase 2.


Made with ❤️ for developers who love AI coding but hate breaking changes