relfa 0.2.3

A gentle digital gravedigger to lovingly archive your old files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
# ๐Ÿชฆ Relfa - Your Gentle Digital Gravedigger

<div align="center">

![Relfa Banner](https://via.placeholder.com/800x200/2C3E50/ECF0F1?text=๐Ÿชฆ+Relfa+-+Digital+File+Management+with+Love)

**Keep your computer's clutter under control with loving care**

[![GitHub release](https://img.shields.io/github/v/release/nilp0inter/relfa?style=flat-square)](https://github.com/nilp0inter/relfa/releases)
[![Crates.io](https://img.shields.io/crates/v/relfa?style=flat-square)](https://crates.io/crates/relfa)
[![CI](https://img.shields.io/github/actions/workflow/status/nilp0inter/relfa/ci.yml?branch=main&style=flat-square)](https://github.com/nilp0inter/relfa/actions)
[![Coverage](https://img.shields.io/codecov/c/github/nilp0inter/relfa?style=flat-square)](https://codecov.io/gh/nilp0inter/relfa)
[![License](https://img.shields.io/github/license/nilp0inter/relfa?style=flat-square)](LICENSE)
[![Downloads](https://img.shields.io/crates/d/relfa?style=flat-square)](https://crates.io/crates/relfa)

[๐Ÿ“ฆ Installation](#-installation) โ€ข [๐Ÿš€ Quick Start](#-quick-start) โ€ข [โœจ Features](#-features) โ€ข [๐Ÿ“š Documentation](#-documentation) โ€ข [๐Ÿค Contributing](#-contributing)

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

</div>

---

## ๐ŸŒŸ 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

<table>
<tr>
<td width="50%">

### ๐ŸŽฎ **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)

</td>
<td width="50%">

### ๐Ÿ” **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

</td>
</tr>
</table>

## ๐Ÿš€ Installation

### ๐Ÿ“ฆ **Quick Install**

<table>
<tr>
<td><strong>๐Ÿฆ€ Cargo</strong></td>
<td><code>cargo install relfa</code></td>
</tr>
<tr>
<td><strong>๐Ÿบ Homebrew</strong></td>
<td><code>brew install relfa</code></td>
</tr>
<tr>
<td><strong>๐Ÿง Arch Linux</strong></td>
<td><code>yay -S relfa</code></td>
</tr>
<tr>
<td><strong>๐Ÿณ Docker</strong></td>
<td><code>docker run --rm -v $(pwd):/workspace ghcr.io/nilp0inter/relfa:latest scan</code></td>
</tr>
</table>

### ๐Ÿ“ฅ **Pre-built Binaries**

Download the latest release for your platform from [GitHub Releases](https://github.com/nilp0inter/relfa/releases):

```bash
# 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**

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

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

### 1. ๐Ÿ”ง **Initial Setup**

```bash
# View current configuration
relfa config

# Scan your inbox for stale files
relfa scan
```

<details>
<summary>๐Ÿ“‹ Expected Output</summary>

```
๐Ÿ•ท๏ธ  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).
```

</details>

### 2. ๐Ÿ” **Interactive Review**

```bash
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**

```bash
# 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:

```bash
# 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**

```bash
# 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"
```

<details>
<summary>๐Ÿ“‹ Search Output Example</summary>

```
๐Ÿ” 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.

</details>

## ๐Ÿ—๏ธ 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`:

```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**

<details>
<summary>๐Ÿ”ง Subdirectory Types</summary>

Each subdirectory can be configured as:

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

Example configurations:

```toml
# 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"
```

```toml
# 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"
```

</details>

<details>
<summary>๐Ÿ“… Date Format Options</summary>

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:

```toml
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
```

</details>

## โ„๏ธ Nix Flake Usage

Relfa provides a comprehensive Nix flake with packages and Home Manager modules for declarative configuration and automation.

### ๐Ÿ“ฆ **Package Installation**

#### Direct Usage

```bash
# Run relfa directly from the flake
nix run github:nilp0inter/relfa

# Install to user profile
nix profile install github:nilp0inter/relfa

# Use in a development shell
nix shell github:nilp0inter/relfa
```

#### In a Nix System Configuration

```nix
{
  inputs.relfa.url = "github:nilp0inter/relfa";

  # In your system configuration
  environment.systemPackages = [ inputs.relfa.packages.${system}.relfa ];
}
```

### ๐Ÿ  **Home Manager Integration**

#### Basic Configuration

```nix
{
  inputs.relfa.url = "github:nilp0inter/relfa";

  # In your home.nix:
  imports = [ inputs.relfa.homeManagerModules.relfa ];

  programs.relfa = {
    enable = true;
    settings = {
      age_threshold_days = 5;
      auto_archive_threshold_days = 14;
      notification = "desktop";
      inbox = "${config.home.homeDirectory}/Downloads";
      graveyard = "${config.home.homeDirectory}/Archive";
    };
  };
}
```

### โฐ **Automated Execution with Systemd Timer**

#### Hourly Scan and Auto-Archive (Recommended)

```nix
programs.relfa = {
  enable = true;

  # Configure desktop notifications and settings
  settings = {
    notification = "desktop";
    age_threshold_days = 3;
    auto_archive_threshold_days = 7;
    inbox = "${config.home.homeDirectory}/Inbox";
    graveyard = "${config.home.homeDirectory}/Graveyard";
  };

  # Systemd timer configuration
  timer = {
    enable = true;
    frequency = "hourly";                # Run every hour
    command = "scan-then-archive";       # First scan, then auto-archive
    randomizedDelay = "15m";            # Random delay up to 15 minutes
  };
};
```

#### Daily Scan Only (Non-Destructive)

```nix
programs.relfa = {
  enable = true;
  settings.notification = "desktop";

  timer = {
    enable = true;
    frequency = "daily";
    command = "scan";                   # Only scan and notify
    randomizedDelay = "1h";
  };
};
```

#### Custom Schedule Examples

```nix
timer = {
  enable = true;

  # Every 30 minutes
  frequency = "*:0/30";

  # Every 6 hours
  frequency = "0/6:00:00";

  # Weekdays at 9 AM
  frequency = "Mon..Fri 09:00:00";

  # Daily at 2 PM with 2-hour random delay
  frequency = "daily";
  randomizedDelay = "2h";
};
```

### ๐ŸŽ›๏ธ **Configuration Options**

<details>
<summary>๐Ÿ“‹ Complete Configuration Reference</summary>

```nix
programs.relfa = {
  enable = true;

  # Package override (optional)
  package = inputs.relfa.packages.${pkgs.system}.relfa;

  # Core settings
  settings = {
    inbox = "${config.home.homeDirectory}/Inbox";
    graveyard = "${config.home.homeDirectory}/Graveyard";
    age_threshold_days = 3;              # Files show as "stale"
    auto_archive_threshold_days = 7;     # Files auto-archive
    notification = "desktop";            # "cli" or "desktop"
    pager = "bat";                      # File viewer command
  };

  # Systemd timer (optional)
  timer = {
    enable = true;
    frequency = "daily";                # systemd OnCalendar format
    command = "scan-then-archive";      # "scan", "archive", "scan-then-archive"
    randomizedDelay = "1h";            # Prevent simultaneous execution
  };
};
```

</details>

### ๐Ÿ”” **Notification Examples**

#### What You'll See with Timer Enabled:

- **Scan results**: `๐Ÿ” Scan Complete: 2 files gathering dust in Inbox`
- **Auto-archive warnings**: `๐Ÿค– Auto-archived 1 file to Graveyard (old-document.pdf)`
- **Clean state**: `โœจ No files need attention - Inbox is clean!`

### ๐Ÿš€ **Getting Started with Nix**

1. **Add relfa to your flake inputs:**

   ```nix
   inputs.relfa.url = "github:nilp0inter/relfa";
   ```

2. **Import the Home Manager module:**

   ```nix
   imports = [ inputs.relfa.homeManagerModules.relfa ];
   ```

3. **Enable with basic configuration:**

   ```nix
   programs.relfa.enable = true;
   ```

4. **Rebuild your system:**

   ```bash
   home-manager switch  # For home-manager
   # or
   nixos-rebuild switch  # For NixOS
   ```

5. **Check timer status:**
   ```bash
   systemctl --user status relfa.timer
   systemctl --user status relfa.service
   ```

The Nix flake provides a **zero-configuration** setup that works out of the box, with full **declarative control** over all settings and automation!

## ๐Ÿ“ Epitaphs - Digital Memory Keeping

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

### โœ๏ธ **Adding Epitaphs**

```bash
# 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:

```bash
# 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**

```bash
#!/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**

```bash
# 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**

```bash
# 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**

<details>
<summary>๐Ÿ“œ Weekly Cleanup Script</summary>

```bash
#!/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!"
```

</details>

<details>
<summary>๐Ÿ“… Project Archive Script</summary>

```bash
#!/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"
```

</details>

## ๐ŸŽฏ Use Cases

<table>
<tr>
<td width="50%">

### ๐Ÿ‘ฉโ€๐Ÿ’ผ **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

</td>
<td width="50%">

### ๐Ÿ’ป **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

</td>
</tr>
</table>

## ๐Ÿ“š Documentation

- ๐Ÿ“– **[Complete User Guide]https://nilp0inter.github.io/relfa/** - Comprehensive documentation
- ๐Ÿ“ **[Man Page]relfa.1** - Complete command reference (`man relfa`)
- ๐Ÿ—๏ธ **[API Documentation]https://docs.rs/relfa** - For developers and contributors
- ๐Ÿ’ก **[Examples Repository]examples/** - Real-world usage examples and scripts
- โ“ **[FAQ & Troubleshooting]https://github.com/nilp0inter/relfa/wiki** - Common questions and solutions

## ๐Ÿ”ง Development

### ๐Ÿงช **Setup Development Environment**

```bash
# 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**

```bash
# 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]https://github.com/nilp0inter/relfa/issues
- Include your OS, Rust version, and configuration
- Provide steps to reproduce the issue
- Include relevant log output

### โœจ **Submitting Features**

1. Check [existing issues]https://github.com/nilp0inter/relfa/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]https://github.com/sponsors/nilp0inter** to support development
- ๐Ÿ—ฃ๏ธ **Provide feedback** on your user experience

## ๐Ÿ“Š Project Statistics

<div align="center">

![GitHub stars](https://img.shields.io/github/stars/nilp0inter/relfa?style=social)
![GitHub forks](https://img.shields.io/github/forks/nilp0inter/relfa?style=social)
![GitHub watchers](https://img.shields.io/github/watchers/nilp0inter/relfa?style=social)

[![GitHub contributors](https://img.shields.io/github/contributors/nilp0inter/relfa)](https://github.com/nilp0inter/relfa/graphs/contributors)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/nilp0inter/relfa)](https://github.com/nilp0inter/relfa/pulse)
[![GitHub last commit](https://img.shields.io/github/last-commit/nilp0inter/relfa)](https://github.com/nilp0inter/relfa/commits/main)

</div>

## ๐Ÿ“„ License

This project is licensed under the **MIT License** - see the [LICENSE](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

<details>
<summary>๐Ÿ›ฃ๏ธ Future Plans</summary>

### ๐ŸŽฏ **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

</details>

---

<div align="center">

**[โฌ†๏ธ Back to Top](#-relfa---your-gentle-digital-gravedigger)**

---

_"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!_

</div>