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

wtf-bro

v0.1.0

Published

Undo global buat vibecoder yang panik pas AI agent merusak codebase. Safety-first git rollback.

Readme

wtf-bro (What The Fix) 🛟

Tombol "Undo" global buat vibecoder yang panik saat AI agent (Claude Code, OpenCode, dll) merusak codebase. CLI rollback berbasis Git yang safety-first — bukan sekadar git reset --hard manual.

Package name: wtf-bro · Bin command: wtf

Kenapa beda dari git reset --hard biasa?

Sebelum aksi destructive, wtf otomatis backup state lu:

  • git tag wtf-bro-backup-<ts> → snapshot commit posisi sekarang, biar reset ke commit lama tetap recoverable.
  • git stash push -u → amankan untracked files yang bakal kehapus git clean -fd.

Jadi kalau salah pencet atau AI-nya ngaco, lu ga kehilangan data permanen.

Install

# Jalur utama (cocok buat skenario panik — ga perlu install dulu)
npx wtf-bro

# Atau install global biar command instan
npm i -g wtf-bro

Cara pakai

wtf                 # TUI interaktif: pilih level rollback (1 / 3 / nuklir)
wtf save [label]    # tandain posisi aman SEKARANG (panic button)
wtf undo            # balik ke save point terakhir, atau ke HEAD kalau ga ada
wtf undo <commit>   # balik ke commit tertentu (hash / branch / tag)
wtf --reset 1       # rollback 1 commit (non-interaktif, tetap auto-backup)
wtf --reset 3       # rollback 3 commit
wtf --reset nuclear # reset + clean semua untracked
wtf clean-backups   # hapus tag+stash backup lama (save point aman)
wtf log             # riwayat rollback + cara restore

Di TUI lu pilih:

  • Rollback 1 commit — undo kerusakan terakhir
  • Rollback 3 commits — lebih dalam
  • Nuklir (reset + clean) — reset ke HEAD + hapus semua untracked. Butuh konfirmasi ketik ulang nama branch (bukan cuma Y/n), karena ireversibel via Git biasa.

Save point = posisi aman buat dongo

wtf save bikin tag wtf-bro-save-<label>-<ts> di commit lu sekarang. Kalau working tree lagi kotor, WIP lu di-stash dulu biar ga ilang. Pas AI ngaco, tinggal wtf undo → balik persis ke posisi itu (termasuk hapus file sampah yang AI bikin).

wtf undo (tanpa arg) cerdas:

  1. Kalau ada save point → balik ke situ.
  2. Kalau ga ada → balikin working tree ke HEAD (bersihin mess AI).

🎮 Tutorial — skenario hidup sehari-hari

Skenario 1: Sebelum biarin AI ngubah-ngubah (paling aman)

Bikin titik aman DULU, baru suruh AI kerja:

wtf save before-ai      # tandain posisi aman sekarang
# ... suruh AI ngoding ...
# ... AI ngaco? ...
wtf undo                # balik persis ke posisi aman

Skenario 2: AI udah merusak, ga sempet save dulu

Kalau AI udah bikin kacau dan cuma ada perubahan yang belum di-commit:

wtf undo                # ga ada save point -> balikin ke HEAD, bersihin mess AI

Ini batalin semua perubahan file + hapus file baru yang AI bikin, terus balik ke commit terakhir yang bener.

Skenario 3: Mau loncat ke kondisi lama

wtf undo <commit-hash>  # balik ke commit tertentu (bisa pake hash/branch/tag)
# atau
wtf --reset 1           # mundur 1 commit
wtf --reset 3           # mundur 3 commit
wtf --reset nuclear     # reset ke HEAD + hapus semua file untracked (hati-hati)

Skenario 4: Salah pencet / rollback kebanyakan — RESTORE dari backup

Tenang. Semua aksi destructive di-backup otomatis (tag + stash). Gimana balikin:

# 1. Liat tag & stash backup yang terakhir dibikin
git tag | grep wtf-bro-backup
git stash list | grep wtf-bro-backup

# 2. Balik ke kondisi sebelum rollback (posisi commit-nya)
git reset --hard wtf-bro-backup-<ts>

# 3. Kalau ada file untracked yang ikut kehapus, pulihin dari stash
git stash apply wtf-bro-backup-<ts>     # atau: git stash pop

wtf log juga nampilin tag backup tiap aksi, biar gampang dicari.

Kapan pakai apa (cheat sheet)

| Situasi | Command | |---|---| | Mau amanin posisi sebelum AI kerja | wtf save [label] | | AI ngaco, mau balik ke posisi aman | wtf undo | | Mau batalin semua perubahan yang belum di-commit | wtf undo | | Mau mundur beberapa commit | wtf --reset N | | Mau reset total + hapus file sampah | wtf --reset nuclear | | Mau balik ke commit tertentu | wtf undo <hash> | | Lupa abis ngapain, mau liat riwayat | wtf log | | Salah pencet, mau balikin kondisi | git reset --hard wtf-bro-backup-<ts> | | Backup tag/stash numpuk, mau bersihin | wtf clean-backups |

⚠️ Batas kemampuan (jujur)

  • Butuh commit atau wtf save buat full undo. File baru yang belum PERNAH di-commit ga bisa dibalik — Git ga punya referensi ke dia. Solusinya: wtf save (atau commit) SEBELUM biarin AI ngubah-ubah, biar ada titik aman.
  • wtf undo ke HEAD cuma membatalkan perubahan yang belum di-commit. Buat loncat ke commit lampau, pakai wtf undo <commit> atau wtf --reset N.
  • Semua aksi destructive di-backup otomatis (tag + stash). Pesan restore selalu ditampilin — data lu ga ilang permanen.

Fitur

  • ✅ Auto-backup (tag + stash) sebelum tiap rollback
  • ✅ Save point (wtf save) + smart undo (wtf undo) — tombol aman buat dongo
  • wtf clean-backups — bersihin tag/stash backup lama (save point aman)
  • ✅ Audit log lokal di ~/.wtf/history.json
  • ✅ Konfirmasi ekstra buat reset nuklir (ketik ulang nama branch)
  • ✅ Deteksi commit limit (repo baru ga bisa rollback 3)
  • ✅ Deteksi detached HEAD (dicegah biar ga ngerusak)
  • ✅ Deteksi package manager dari lockfile (npm/pnpm/yarn/bun)
  • ✅ Cross-platform (MacOS, Linux, Windows)

⚠️ Known conflict bin command wtf

Bin command wtf bisa bentrok dengan:

  1. wtf-cli (package npm lain, mati sejak 2019) yang juga ekspos bin wtf.
  2. Utility jadul wtf di beberapa distro Linux/Mac (dari paket BSD games, via apt/brew).

Ini bukan blocker — npm i -g wtf-bro yang diinstall paling akhir bakal menang di node_modules/.bin. Tapi kalau nemu command wtf ngelakuin hal aneh, cek dulu apakah ada yang nge-override.

Development

npm install
npm run build     # bundle ke dist/
npm test          # jalanin unit/E2E test (node:test + tsx)
npm run typecheck

Tech Stack

Node.js + TypeScript + tsup (bundle) + @clack/prompts (TUI) + cross-spawn (safe shell exec) + picocolors (styling).

License

MIT © harikahono