𦑠Ferret
A curious file tracker β Ferret is a lightweight, terminal-based tool that monitors directories for new files and presents them in an interactive, searchable TUI.
Like its namesake, Ferret is small, fast, and excellent at finding things. It maintains a local ledger of all files that appear in your watched directories, making it easy to track downloads, artifacts, and any other files that flow into your system.
β¨ Features
- Real-time file monitoring β Watches directories for new files using native OS APIs (inotify on Linux, FSEvents on macOS)
- Local SQLite ledger β Persistent, searchable history of all detected files
- Interactive TUI β Navigate, filter, and act on files with keyboard shortcuts
- Smart classification β Automatically categorizes files by type (executable, archive, document, media, code, etc.)
- Configurable β TOML configuration with CLI overrides
- Lightweight β Event-driven architecture with minimal CPU usage
π¦ Installation
From crates.io
From Source
# Clone the repository
# Build in release mode
# Install to ~/.cargo/bin
Requirements
- Rust 1.75 or later
- SQLite (bundled with rusqlite)
- Linux, macOS, or Windows
π Quick Start
# Start watching with TUI (uses default config)
# Watch specific directories
# Run headless (no TUI, just logging)
# List recent files
# Show statistics
β¨οΈ TUI Keybindings
| Key | Action |
|---|---|
β/β or j/k |
Navigate list |
PgUp/PgDn |
Scroll by page |
Home/End |
Jump to start/end |
Enter |
View details |
f |
Open filter menu |
/ |
Search by path |
o |
Open file/folder |
t |
Edit tags |
n |
Edit notes |
d |
Delete file (with confirmation) |
r |
Refresh list |
q or Esc |
Quit / Close overlay |
? |
Show help |
βοΈ Configuration
Ferret uses a TOML configuration file located at:
- Linux/macOS:
~/.config/ferret/config.toml - Windows:
%APPDATA%\ferret\config.toml
Example Configuration
# Directories to watch (recursive)
= [
"~/Downloads",
"~/Desktop",
]
# Patterns to ignore (glob syntax)
= [
"**/node_modules/**",
"**/target/**",
"**/.git/**",
"**/.*", # Hidden files
"**/*.tmp",
"**/*.swp",
]
# Minimum file size to log (in bytes)
# Set to 0 to log all files
= 0
# Days to keep events before auto-cleanup
# Set to 0 to disable cleanup
= 90
# Log level: "error", "warn", "info", "debug", "trace"
= "info"
# Database location (default: ~/.local/share/ferret/ledger.db)
# database_path = "~/.local/share/ferret/ledger.db"
π Commands
ferret watch
Start the file watcher with interactive TUI.
)
)
ferret list
Display recent file events in tabular format.
)
)
)
ferret stats
Show statistics about tracked files.
ποΈ Database
Ferret stores its ledger in a SQLite database:
- Linux:
~/.local/share/ferret/ledger.db - macOS:
~/Library/Application Support/ferret/ledger.db - Windows:
%LOCALAPPDATA%\ferret\ledger.db
Schema
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
path TEXT NOT NULL UNIQUE,
dir TEXT NOT NULL,
filename TEXT NOT NULL,
size_bytes INTEGER,
created_at TEXT NOT NULL, -- ISO 8601 timestamp
file_type TEXT NOT NULL,
tags TEXT DEFAULT '', -- Comma-separated
notes TEXT DEFAULT ''
);
π§ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Main Thread β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β Config β β Store β β TUI β β
β β Loader β β (SQLite) β β (Ratatui) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β²
β Channel
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Watcher Thread β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β notify (inotify/FSEvents) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π οΈ Development
# Run in debug mode
# Run tests
# Run with verbose logging
RUST_LOG=debug
# Check formatting
# Run clippy
πΊοΈ Roadmap
- Background daemon mode with systemd/launchd integration
- File deduplication detection (hash-based)
- Export ledger to CSV/JSON
- Desktop notifications for large files
- Network share monitoring
- File preview in detail view
- Batch operations on selected files
π License
This project is dedicated to the public domain under the CC0 1.0 Universal license.
π Acknowledgments
Built with these excellent Rust crates: