Skip to content

serein-213/rarch

归藏 (rarch)

English | 简体中文

The Robust File Organizer — A blazing fast, content-aware, and atomic file organization tool written in Rust.

Build Status Language License

Why rarch?

Most file organizers just move files by extension. rarch is designed for power users who care about data integrity, storage efficiency, and zero-latency organization.

Visuals

rarch UI
rarch Interactive TUI Dashboard

rarch CLI
rarch CLI Running in Dry-Run Mode

Key Features

  • Blazing Fast: Powered by Rust and rayon for parallel processing. Scan and organize 100k+ files in seconds.
  • Atomic Undo: Every operation is journaled. If you mess up your rules, rarch undo restores everything exactly where it was.
  • Content-Aware: Don't be fooled by extensions. rarch uses deep magic-number inspection to identify file types (e.g., identifies a .txt as a .png).
  • Hard-link Deduplication: Automatically detects identical files using SHA-256 and converts duplicates into hard links, saving storage instantly.
  • Regex & Date Filters: Organize files by complex patterns or age (e.g., "move files older than 30 days").
  • Dynamic Organization: Use placeholders like ${year}, ${month}, and ${ext} in your target paths.
  • Professional Analytics: Dry-run mode provides a detailed table summary and "Potential Space Saved" reports.
  • Shell Completions: Native support for Bash, Zsh, Fish, and PowerShell.
  • Real-time Watch Mode: Run rarch watch to handle files the moment they arrive.
  • Interactive TUI: A beautiful dashboard for those who prefer a keyboard-driven visual experience.

Installation

cargo install rarch --features ui

Usage

⚙️ 1. Configure

Create rarch.toml:

[[rules]]
name = "Photos"
mime = "image/*"
target = "Pictures/${year}"
conflict = "rename"

[[rules]]
name = "PDFs"
type = "document"
extensions = ["pdf"]
target = "Archives/Documents"
conflict = "skip"

🛠️ 2. Organize

# Preview changes first
rarch run --dry-run

# Execute organization & deduplication
rarch run --path ~/Downloads

🕒 3. Undo

rarch undo

📡 4. Set it and forget it

rarch watch --path ~/Downloads

Architecture

  1. Scanner: Deep or shallow directory traversal.
  2. Engine:
    • Parallel hashing (SHA-256).
    • Content-type inference.
    • Link-based deduplication logic.
  3. Journal: JSON-based transaction log for 100% reliable undo.
  4. UI: Zero-dependency TUI powered by ratatui.

License

MIT OR Apache-2.0

About

A blazing fast, content-aware, and atomic file organization tool written in Rust.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages