relfa 0.2.0

A gentle digital gravedigger to lovingly archive your old files.
relfa-0.2.0 is not a library.

๐Ÿชฆ Relfa - Your Gentle Digital Gravedigger

Relfa Banner

Keep your computer's clutter under control with loving care

GitHub release Crates.io CI Coverage License Downloads

๐Ÿ“ฆ Installation โ€ข ๐Ÿš€ Quick Start โ€ข โœจ Features โ€ข ๐Ÿ“š Documentation โ€ข ๐Ÿค Contributing

"In Relfa's Graveyard, nothing is truly lostโ€”just waiting in gentle slumber for you, or the next digital archaeologist."


๐ŸŒŸ What is Relfa?

Relfa is your gentle digital gravedigger that helps you maintain a clean workspace without the anxiety of permanently losing important files. Instead of aggressively deleting old files, Relfa lovingly archives them to a well-organized digital graveyard where they can rest in peaceโ€”and be easily resurrected when needed.

๐ŸŽฏ Philosophy

  • ๐Ÿ•Š๏ธ Gentle Approach: No aggressive deletions, just loving archival
  • ๐Ÿ” Smart Detection: Identifies files that haven't been touched recently
  • ๐Ÿ—ƒ๏ธ Organized Storage: Creates a structured graveyard with multiple time-based views
  • ๐ŸงŸโ€โ™‚๏ธ Easy Resurrection: Bring back archived files when you need them
  • ๐Ÿ“ Memory Keeping: Add epitaphs explaining why files were archived
  • ๐Ÿ”— Efficient Links: Uses symlinks to provide multiple organizational views without file duplication

โœจ Features

๐ŸŽฎ Interactive Review

  • Multi-action interface: archive, delete, view, open, skip
  • Safety confirmations for destructive actions
  • Real-time file preview with configurable pager
  • Desktop application integration

๐Ÿ—ƒ๏ธ Flexible Archival System

  • Smart organization by creation/modification/archival dates
  • Efficient symlink-based storage
  • Configurable graveyard structure
  • Cross-platform support (Linux, macOS, Windows)

๐Ÿ” Powerful Search

  • Filename pattern matching
  • Content search within epitaph notes
  • Visual indicators for match sources
  • Smart deduplication

๐Ÿ“ฑ Modern UX

  • Desktop notifications
  • Configurable pager support
  • Rich emoji-enhanced CLI output
  • Comprehensive man page

๐Ÿš€ Installation

๐Ÿ“ฆ Quick Install

๐Ÿ“ฅ Pre-built Binaries

Download the latest release for your platform from GitHub Releases:

# Linux (x86_64)
curl -L https://github.com/nilp0inter/relfa/releases/latest/download/relfa-linux-x86_64.tar.gz | tar xz
sudo mv relfa /usr/local/bin/

# macOS (Intel)
curl -L https://github.com/nilp0inter/relfa/releases/latest/download/relfa-macos-x86_64.tar.gz | tar xz
sudo mv relfa /usr/local/bin/

# macOS (Apple Silicon)
curl -L https://github.com/nilp0inter/relfa/releases/latest/download/relfa-macos-aarch64.tar.gz | tar xz
sudo mv relfa /usr/local/bin/

# Windows
# Download relfa-windows-x86_64.zip and extract to your PATH

๐Ÿ“– Man Page Installation

sudo cp relfa.1 /usr/local/share/man/man1/
sudo mandb
man relfa  # View the manual

๐Ÿƒโ€โ™‚๏ธ Quick Start

1. ๐Ÿ”ง Initial Setup

# View current configuration
relfa config

# Scan your inbox for stale files  
relfa scan
๐Ÿ•ท๏ธ  Scanning Inbox for dusty files...
โ˜ ๏ธ  3 items in ~/Inbox are gathering dust:
   ๐Ÿ“„ "old-document.pdf" (file) - last touched 5 days ago (2025-07-29)
   ๐Ÿ“„ "project-archive/" (folder) - last touched 4 days ago (2025-07-30)
   ๐Ÿ“„ "temp-notes.txt" (file) - last touched 10 days ago (2025-07-24)

