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

@iyulab/oops-cli

v0.1.3

Published

CLI for Oops - Safe text file editing with automatic backup

Readme

@iyulab/oops-cli

CLI for Oops - Safe text file editing with automatic backup and simple undo.

Installation

# Global installation (recommended)
npm install -g @iyulab/oops-cli

# Local installation
npm install @iyulab/oops-cli

Quick Start

# Start tracking a file (creates backup automatically)
oops config.txt

# Edit the file with your preferred editor
nano config.txt

# Check what changed
oops diff config.txt

# Apply changes permanently
oops keep config.txt

# Or undo changes back to backup
oops undo config.txt

# Check status of all tracked files
oops status

Commands

Core Workflow

oops <file>

Start tracking a file safely. Creates a backup and initializes workspace if needed.

oops myfile.txt
oops src/config.js
oops /path/to/important.conf

oops diff [file]

Show changes in tracked files.

oops diff              # Show all changes
oops diff config.txt   # Show changes in specific file

oops keep <file>

Apply changes and stop tracking the file.

oops keep config.txt

oops undo <file>

Revert file to backup and stop tracking.

oops undo config.txt

oops status

Show status of all tracked files and workspace information.

oops status

Options

Global Options

  • -V, --version - Show version number
  • -v, --verbose - Enable verbose output
  • -q, --quiet - Suppress output
  • --no-color - Disable colored output
  • --workspace <path> - Use specific workspace path
  • --yes - Skip confirmation prompts
  • -h, --help - Display help

Command-Specific Options

diff

  • --tool <tool> - Use external diff tool (code, vimdiff, meld)
  • --no-color - Disable colored diff output

keep

  • --no-confirm - Skip confirmation prompt

undo

  • --no-confirm - Skip confirmation prompt

Environment Variables

  • OOPS_WORKSPACE - Workspace path (default: temp directory)
  • OOPS_DIFF_TOOL - External diff tool (code, vimdiff, meld)
  • NO_COLOR - Disable colored output

Examples

Basic Workflow

# Start tracking
oops nginx.conf
# → ✨ Creating temporary workspace at: /tmp/oops-abc123
# → 📁 Starting to track: nginx.conf
# → 💾 Backup created: .oops/files/def456/backup

# Make changes
vim nginx.conf

# Review changes
oops diff nginx.conf
# → Shows colored diff output

# Apply changes
oops keep nginx.conf
# → ✅ Changes applied to nginx.conf

Multiple Files

# Track multiple files
oops config.js
oops package.json
oops README.md

# Check status
oops status
# → Workspace: /tmp/oops-abc123 (3 files tracked)
# → 📝 config.js - modified
# → 📝 package.json - modified  
# → 📄 README.md - clean

# Review all changes
oops diff
# → Shows changes for all modified files

External Diff Tool

# Use VS Code for diff
oops diff --tool code config.txt

# Set environment variable
export OOPS_DIFF_TOOL=vimdiff
oops diff config.txt

Workspace Management

# Use custom workspace
oops --workspace ./my-workspace config.txt

# Set via environment
export OOPS_WORKSPACE=/path/to/workspace
oops config.txt

Safety Features

  • Automatic Backup: Every tracked file gets a backup before changes
  • Workspace Isolation: Each project operates independently
  • Confirmation Prompts: Safety prompts for destructive operations
  • Health Checks: Automatic detection of workspace corruption
  • Atomic Operations: All-or-nothing changes to prevent partial failures

Integration

Editor Integration

The CLI works well with any text editor:

# With vim
oops config.txt && vim config.txt && oops diff config.txt

# With VS Code  
oops package.json && code package.json

# With nano
oops .bashrc && nano .bashrc && oops keep .bashrc

Scripts

#!/bin/bash
# Safe config editing script

FILE="$1"
oops "$FILE"
$EDITOR "$FILE"

echo "Review changes:"
oops diff "$FILE"

read -p "Apply changes? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    oops keep "$FILE"
    echo "✅ Changes applied"
else
    oops undo "$FILE"  
    echo "↩️ Changes reverted"
fi

Troubleshooting

Common Issues

File not found error

oops: error: File does not exist: nonexistent.txt

Make sure the file path is correct and the file exists.

Permission denied

oops: error: Permission denied: /etc/passwd

Ensure you have read/write permissions for the file.

Workspace corruption

oops: error: Workspace corrupted, please run: oops clean

The workspace has integrity issues. Clean and reinitialize.

Getting Help

oops help              # General help
oops help status       # Command-specific help
oops --help            # Options and examples

License

MIT - see LICENSE for details.

Repository

https://github.com/iyulab/oops