| Crates.io | relfa |
| lib.rs | relfa |
| version | 0.4.1 |
| created_at | 2025-08-03 00:26:29.989675+00 |
| updated_at | 2025-08-09 12:30:04.78325+00 |
| description | A gentle digital gravedigger to lovingly archive your old files. |
| homepage | https://github.com/nilp0inter/relfa |
| repository | https://github.com/nilp0inter/relfa |
| max_upload_size | |
| id | 1779247 |
| size | 183,924 |
Relfa scans your inbox for old files, lets you know what's gathering dust, and helps you archive it.
$ relfa scan
🕷️ Scanning Inbox for dusty files...
☠️ 2 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)
🤖 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.
In our daily digital lives, we constantly download, capture, and create small bursts of information — a PDF here, a draft note there, a temporary screenshot, today’s meeting summary. We save them quickly, intending to return later to tidy things up. But “later” rarely comes, and before long our computers fill with forgotten files and disorganized corners of digital clutter.
Relfa is the gentle gravedigger for your digital workspace. When a file begins to gather dust, it doesn't act hastily. First, it offers a quiet reminder—a chance for you to decide if the file's time has come. If it continues to sit untouched, Relfa then performs its final, gentle duty: respectfully moving the file to a well-organized graveyard. This two-step process ensures that archival is an intentional choice, not an accident, keeping your active workspace for the living, not the forgotten.
This tool isn’t about perfection. It’s about being present for what we’ve discarded and giving ourselves another chance to choose what stays.
review command lets you process them one-by-one with options to archive, delete, view, open, or skip.resurrect command brings files back from the graveyard to your inbox.To see which files in your inbox have exceeded the age_threshold_days, run:
relfa scan
This will print a list of "stale" files and another list of files that are old enough to be auto-archived. This command is read-only and will not modify any files.
For a guided, one-by-one review of your stale files, run:
relfa review
For each file, you will be prompted to choose an action:
(a)rchive: Move the file to the graveyard.(n)ote+archive: Archive the file and attach an epitaph (a descriptive note).(t)ouch: Update the file's modification time to keep it for another period.(d)elete: Permanently delete the file (requires confirmation).(v)iew: Preview the file's content using your configured pager.(o)pen: Open the file with its default application.(s)kip: Do nothing and move to the next file.(q)uit: Exit the review session.(?)help: Show a detailed help message with all available actions.The archive command is flexible and has several modes.
To automatically archive all files that have exceeded the auto_archive_threshold_days, simply run archive with no arguments:
# Archives all files older than the "hard limit" threshold.
relfa archive
# You can also add a note to all auto-archived files.
relfa archive --note "Weekly automated cleanup"
# Archive a single, specific item from your inbox.
relfa archive "my-old-document.pdf" --note "Final version, no longer needed."
# Archive all stale files (those older than the "soft limit").
relfa archive --all
To find files you've already archived, use the search command. It searches both filenames and epitaph content.
relfa search "project-alpha"
To bring a file back from the graveyard to your inbox, use resurrect. This copies the file back, leaving the original in the graveyard.
relfa resurrect "important-document.pdf"
If your search term matches multiple files, Relfa will present a list for you to choose from.
The recommended way to use Relfa is declaratively through its Home Manager module, which allows for easy configuration and automated execution. See the Home Manager Configuration section for details.
For quick trials or environments without Home Manager, you can use one of the following nix commands:
Temporary Execution
To run Relfa without installing it, use nix run:
nix run github:nilp0inter/relfa -- [command]
# Example:
nix run github:nilp0inter/relfa -- scan
Persistent Installation
To install Relfa into your user profile, making it available in your shell, run:
nix profile install github:nilp0inter/relfa
If you have the Rust toolchain installed on your system, you can install Relfa directly from crates.io using cargo:
cargo install relfa
This command will download the source code, compile it, and place the relfa binary in your Cargo binary path (~/.cargo/bin/), which should be in your system's PATH.
Pre-compiled binaries are available for Linux and macOS from the releases page.
Supported Platforms:
relfa-VERSION-x86_64-unknown-linux-musl)relfa-VERSION-x86_64-apple-darwin)relfa-VERSION-aarch64-apple-darwin)Installation:
chmod +x relfa-*cp relfa-* ~/.local/bin/relfa (or /usr/local/bin/relfa)If you need binaries for other platforms, please open an issue on GitHub.
Relfa is configured via a TOML file located at ~/.config/relfa/config.toml.
You can generate a configuration file with default values by running:
relfa config
This will create the file if it doesn't exist and print the current settings.
config.toml# Path to the directory you want Relfa to monitor.
inbox = "/home/user/Inbox"
# Path to the directory where archived files will be stored.
graveyard = "/home/user/Graveyard"
# (Soft limit) Files older than this (in days) are considered "stale"
# and will be shown during a `scan` or `review`.
age_threshold_days = 3
# (Hard limit) Files older than this (in days) will be automatically
# archived when you run `relfa archive` without any arguments.
auto_archive_threshold_days = 7
# Minimum number of times a file must be notified to the user
# before it becomes eligible for auto-archiving. Protects against
# auto-archiving on computers that are used sporadically.
auto_archive_min_scans = 24
# How to deliver notifications. Can be "cli" or "desktop".
notification = "desktop"
# The command to use for viewing files with the `review` command.
# Defaults to your $PAGER environment variable, or "less".
pager = "less"
# Configuration for the graveyard's directory structure.
[path_format]
# A template for creating date-based paths.
# Available variables: {hostname}, {year}, {month}, {day}, {month:02}, {day:02}
date_format = "{hostname}/{year}/{month:02}/{day:02}"
# Defines a subdirectory for organizing files by their creation date.
# `type = "original"` means the actual files are stored here.
[path_format.created_subdir]
type = "original"
name = "created"
# Defines a subdirectory for organizing files by their modification date.
# `type = "symlink"` means this directory will contain symbolic links.
# `target = "created"` means the links will point to the files in the "created" subdirectory.
[path_format.modified_subdir]
type = "symlink"
name = "modified"
target = "created"
# Defines a subdirectory for organizing files by their archival date.
# In this example, this view is disabled.
[path_format.archived_subdir]
type = "nothing"
For users of Nix and Home Manager, Relfa provides a module for declarative configuration.
Add the flake to your inputs:
# flake.nix
{
inputs = {
relfa.url = "github:nilp0inter/relfa";
# ... other inputs
};
}
Import the module in your home.nix:
{ inputs, ... }: {
imports = [ inputs.relfa.homeManagerModules.relfa ];
}
Configure Relfa:
The programs.relfa.settings block is required for the program to run. Note that the path_format section and its sub-sections are also mandatory.
# home.nix
programs.relfa = {
enable = true;
settings = {
inbox = "${config.home.homeDirectory}/Downloads";
graveyard = "${config.home.homeDirectory}/Archive";
age_threshold_days = 5;
auto_archive_threshold_days = 14;
auto_archive_min_scans = 24;
notification = "desktop";
# The `path_format` block is required.
path_format = {
date_format = "{hostname}/{year}/{month:02}/{day:02}";
created_subdir = {
type = "original";
name = "created";
};
modified_subdir = {
type = "symlink";
name = "modified";
target = "created";
};
archived_subdir = {
type = "symlink";
name = "archived";
target = "created";
};
};
};
# Optional: Enable a systemd timer for automated execution.
timer = {
enable = true;
# Run `relfa scan` daily.
command = "scan";
frequency = "daily";
# Add a random delay to avoid running at the exact same time as other services.
randomizedDelay = "1h";
};
};
The timer submodule allows you to automate Relfa's execution.
command: Which command to run. Can be "scan", "archive", or "scan-then-archive".frequency: How often to run the command. Accepts systemd.time calendar event formats (e.g., "daily", "hourly", "*:0/30" for every 30 minutes).randomizedDelay: A random delay to add before execution (e.g., "1h", "30m").The official and recommended development setup for Relfa uses Nix and Direnv. While other setups are possible, they are not officially supported and are left to the user's discretion.
Before you begin, ensure you have both Nix and Direnv installed on your system.
Setting up the development environment is a one-step process. Simply navigate to the project's root directory in your terminal and run:
direnv allow
This command will trigger the Nix flake to build the complete development environment. It automatically:
devshell with pre-configured aliases for common tasks (build, test, format, etc.).Once the environment is active, you will have access to a devshell menu with commands for building, testing, and formatting the code.
The installed Git hooks will run automatically on every commit. These hooks check for correct formatting and ensure the project compiles, helping to guarantee that your changes will pass the CI pipeline.
Contributions are welcome, but please follow these guidelines to ensure a smooth process.
git checkout -b fix/some-bug).This project is licensed under the MIT License. See the LICENSE file for details.