๐Ÿค– 1 item is eligible for auto-archiving (older than 7 days):
   ๐Ÿ“„ "temp-notes.txt" (file) - last touched 10 days ago (2025-07-24)
   โš ๏ธ  These will be automatically archived if you run 'relfa archive' without arguments!

๐Ÿ’ก Run 'relfa review' to interactively deal with these items
   or 'relfa archive' to auto-archive old files (or 'relfa archive --all' for all).

2. ๐Ÿ” Interactive Review

relfa review

The interactive review gives you options for each file:

Command Action Description
(a)rchive ๐Ÿ—ƒ๏ธ Archive Move to graveyard without note
(n)ote+archive ๐Ÿ“ Archive with epitaph Add explanatory note
(d)elete ๐Ÿ—‘๏ธ Delete Permanent deletion (requires confirmation)
(v)iew ๐Ÿ‘€ View Preview content with pager
(o)pen ๐Ÿš€ Open Open with default application
(s)kip โญ๏ธ Skip Skip for now
(q)uit ๐Ÿšช Quit Exit review session

3. ๐Ÿ“ฆ Batch Operations

# Archive all stale files at once
relfa archive --all

# Archive specific file with explanation
relfa archive old-document.pdf --note "Outdated project specification from Q1"

# Archive with batch note
relfa archive --all --note "Weekly cleanup - $(date +%Y-%m-%d)"

๐Ÿค– Auto-Archive Feature

Relfa can automatically archive files that exceed the auto-archive threshold when you run relfa archive without arguments:

# Automatically archive files older than auto_archive_threshold_days (default: 7 days)
relfa archive

# Disable auto-archiving (shows help message instead)
relfa archive --no-auto-archive

# Auto-archive with a note
relfa archive --note "Automated cleanup - $(date +%Y-%m-%d)"

The scan command will warn you about files eligible for auto-archiving:

๐Ÿ•ท๏ธ  Scanning Inbox for dusty files...
โ˜ ๏ธ  2 items in ~/Inbox are gathering dust:
   ๐Ÿ“„ "document.pdf" (file) - last touched 5 days ago (2025-07-29)
   ๐Ÿ“„ "old-file.txt" (file) - last touched 10 days ago (2025-07-24)

๐Ÿค– 1 item is eligible for auto-archiving (older than 7 days):
   ๐Ÿ“„ "old-file.txt" (file) - last touched 10 days ago (2025-07-24)
   โš ๏ธ  These will be automatically archived if you run 'relfa archive' without arguments!

5. ๐Ÿ” Search & Resurrection

# Search in graveyard (searches filenames AND epitaph content)
relfa search "project"

# Search by epitaph content
relfa search "meeting notes"

# Resurrect files back to inbox
relfa resurrect "important-file"
๐Ÿ” Searching for 'project' in the Graveyard...
Found 2 matches in the Graveyard:
  ๐Ÿ“„ created/laptop/2024/07/15/project-alpha-notes.md
     ๐Ÿ’ญ "Meeting notes from project alpha kickoff"
  ๐Ÿ“„ created/laptop/2024/06/20/project-proposal.pdf  
     ๐Ÿ’ญ "Initial proposal document - archived after approval" ๐Ÿ”

The ๐Ÿ” emoji indicates the match was found in the epitaph content, not the filename.

๐Ÿ—๏ธ Graveyard Structure

Relfa creates an elegantly organized graveyard structure:

~/Graveyard/
โ”œโ”€โ”€ created/hostname/2024/08/02/     # Organized by creation date
โ”‚   โ”œโ”€โ”€ document.pdf                 # ๐Ÿ“„ Original file
โ”‚   โ””โ”€โ”€ document.pdf.epitaph         # ๐Ÿ“ Optional note
โ”œโ”€โ”€ modified/hostname/2024/07/15/    # Organized by modification date
โ”‚   โ”œโ”€โ”€ document.pdf@ โ†’ ../created/  # ๐Ÿ”— Symlink to original
โ”‚   โ””โ”€โ”€ document.pdf.epitaph@ โ†’      # ๐Ÿ”— Symlink to epitaph
โ””โ”€โ”€ archived/hostname/2024/08/02/    # Organized by archival date
    โ”œโ”€โ”€ document.pdf@ โ†’ ../modified/ # ๐Ÿ”— Symlink chain
    โ””โ”€โ”€ document.pdf.epitaph@ โ†’      # ๐Ÿ”— Follows same pattern

This structure provides:

  • ๐Ÿ“… Browse by creation date: Find files by when they were originally created
  • โœ๏ธ Browse by modification date: See files by when they were last changed
  • ๐Ÿ—ƒ๏ธ Browse by archival date: Review recently archived items
  • ๐Ÿ’พ Efficient storage: Symlinks prevent duplication while providing multiple views
  • ๐Ÿ” Consistent organization: Epitaphs follow the same symlink structure as files

โš™๏ธ Configuration

Relfa uses a TOML configuration file at ~/.config/relfa/config.toml:

# Basic settings
inbox = "/home/user/Inbox"
graveyard = "/home/user/Graveyard"
age_threshold_days = 3               # Files older than this show as "stale"
auto_archive_threshold_days = 7      # Files older than this auto-archive when running 'relfa archive'
notification = "desktop"             # "desktop" or "cli"
pager = "less"                      # "less", "bat", "more", etc.

[path_format]
date_format = "{hostname}/{year}/{month:02}/{day:02}"

# Flexible subdirectory configuration
[path_format.created_subdir]
type = "original"    # Contains actual files
name = "created"

[path_format.modified_subdir]  
type = "symlink"     # Contains symlinks
name = "modified"
target = "created"   # Points to created subdir

[path_format.archived_subdir]
type = "symlink"
name = "archived" 
target = "modified"  # Creates chain: archived โ†’ modified โ†’ created

๐ŸŽ›๏ธ Advanced Configuration Options

Each subdirectory can be configured as:

  • original - Contains the actual files
  • symlink - Contains symlinks pointing to another subdirectory
  • nothing - Disabled (not created)

Example configurations:

# Minimal: Only organize by creation date
[path_format.created_subdir]
type = "original"
name = "by-creation"

[path_format.modified_subdir]
type = "nothing"

[path_format.archived_subdir] 
type = "nothing"
# Complex chain: created โ†’ modified โ†’ archived
[path_format.created_subdir]
type = "original"
name = "created"

[path_format.modified_subdir]
type = "symlink"  
name = "modified"
target = "created"

[path_format.archived_subdir]
type = "symlink"
name = "archived"
target = "modified"

The date_format supports these placeholders:

  • {hostname} - Computer hostname
  • {year} - Full year (2024)
  • {month} - Month number (8)
  • {month:02} - Zero-padded month (08)
  • {day} - Day number (15)
  • {day:02} - Zero-padded day (15)

Examples:

date_format = "{year}/{month:02}/{day:02}"                    # 2024/08/15
date_format = "{hostname}/{year}-{month:02}"                  # laptop/2024-08  
date_format = "archive-{year}-{month:02}-{day:02}"           # archive-2024-08-15

๐Ÿ“ Epitaphs - Digital Memory Keeping

Epitaphs are optional notes that explain why files were archived, creating a historical record of your digital archaeology:

โœ๏ธ Adding Epitaphs

# During archival
relfa archive old-logs/ --note "Log files from completed project - kept for reference"

# During interactive review  
relfa review
# Choose (n)ote+archive and enter your explanation

# Batch archival with note
relfa archive --all --note "End of semester cleanup - keeping for historical reference"

๐Ÿ“‹ Epitaph Format

Epitaphs are stored as .epitaph files containing structured metadata and your note:

# Epitaph for project-notes.md
# Archived: 2024-08-02 15:30:45 UTC
# Created: 2024-01-15 09:22:10 UTC  
# Modified: 2024-07-28 16:45:33 UTC
# Hostname: workstation

Project planning notes from Q1 2024. Archived after project completion
but keeping for historical reference and lessons learned documentation.
Contains meeting notes, timeline, and final retrospective.

