Skip to content

Index file system changes using merkel trees

License

jeremytregunna/merkel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merkel

Indexing file system changes using merkle trees.

What it does

Merkel creates a cryptographic fingerprint of your directory tree using SHA-256 hashes. Files are hashed by content, directories by their children's hashes. This allows efficient detection of any changes in your codebase.

Installation

zig build

The binary will be available at zig-out/bin/merkel.

Usage

# Initialize index for current directory
merkel init

# Initialize index for specific directory
merkel init /path/to/code

# Check for changes and update index
merkel check

# Show index status and information
merkel status

# Watch directory for real-time changes (Linux only)
merkel watch

# Show help
merkel help

How it works

  1. Init: Scans directory tree and creates .merkel/index.json with hash fingerprints
  2. Check: Rescans and compares against stored hashes, reporting changes
  3. Watch: Uses Linux inotify to monitor filesystem events in real-time
  4. Status: Shows when index was last updated and file count

Changes are detected at three levels:

  • ADDED: New files or directories
  • MODIFIED: Files with different content hashes
  • DELETED: Missing files or directories

The tool ignores its own .merkel directory and hidden files by default.

Requirements

  • Zig 0.14.1 or later
  • Linux (for watch functionality)

License

MIT License - see LICENSE file for details.

About

Index file system changes using merkel trees

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages