技能潮 SkillTide 提交收录
官方说明开源项目7 天前
sohan-bhat/oopsy

sohan-bhat/oopsy

Undo for the terminal. Snapshots files, git state and Postgres data right before destructive commands run, so you or your AI agent can type oops and get it back.
在 GitHub 查看 ↗直链 · 无中转页
★ 数取值
0 ★ · sohan-bhat/oopsy · 取自该仓库的 GitHub 页面 · (2026-10-16 20:00:20 核对)
来源明细
从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
收录与活跃
收录于 2026-10-10 · 最近见到 2026-10-10 · 共见到 1 次 · 被 1 个来源列出
评分构成
综合分 103 · 1 个来源 · repo
常见问题(答案都来自我们的记录)
怎么安装?
我们【没有】从该仓库取到安装命令(我们的 install 覆盖率只有约 4%)。请看它的 README 或 releases 页。
它适合谁 / 用来做什么?
我们把它归在这些标签下: 开源项目。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库 sohan-bhat/oopsy;我们收录于 2026-10-10;最近见到 2026-10-10。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
第三方质量标记

Oopsy

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

**Undo for rm -rf, and everything else you wish you hadn't run.** Files (deletes and overwrites, by any command, including make clean, npm scripts and scripts Oopsy has never seen), git (resets, branches, stashes, force pushes) and Postgres (drops, deletes, bad updates). Oopsy snapshots it right before it is destroyed, whether you typed the command or your AI agent did. Type oops and it is back.
Watch the 36 second demo
Website: https://sohan-bhat.github.io/oopsy/
Runs on macOS, Linux and Windows.
Ctrl+Z does not cover the terminal, rm skips the Trash, git only protects what you committed, and agent checkpoints do not track files changed by shell commands or rows in your database. Oopsy covers all of those.
Install
macOS and Linux:
or
Windows:
or
To pin a version, set OOPS_VERSION (without the v):
Homebrew always installs the latest release.
Then turn on the hooks once:
This adds a small hook to zsh, bash, fish and PowerShell (Git Bash and cmd.exe too on Windows), and hooks before and after each shell command and file edit to Claude Code, Codex CLI, Cursor and Gemini CLI if they are installed. Every file it touches is backed up first, and oops uninstall removes it all.
Use
For Postgres, run your app or agent through the proxy:
How it works
Oopsy has two layers.
**The command line layer** is fast and precise. The shell hook runs right before each command. Oopsy parses it with a real shell parser, expands variables and globs the way your shell will, and works out exactly which paths, git refs or stashes are about to be destroyed, including paths outside your project.
**The project mirror** catches everything else, so a program that deletes or rewrites files by itself (make clean, npm run reset, a Python script) is undoable too. For every project you work in (the git work tree around you, or the folder itself), Oopsy keeps a standing mirror that costs almost no disk: each file is a copy on write clone or a hard link of the original, plus a compact index. Before a command that is not provably read only, a quick stat walk brings the mirror up to date (about 20 to 30 ms for 10,000 files, see the numbers below). After the command, the walk runs again in the background at your next prompt, and every file the command changed or removed moves from the mirror into that command's snapshot. oops undoes it exactly, swapping changed files back while they are still what the command left.
* Read only lines (ls, cat, grep, git status, git log and friends) are skipped inside the shell itself, at no cost.
* Rebuildable folders (node_modules, target, .venv, venv, dist, build, .next, __pycache__, .gradle, and anything in a .oopsignore) are not mirrored file by file. When a command is about to touch one, because it names it or a script it runs does (Oopsy reads npm, yarn, pnpm and bun scripts in package.json, asks make -n for its plan, and reads script files the command runs), the whole folder is saved right then as one clone or hard link tree, and kept for a day instead of seven.
* The first time you run a command in a big project (over 3,000 files), the mirror is built in the background; until then only the command line layer covers it. Projects over 50,000 files are left to the command line layer (oops config mirror_max_files changes that).
Snapshots are saved the cheapest safe way the disk allows:
* a copy on write clone: APFS on macOS, reflinks on btrfs and xfs, block cloning on ReFS and Dev Drive. Instant, and no extra disk until the original changes; an overwrite then keeps only the changed blocks.
* hard links on NTFS and ext4. Also instant and free, since the data stays alive through the snapshot. A hard link shares the file, so a program that writes into a file in place (instead of replacing it) would change the link too. On Linux, Oopsy's shells load a small preload library that copies a mirrored file right before a program first writes into it. Statically linked programs, like most Go binaries, do not load preload libraries.
来源
github · https://github.com/sohan-bhat/oopsy
按领域浏览
开源项目
收录于
7 天前

更多开源项目

查看开源项目全部 731 条 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引