๐Ÿ” Searching Epitaphs

Epitaph content is fully searchable:

# Find files by epitaph content
relfa search "meeting notes"
relfa search "Q1 2024"  
relfa search "retrospective"

# Case-insensitive search
relfa search "PROJECT"  # Finds "project" in epitaphs

๐ŸŽจ Usage Examples

๐Ÿ“Š Daily Workflow

#!/bin/bash
# Daily cleanup routine

echo "๐Ÿงน Daily digital cleanup started"

# Check for new clutter
relfa scan

# Interactive review (optional)
echo "Starting interactive review..."
relfa review

# Quick batch cleanup for everything else
relfa archive --all --note "Daily cleanup - $(date +%Y-%m-%d)"

echo "โœจ Cleanup complete!"

๐Ÿ” Finding Archived Content

# Search by filename patterns
relfa search "presentation"
relfa search "*.pdf"
relfa search "2024"

# Search by epitaph content  
relfa search "project alpha"
relfa search "meeting notes"
relfa search "semester"

# Find recently archived items
relfa search "$(date +%Y-%m-%d)"  # Today's archives

๐ŸงŸโ€โ™‚๏ธ File Resurrection

# Resurrect specific files
relfa resurrect "important-document"

# Interactive selection for multiple matches
relfa resurrect "presentation"
# Found 3 matches:
#   1. presentation-draft.pptx
#   2. final-presentation.pptx  
#   3. presentation-notes.md
# Which file to resurrect? (1-3, or 'q' to quit): 2

# Files are copied back to Inbox (originals remain in graveyard)

๐Ÿค– Automation Examples

#!/bin/bash
# weekly-cleanup.sh

WEEK=$(date +%Y-W%U)

echo "๐Ÿ—“๏ธ  Weekly cleanup for week $WEEK"

# Archive everything with weekly note
relfa archive --all --note "Weekly cleanup for $WEEK - routine maintenance"

# Show statistics
echo "๐Ÿ“Š Graveyard summary:"
find ~/Graveyard -name "*.epitaph" | wc -l | xargs echo "Total archived items:"
find ~/Graveyard -name "*.epitaph" -newer ~/Graveyard/.last-cleanup 2>/dev/null | wc -l | xargs echo "New this week:"

# Update cleanup timestamp
touch ~/Graveyard/.last-cleanup

echo "โœจ Weekly cleanup complete!"
#!/bin/bash  
# project-archive.sh PROJECT_NAME

PROJECT_NAME=${1:-"unnamed-project"}
ARCHIVE_NOTE="Project '$PROJECT_NAME' completed on $(date +%Y-%m-%d). Archiving all project files for historical reference."

echo "๐Ÿ“ฆ Archiving project: $PROJECT_NAME"

# Archive project-related files
relfa archive --all --note "$ARCHIVE_NOTE"

echo "๐Ÿ” Searching for any remaining project files..."
relfa search "$PROJECT_NAME"

echo "โœ… Project archival complete for: $PROJECT_NAME"

๐ŸŽฏ Use Cases

๐Ÿ‘ฉโ€๐Ÿ’ผ Professionals

  • Downloads cleanup: Archive old downloads with context
  • Project management: Organize completed projects by timeline
  • Document versioning: Archive old versions with change notes
  • Meeting materials: Archive with meeting context and outcomes

๐ŸŽ“ Students

  • Assignment organization: Archive by semester with grades/feedback
  • Research materials: Keep old research accessible with context
  • Course notes: Archive by semester with course information
  • Project files: Maintain academic project history

๐Ÿ’ป Developers

  • Log management: Archive logs with deployment context
  • Build artifacts: Archive with version and build information
  • Backup organization: Structure backups with project context
  • Code samples: Archive experimental code with learning notes

๐Ÿ  Home Users

  • Photo organization: Archive old photos with family context
  • Document management: Keep important docs with life events
  • Media collection: Archive old media with descriptive context
  • Digital memories: Maintain family digital history

๐Ÿ“š Documentation

๐Ÿ”ง Development

๐Ÿงช Setup Development Environment

