oops is an undo daemon that snapshots files targeted by destructive shell commands so users can restore them after accidental damage.

Stars

8

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-31

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It adds a safety net directly in the shell: dangerous commands are intercepted before execution and at-risk files are snapshotted, so users can undo mistakes with a single `oops` command.

Who it is for

  • Developers and power users who frequently run destructive shell commands
  • Sysadmins managing servers or workstations via the shell
  • Users of bash/zsh/fish wanting an extra safety net for CLI operations

Use cases

  • Recover files accidentally deleted with rm
  • Undo in-place edits made by sed -i or redirects
  • Restore state before destructive git commands like git reset --hard
  • Browse and restore snapshots from the last 48 hours or 2 GB of storage

Strengths

  • Automatic interception via shell preexec hooks and a background daemon
  • Uses reflink copies on Btrfs/ZFS and plain copies elsewhere, with SQLite metadata
  • Includes TUI commands (list/diff) and snapshot pinning to avoid garbage collection
  • Conflict detection compares mtime before restoring older snapshots

Considerations

  • Cannot intercept commands from cron, systemd services, GUI apps, scripts without the hook, or non-interactive shells
  • Requires a user systemd service and shell hook setup; Linux platform only
  • Retention is limited to 48 hours or 2 GB unless snapshots are pinned

README quick start

Crate Downloads MSRV License Platform PRs

Undo daemon for destructive shell commands

Before rm, mv, sed -i, >, git reset --hard, and friends run, their target files get snapshotted — so you can undo the damage.

oops

→ undoes whatever you just broke.


Install

cargo build --release
install -Dm755 target/release/oops ~/.local/bin/oops
install -Dm644 systemd/oopsd.service ~/.config/systemd/user/oopsd.service
systemctl --user daemon-reload
systemctl --user enable --now oopsd
loginctl enable-linger "$USER"
eval "$(oops init bash)"   # or: zsh, fish

Commands

CommandDescription
oopsUndo the most recent restorable snapshot
oops undo [id]Undo a specific snapshot (default: newest)
oops listBrowse snapshot history (TUI, ↑↓/jk to navigate)
oops diff Show files captured in a snapshot (TUI)
oops statusDaemon status, storage usage, l

Description

🛡️ Undo daemon for destructive shell commands

Related repositories

Similar projects matched by category, topics, and programming language.

l0ng-ai
Featured
l0ng-ai GitHub avatar

tty7

tty7 is a fast, GPU-accelerated terminal workbench with persistent sessions, built-in input tools, SSH support, and coding agent awareness.

Developer ToolsCLI & Terminal
359
programmersd21
Featured
programmersd21 GitHub avatar

flow

flow is a minimalist terminal dashboard that displays real-time network throughput with smooth animations, multiple responsive modes, and zero configuration.

Developer ToolsCLI & Terminal
277
bjan
Featured
bjan GitHub avatar

claudemux

Claudemux is a lightweight, dependency-minimal message bus that lets multiple Claude Code sessions communicate in real-time over tmux, enabling one session to ask another a question and receive the answer without manual intervention.

AI & Machine LearningAI Agents
9