auto-snap
v1.0.0
Published
An intelligent, local file history & snapshot manager designed to protect your code from accidental loss.
Maintainers
Readme
📦 Auto-Snap
Auto-Snap is an intelligent, local file history & snapshot manager designed to protect your code from accidental loss, crashes, AI overwrites, and forgotten commits. It automatically captures meaningful changes using smart heuristics — producing clean, efficient snapshots without noise or clutter.
Auto-Snap works alongside Git, your editor, and any workflow without requiring configuration or manual commits.
🚀 Features
🔍 Intelligent Snapshotting
Auto-Snap saves snapshots only when changes are meaningful, using:
- Trivial Change Detection: Ignores tiny edits (e.g., < 5 characters changed).
- Similarity Scoring: Skips snapshots if the new version is > 98% similar to the previous one.
- Reversal Detection: If you revert a file back to a previous version, Auto-Snap won’t create duplicates.
- Subset Pruning (Advanced): Automatically removes old snapshots that are strict subsets of newer ones.
🗂️ Restoreable Deletions
When you delete a file, Auto-Snap can still restore it from the last saved snapshot.
📦 Storage Optimization
- Hash-Based Deduplication ensures identical file content is only stored once.
- Snapshot directory stays compact even in large projects.
💻 Simple CLI Interface
Commands like start, stop, history, restore, and clear make it easy to manage your snapshot history.
📥 Installation
npm install -g auto-snap🛠️ Usage
1. Initialize your project
auto-snap init2. Start watching files
auto-snap startAuto-Snap now runs in the background, capturing meaningful edits automatically.
3. View snapshot history
auto-snap historyDeleted files appear in red marked as: DELETED (Restorable)
4. Restore a snapshot
Restore entire snapshot:
auto-snap restore <SNAPSHOT_ID>Restore a single file:
auto-snap restore <SNAPSHOT_ID> <FILE_PATH>5. Clear all snapshots
auto-snap clear6. Stop the watcher
auto-snap stop⚙️ Configuration
Edit .auto-snap/config.json to customize Auto-Snap:
| Key | Description | Default |
| :--- | :--- | :--- |
| debounce | Time (ms) of idle before snapshot | 10000 |
| minCharChange | Minimum characters changed to trigger snapshot | 5 |
| similarityThreshold | Skip snapshot if similarity > threshold | 0.98 |
| include | Glob patterns to include | ["**/*"] |
| exclude | Glob patterns to ignore | ["node_modules", ".git"] |
🧾 License
Released under the ISC License.