# Clone repository
git clone https://github.com/nilp0inter/relfa.git
cd relfa

# Build and test
cargo build
cargo test --all-features

# Install locally for testing
cargo install --path .

# Run with test configuration
mkdir -p test-{inbox,graveyard,config}
echo 'inbox = "./test-inbox"
graveyard = "./test-graveyard"
age_threshold_days = 1' > test-config/config.toml

RELFA_CONFIG_DIR=./test-config ./target/debug/relfa scan

๐Ÿ—๏ธ Architecture Overview

src/
โ”œโ”€โ”€ main.rs           # CLI entry point and command routing
โ”œโ”€โ”€ cli.rs            # Command-line argument parsing  
โ”œโ”€โ”€ commands.rs       # Business logic for all commands
โ”œโ”€โ”€ config.rs         # Configuration management
โ”œโ”€โ”€ scanner.rs        # File scanning and age detection
โ”œโ”€โ”€ archiver.rs       # File archival and epitaph management
โ”œโ”€โ”€ graveyard.rs      # Search and resurrection functionality
โ””โ”€โ”€ utils.rs          # Utility functions (pager, file ops)

๐Ÿงช Testing

# Run all tests
cargo test

# Run tests with coverage
cargo install cargo-tarpaulin
cargo tarpaulin --all-features

# Run benchmarks
cargo bench

# Check code quality
cargo clippy --all-targets --all-features
cargo fmt --check

๐Ÿค Contributing

We welcome contributions! Here's how you can help make Relfa even better:

๐Ÿ› Reporting Issues

  • Use the issue tracker
  • Include your OS, Rust version, and configuration
  • Provide steps to reproduce the issue
  • Include relevant log output

โœจ Submitting Features

  1. Check existing issues for similar requests
  2. Create a detailed feature request with use cases
  3. Consider implementing it yourself (we love PRs!)

๐Ÿ’ป Code Contributions

  1. Fork the repository
  2. Create a feature branch: git checkout -b amazing-feature
  3. Implement your changes with tests
  4. Test thoroughly: cargo test --all-features
  5. Format code: cargo fmt && cargo clippy
  6. Submit a pull request with detailed description

๐Ÿ“ Documentation

  • Improve README, man page, or code documentation
  • Add usage examples or tutorials
  • Fix typos or clarify explanations
  • Translate documentation to other languages

๐ŸŽจ Other Ways to Help

  • โญ Star the repository to show your support
  • ๐Ÿฆ Share on social media to help others discover Relfa
  • ๐Ÿ’ฐ Sponsor the project to support development
  • ๐Ÿ—ฃ๏ธ Provide feedback on your user experience

๐Ÿ“Š Project Statistics

GitHub stars GitHub forks GitHub watchers

GitHub contributors GitHub commit activity GitHub last commit

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

  • ๐Ÿ’ก Inspiration: The endless struggle against digital entropy and the need for gentle file management
  • ๐Ÿฆ€ Built with Rust: Leveraging the amazing Rust ecosystem and community
  • ๐Ÿ—๏ธ Architecture: Inspired by the Unix philosophy of small, composable tools
  • ๐ŸŒŸ Community: Special thanks to all contributors, users, and feedback providers
  • ๐Ÿ“š Influences: Getting Things Done methodology and digital minimalism principles

๐Ÿ”ฎ Roadmap

๐ŸŽฏ Planned Features

  • Web interface for remote graveyard management
  • Plugin system for custom archival rules
  • Cloud backup integration for graveyard sync
  • AI-powered file categorization and epitaph suggestions
  • Statistics dashboard showing digital entropy over time
  • Integration with popular file managers

๐ŸŽจ Quality of Life

  • Fuzzy search for file resurrection
  • Bulk epitaph editing for multiple files
  • Themes for CLI output customization
  • Multiple inbox support for different project types
  • Advanced notifications with custom triggers

โฌ†๏ธ Back to Top


"For dust thou art, and unto dust shalt thou return."
But maybe you'll want that markdown file again someday!

Made with ๐Ÿชฆ and โค๏ธ by the Relfa community

Happy haunting, and tidy archiving!