Skip to content

Nurysso/tyr

Repository files navigation

Tyr

Intelligent file organization powered by machine learning

Rust License: GPL-3 Platform Made with Rust

FeaturesInstallationUsageConfigurationDocumentation


Demo

Overview

Tyr is a blazingly fast file organizer built in Rust that automatically categorizes and groups your files. Unlike traditional organizers that only look at file extensions, Tyr uses machine learning algorithms to understand relationships between files and intelligently organize them.

// Organize in seconds
tyr ~/Downloads

// FeaturesML-powered grouping
✓ Parallel processing
✓ Beautiful TUISafe operations

Features

Intelligent Organization

┌─────────────────────────────────┐
│  Extension-based categorization │
│  10+ default categories         │
│  Unlimited custom categories    │
└─────────────────────────────────┘
        ↓
┌─────────────────────────────────┐
│  ML-powered smart grouping      │
│  Levenshtein + Jaccard          │
│  Automatic version detection    │
└─────────────────────────────────┘

Capabilities:

  • Groups file versions (file_v1, file_v2)
  • Detects related files (project_code, project_docs)
  • Customizable similarity thresholds

High Performance

┌──────────────────────────────────┐
│  Performance Metrics             │
├──────────────────────────────────┤
│  1000 files     →  2.1 seconds   │
│  Parallel       →  3-5x speedup  │
│  Memory usage   →  ~8-12 MB      │
│  Syscalls       →  reduced alot  │
└──────────────────────────────────┘

Speed:

  • 600x faster than manual sorting
  • Optimized with Rayon parallelism
  • Lazy directory creation
  • Memory-efficient batch operations

Installation

Linux/Mac

curl -fsSL https://raw.githubusercontent.com/aelune/tyr/main/install.sh | bash

Windows

Invoke-WebRequest -Uri "https://raw.githubusercontent.com/aelune/tyr/main/install.ps1" -OutFile "install.ps1"
.\install.ps1

Manual

git clone https://github.com/Aelune/tyr.git
cd tyr
make install

Requirements: Rust 1.70+


Usage

Quick Start

# Organize current directory
tyr

# Organize specific directory
tyr ~/Downloads

# Organize any path
tyr /path/to/folder

Terminal Controls

Key Action
s Start organizing
d Dry run (preview)
q Quit application

Visual Example

┌────────────────────────────────────────────────────────────────┐
│                         BEFORE                                 │
├────────────────────────────────────────────────────────────────┤
│  Downloads/                                                    │
│  ├── report_v1.pdf                                             │
│  ├── report_v2.pdf                                             │
│  ├── report_v3.pdf                                             │
│  ├── vacation.jpg                                              │
│  ├── song.mp3                                                  │
│  └── data.xlsx                                                 │
└────────────────────────────────────────────────────────────────┘
                               ↓
                    tyr ~/Downloads
                               ↓
┌────────────────────────────────────────────────────────────────┐
│                    AFTER (Category Mode)                       │
├────────────────────────────────────────────────────────────────┤
│  Downloads/                                                    │
│  ├── Documents/                                                │
│  │   ├── report_v1.pdf                                         │
│  │   ├── report_v2.pdf                                         │
│  │   └── report_v3.pdf                                         │
│  ├── Images/                                                   │
│  │   └── vacation.jpg                                          │
│  ├── Audio/                                                    │
│  │   └── song.mp3                                              │
│  └── Spreadsheets/                                             │
│      └── data.xlsx                                             │
└────────────────────────────────────────────────────────────────┘
                               ↓
              enable_smart_grouping = true
                               ↓
┌────────────────────────────────────────────────────────────────┐
│                 AFTER (Smart Grouping Mode aka filename)       │
├────────────────────────────────────────────────────────────────┤
│  Downloads/                                                    │
│  ├── Documents/                                                │
│  │   └── report_group_001/    ← Grouped by ML                  │
│  │       ├── report_v1.pdf                                     │
│  │       ├── report_v2.pdf                                     │
│  │       └── report_v3.pdf                                     │
│  ├── Images/                                                   │
│  │   └── vacation.jpg                                          │
│  ├── Audio/                                                    │
│  │   └── song.mp3                                              │
│  └── Spreadsheets/                                             │
│      └── data.xlsx                                             │
└────────────────────────────────────────────────────────────────┘

Configuration

Configuration File: ~/.config/tyr/tyr.toml

Basic Settings

# Batch processing size
batch_size = 100

# Enable ML grouping
enable_smart_grouping = false

# Skip these files
skip_patterns = [
    ".DS_Store",
    "Thumbs.db",
    ".git*"
]

Custom Categories

[categories.my_category]
extensions = [
    "ext1",
    "ext2",
    "ext3"
]
folder_name = "My Custom Folder"

Similarity Tuning

[similarity_config]
levenshtein_threshold = 0.7      # Character similarity (0.0 - 1.0)
jaccard_threshold = 0.5          # Token overlap (0.0 - 1.0)
levenshtein_weight = 0.6         # Weight for character matching
jaccard_weight = 0.4             # Weight for token matching
min_similarity_score = 0.65      # Overall threshold for grouping

Use Cases

Photography

┌───────────────────────────────┐
│  RAW + JPG pairs grouping     │
│  Shoot session organization   │
│  Sequential numbering         │
│  Multi-format support         │
└───────────────────────────────┘

Software Development

┌───────────────────────────────┐
│  Source file organization     │
│  Language-agnostic sorting    │
│  Config file detection        │
│  Project-based grouping       │
└───────────────────────────────┘

Document Management

┌───────────────────────────────┐
│  Version tracking             │
│  Project-based grouping       │
│  Multi-format support         │
│  Archive organization         │
└───────────────────────────────┘

Downloads Cleanup

┌───────────────────────────────┐
│  Automatic categorization     │
│  Weekly organization runs     │
│  Clutter-free workspace       │
│  Smart conflict resolution    │
└───────────────────────────────┘

Make Commands

Build & Install

make install
make uninstall
make clean

Run & Test

make run
make test

Configuration

make config-edit
make config-path

Backup & Reset

make config-backup
make config-reset

Built With

Rust

Rust

Systems Language

Ratatui

Ratatui

Terminal UI

Crossterm

Crossterm

Terminal Control

Rayon

Rayon

Parallelism

Serde

Serde

Serialization


Roadmap

Planned Features

  • Content-based similarity (file hashing)
  • Date-based organization
  • Duplicate file detection
  • Undo functionality
  • Watch mode (auto-organize on changes)

What it dosen't do

  • Cloud storage integration
  • Image content analysis
  • Audio fingerprinting

Contributing

Contributions are welcome! We especially appreciate help with:

┌──────────────────────┬──────────────────────┬──────────────────────┐
│  New Algorithms      │  Performance Tuning  │  File Type Support   │
├──────────────────────┼──────────────────────┼──────────────────────┤
│  Documentation       │  Bug Fixes           │  Testing             │
└──────────────────────┴──────────────────────┴──────────────────────┘

Comparison

Feature Tyr Traditional Organizers
ML-based grouping
Parallel processing
Interactive TUI ⚠️ Some
External configuration ⚠️ Some
Dry run mode ⚠️ Some
Cross-platform ⚠️ Varies

License

This project is licensed under the GPL-3 License - see the LICENSE file for details.


Made with Rust

Star on GitHub Fork on GitHub

⬆ back to top

About

Intelligent file organization powered by machine learning.

Resources

License

Stars

Watchers

Forks

Packages

No packages published