[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81853":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":15,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":16,"rankGlobal":10,"rankLanguage":10,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":36,"readmeContent":37,"aiSummary":38,"trendingCount":15,"starSnapshotCount":15,"syncStatus":39,"lastSyncTime":40,"discoverSource":41},81853,"filo","Kanishk2207\u002Ffilo","Kanishk2207","Safe Rust CLI to auto-organize your Downloads and other messy folders.","",null,"Rust",25,5,1,0,42.33,"MIT License",false,"develop",true,[22,23,24,25,26,27,28,29,30,31,32,33,34,35],"automation","cli","command-line-tool","cross-platform","deduplication","desktop-cleaner","file-organizer","file-watcher","filesystem","folders","productivity","rust","sha256","toml","2026-06-12 04:01:35","# filo\n\n[![CI](https:\u002F\u002Fgithub.com\u002FKanishk2207\u002Ffilo\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FKanishk2207\u002Ffilo\u002Factions\u002Fworkflows\u002Fci.yml)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](LICENSE)\n\n> Your Downloads folder cleans itself — safely, predictably, and reversibly.\n\n`filo` is a cross-platform command-line tool that organizes files in folders\nyou care about (Downloads, Desktop, anywhere else) by rules you control.\nIt can run once, or sit in the background and keep things tidy as new files\nland.\n\nIt is built on three promises:\n\n- **Safety.** It never overwrites an existing file. Ever. Collisions are\n  resolved by picking a new, unique name.\n- **Predictability.** The rules live in a plain TOML file you can read and\n  edit. The same input always produces the same output.\n- **Trust.** Every run can be previewed first. `filo preview` shows exactly\n  what would move where, without touching a single byte.\n\n---\n\n## Table of contents\n\n- [Why filo exists](#why-filo-exists)\n- [Installation](#installation)\n- [First-time setup](#first-time-setup)\n- [Commands](#commands)\n- [Config file](#config-file)\n- [TOML option reference](docs\u002Ftoml-config-reference.md)\n- [Safety guarantees](#safety-guarantees)\n- [Preview mode, in detail](#preview-mode-in-detail)\n- [Logging](#logging)\n- [Release plan](#release-plan)\n- [Contributing](#contributing)\n- [Support](SUPPORT.md)\n- [Code of conduct](CODE_OF_CONDUCT.md)\n- [Security policy](SECURITY.md)\n- [License](#license)\n\n---\n\n## Why filo exists\n\nDownload folders rot. They start clean, then fifteen PDFs, eight installer\ndisk images, a dozen random screenshots, and three copies of `Report_FINAL_FINAL.pdf`\nlater they're impossible to navigate. Manual cleanup is a chore nobody does.\n\n`filo` is a small, boring, reliable tool that does the chore for you.\n\nIt is deliberately not clever. It does not look inside files, call machine\nlearning models, or invent names. It routes by keyword\u002Fextension, dedupes by\nSHA-256, and moves things into subfolders. That's the whole product — and\nthat's the point.\n\n---\n\n## Installation\n\n### From crates.io (recommended)\n\n```bash\ncargo install filo-rs\n```\n\nThe package name is `filo-rs`, and the installed command is still `filo`.\n\n### From source\n\nRequires Rust `1.85` or newer.\nIf you don't have Rust installed yet, follow the official steps:\n[Install Rust](https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall).\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FKanishk2207\u002Ffilo\ncd filo\ncargo install --path .\n```\n\nThe `filo` binary is installed to `~\u002F.cargo\u002Fbin\u002Ffilo` (Unix) or\n`%USERPROFILE%\\.cargo\\bin\\filo.exe` (Windows). Make sure that path is on\nyour `PATH`.\n\n### Verify\n\n```bash\nfilo --version\nfilo --help\n```\n\n---\n\n## First-time setup\n\nRun:\n\n```bash\nfilo init\n```\n\n`init` walks you through an interactive wizard:\n\n1. **Which folders should filo watch?** You'll see suggestions (Downloads,\n   Desktop, Documents) detected from your platform, and can add custom paths.\n2. **Enable smart renaming?** Default: off. When enabled, filenames are\n   lowercased, hyphenated, and stripped of adjacent repeated words\n   (`Report_FINAL_FINAL.pdf` → `report-final.pdf`). You can also prepend a\n   `YYYY-MM-DD` date.\n3. **Duplicate handling.** `skip` (leave the duplicate where it is, log it)\n   or `move` (relocate it to a `Duplicates` subfolder next to the category).\n4. **Start watching now?** If yes, `filo` jumps straight into `start` mode\n   when setup ends.\n\nThe wizard writes `config.toml` to the platform config directory\n(see [Config file](#config-file)). You can re-run `filo init` any time to\nrebuild the config; existing configs are never silently overwritten.\n\n---\n\n## Commands\n\n| Command                     | What it does                                                         |\n|-----------------------------|----------------------------------------------------------------------|\n| `filo init`                 | Interactive first-time setup. Writes `config.toml`.                  |\n| `filo start`                | Scan existing files, then start the background watcher daemon.       |\n| `filo stop`                 | Stop the background watcher daemon.                                  |\n| `filo refresh`              | Hot-reload config without restarting the daemon.                     |\n| `filo scan`                 | Organize files already sitting in your configured watch folders.     |\n| `filo preview`              | Dry run: print every move filo _would_ make. No changes on disk.    |\n| `filo arrange`              | Manual, targeted move: pick files by keyword\u002Fextension and move them.|\n| `filo watch add \u003Cpath>...`  | Add folder(s) to the watch list.                                     |\n| `filo watch remove \u003Cpath>...` | Remove folder(s) from the watch list.                             |\n| `filo watch list`           | Show currently watched folders.                                      |\n| `filo autostart enable`     | Install filo as an OS login service.                                 |\n| `filo autostart disable`    | Remove the OS login service.                                         |\n| `filo autostart status`     | Check if autostart is enabled.                                       |\n\nMost commands accept `--rename` to enable smart renaming for that run only,\nindependently of the config.\n\n### Daemon lifecycle\n\n`filo start` runs an initial scan of existing files, then spawns a background\ndaemon that watches your configured folders in real time. The daemon survives\nclosing the terminal.\n\n```bash\nfilo start                 # scan + start daemon\nfilo start --no-scan       # skip the initial scan\nfilo start --foreground    # run in the current terminal (for debugging or service managers)\nfilo stop                  # stop the daemon\nfilo refresh               # hot-reload config without restarting\n```\n\n`filo refresh` is zero-downtime: the daemon re-reads `config.toml`, tears\ndown old watches, and sets up new ones without restarting the process. There\nis no gap in monitoring.\n\n### Managing watch folders\n\nYou don't need to edit `config.toml` by hand to add or remove folders:\n\n```bash\nfilo watch add ~\u002FDownloads ~\u002FDesktop\nfilo watch remove ~\u002FDesktop\nfilo watch list\n```\n\nIf the daemon is running, changes take effect immediately (an automatic\n`filo refresh` is triggered).\n\n### Autostart on login\n\nInstall filo as a login service so it starts automatically when you log in:\n\n```bash\nfilo autostart enable      # macOS: launchd | Linux: systemd | Windows: registry\nfilo autostart disable\nfilo autostart status\n```\n\n### Examples\n\nPreview what would happen if you cleaned up your Downloads folder right now:\n\n```bash\nfilo preview\n```\n\nApply the plan for real:\n\n```bash\nfilo scan\n```\n\nRun with smart renaming turned on, ignoring whatever's in the config:\n\n```bash\nfilo scan --rename\n```\n\nStart the background watcher:\n\n```bash\nfilo start\n```\n\nManually collect every `.pdf` in Downloads and Desktop containing the word\n\"invoice\" into `~\u002FFinance\u002F2025`:\n\n```bash\nfilo arrange \\\n  --source ~\u002FDownloads --source ~\u002FDesktop \\\n  --destination ~\u002FFinance\u002F2025 \\\n  --keyword invoice \\\n  --extension pdf\n```\n\nSame, but skip the confirmation prompt:\n\n```bash\nfilo arrange -s ~\u002FDownloads -d ~\u002FFinance\u002F2025 -k invoice -e pdf -y\n```\n\n---\n\n## Config file\n\nfilo uses platform-appropriate paths (via the [`dirs`](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fdirs)\ncrate). It never hardcodes `\u002Fhome\u002F...` or `C:\\Users\\...`.\n\n| OS               | Config                                     | Log                                        |\n|------------------|--------------------------------------------|--------------------------------------------|\n| Linux            | `~\u002F.config\u002Ffilo\u002Fconfig.toml`               | `~\u002F.local\u002Fshare\u002Ffilo\u002Ffilo.log`             |\n| macOS            | `~\u002FLibrary\u002FApplication Support\u002Ffilo\u002Fconfig.toml` | `~\u002FLibrary\u002FApplication Support\u002Ffilo\u002Ffilo.log` |\n| Windows          | `%APPDATA%\\filo\\config.toml`               | `%APPDATA%\\filo\\filo.log`                  |\n\nThe file is human-readable TOML. Edit it freely — filo will pick up your\nchanges on the next run.\n\nFor a complete, field-by-field reference of every supported TOML option,\nsee [docs\u002Ftoml-config-reference.md](docs\u002Ftoml-config-reference.md).\n\n### Annotated example\n\n```toml\n# Category used when no rule matches the file's extension.\nother_category = \"Other\"\n\n[watch]\n# Folders filo watches and scans. Must be absolute paths.\nfolders = [\n  \"\u002Fhome\u002Fyou\u002FDownloads\",\n  \"\u002Fhome\u002Fyou\u002FDesktop\",\n]\n# If true, `filo init` launches `filo start` automatically after setup.\nauto_start = false\n# How long (milliseconds) a file must sit idle before filo acts on it.\n# Protects against operating on files that are still downloading.\ndebounce_ms = 2000\n\n[rename]\n# Master switch for smart renaming. When false, filenames are preserved.\nenabled = false\n# \"My  Cool File.pdf\" -> \"my-cool-file.pdf\"\nlowercase_with_hyphens = true\n# \"Report_FINAL_FINAL.pdf\" -> \"report-final.pdf\" (collapses adjacent repeats)\nstrip_redundant_words = true\n# \"report.pdf\" -> \"2026-05-02-report.pdf\"\nprepend_date = false\n\n[duplicates]\n# \"skip\": leave the duplicate in place and log it.\n# \"move\": relocate it into a `Duplicates` subfolder beside the category.\naction = \"skip\"\nfolder_name = \"Duplicates\"\n\n# Optional ordered keyword routing in one block (first match wins):\n[keyword_rules]\nrules = [\n  { to = \"Amazon\", keywords = [\"amazon\"] },\n  { to = \"Documents\", keywords = [\"invoice\", \"receipt\", \"statement\"] },\n]\n\n[rules]\n# Category -> list of extensions (no leading dot). Case-insensitive.\n# Add\u002Fremove freely. Unknown extensions fall through to `other_category`.\n# Used only when no keyword rule matched.\nArchives  = [\"zip\", \"tar\", \"gz\", \"bz2\", \"xz\", \"rar\", \"7z\", \"tgz\"]\nAudio     = [\"mp3\", \"flac\", \"wav\", \"ogg\", \"m4a\", \"aac\", \"opus\"]\nCode      = [\"rs\", \"py\", \"js\", \"ts\", \"go\", \"c\", \"cpp\", \"h\", \"java\", \"rb\", \"sh\"]\nDocuments = [\"pdf\", \"doc\", \"docx\", \"odt\", \"rtf\", \"txt\", \"md\", \"epub\"]\nImages    = [\"jpg\", \"jpeg\", \"png\", \"gif\", \"webp\", \"svg\", \"bmp\", \"tiff\", \"heic\", \"avif\"]\nVideos    = [\"mp4\", \"mkv\", \"mov\", \"avi\", \"webm\", \"flv\", \"wmv\", \"m4v\"]\n```\n\n---\n\n## Safety guarantees\n\nThese are non-negotiable invariants of the tool:\n\n1. **Never overwrite.** Before any move, the destination is checked. If a\n   file with the target name exists, filo picks a new unique name in this\n   strict priority order:\n   1. Original name.\n   2. Append current date: `name-2026-05-02.ext`.\n   3. Append numeric suffix: `name-2026-05-02-1.ext`, `-2`, ... `-999`.\n   4. Append a short hash of the name plus the current timestamp.\n2. **Never delete.** filo moves files. It does not delete them — not even\n   duplicates. Duplicates are either left alone or relocated to a dedicated\n   folder, per your config.\n3. **Never act on in-progress writes.** Files are ignored if they end in\n   `.part`, `.crdownload`, `.download`, `.tmp`, or `.partial`. Watch events\n   are debounced, and a second-stage size-stability check catches anything\n   still in motion.\n4. **Never touch hidden files.** Anything starting with `.` (e.g.\n   `.DS_Store`, `.gitignore`) is left alone.\n5. **Graceful failures.** Permission errors, missing files, and other I\u002FO\n   failures are logged and skipped. One bad file never aborts a scan.\n6. **Deterministic.** Duplicate detection is SHA-256. Same input bytes →\n   same result. No fuzzy matching, no heuristics.\n\n---\n\n## Preview mode, in detail\n\n`filo preview` runs the exact same planning pipeline as `filo scan`, but\nstops right before any file is touched. The output looks like:\n\n```\n== \u002FUsers\u002Fyou\u002FDownloads ==\n  move    \u002FUsers\u002Fyou\u002FDownloads\u002Finvoice.pdf  ->  \u002FUsers\u002Fyou\u002FDownloads\u002FDocuments\u002Finvoice.pdf\n  move    \u002FUsers\u002Fyou\u002FDownloads\u002Fcat.jpg      ->  \u002FUsers\u002Fyou\u002FDownloads\u002FImages\u002Fcat.jpg\n  skip    \u002FUsers\u002Fyou\u002FDownloads\u002Fcat-copy.jpg (duplicate of \u002FUsers\u002Fyou\u002FDownloads\u002FImages\u002Fcat.jpg)\n  dup ->  \u002FUsers\u002Fyou\u002FDownloads\u002Fold.pdf      ->  \u002FUsers\u002Fyou\u002FDownloads\u002FDocuments\u002FDuplicates\u002Fold.pdf (duplicate of ...)\n\nPreview summary (4 files examined):\n  would move:               2\n  would skip (duplicate):   1\n  would move to Duplicates: 1\n\nNo changes were made. Run `filo scan` to apply.\n```\n\nBecause the planner is pure, you can:\n\n- Preview → read the plan → edit `config.toml` → preview again, risk-free.\n- Diff two configs by diffing their previews.\n\n---\n\n## Logging\n\nfilo writes to both stderr and an append-only log file.\n\n- **Level** defaults to `info`. Override with the standard env var:\n\n  ```bash\n  RUST_LOG=debug filo scan\n  ```\n\n- **Log file location** is listed in the [config file table](#config-file).\n  Every line is timestamped with millisecond precision.\n- Logging failures never affect command execution — if the log file can't\n  be written, filo still does the right thing on disk.\n\n---\n\n## Release plan\n\n### Next release\n\n1. **Undo last action**\n   Add a command to roll back the most recent organize\u002Farrange action safely.\n2. **Configurable scan depth**\n   Add depth controls so scans can include child\u002Fnested folders, either via\n   config or runtime prompts\u002Fflags.\n3. **Path-first command usage**\n   Allow running filo directly on paths without changing directories first\n   (for example: `filo \u003Cpath> \u003Coptions>`).\n4. **Keyword match mode in `arrange`**\n   Add a match mode option so multiple keywords can be evaluated as OR or AND.\n\n### Next-to-next release\n\n1. **Undo\u002Fredo**\n   Extend rollback support to full undo\u002Fredo flows.\n2. **Undo\u002Fredo tree**\n   Represent operation history as a navigable tree (not just a linear stack).\n3. **Undo\u002Fredo tree visualization**\n   Add a visual history view for that tree, inspired by Emacs-style workflows.\n\n---\n\n## Contributing\n\nStart with [`CONTRIBUTING.md`](CONTRIBUTING.md) for contribution workflow, PR checklist, and reporting guidance.\n\nBranch strategy:\n\n- Open feature PRs into `develop`.\n- Treat `develop` as beta\u002Fintegration.\n- Promote to `main` only after beta validation passes.\n- Tag `develop` commits for prereleases (for example `v0.2.0-beta.1`) and `main` commits for stable releases (for example `v0.2.0`).\n\nfilo is structured as a library (`filo` in `src\u002Flib.rs`) plus a thin binary\n(`src\u002Fmain.rs`). The binary only parses arguments and dispatches; all\nbehavior lives in the library, which makes it straightforward to:\n\n- add a new command (drop a file in `src\u002Fcommands\u002F`);\n- add a new category (edit `src\u002Fconfig\u002Fdefaults.rs` or just edit your own\n  `config.toml`);\n- add a new duplicate policy (extend `DuplicateAction` in `src\u002Fconfig\u002Fmod.rs`\n  and handle it in `src\u002Forganizer\u002Fmod.rs::resolve_duplicate`).\n\nLayout:\n\n```\nsrc\u002F\n  main.rs          # binary entry point — parse CLI, dispatch\n  lib.rs           # library root — public API\n  cli.rs           # clap definitions (no logic)\n  daemon.rs        # PID file, spawn, kill, reload signal\n  errors.rs        # thiserror types per domain\n  logging.rs       # env_logger + file output\n  commands\u002F        # one module per `filo \u003Cverb>`\n    init.rs\n    start.rs       # scan-then-daemon flow\n    stop.rs\n    refresh.rs\n    scan.rs\n    preview.rs\n    arrange.rs\n    watch_cmd.rs   # add\u002Fremove\u002Flist watch folders\n    autostart.rs   # OS-specific login service (launchd\u002Fsystemd\u002Fregistry)\n  config\u002F          # on-disk config schema + defaults\n    mod.rs\n    defaults.rs\n  organizer\u002F       # the engine\n    mod.rs         # plan() + execute()\n    rules.rs       # extension -> category\n    mover.rs       # safe_move + unique_destination\n    renamer.rs     # smart rename pipeline\n    duplicates.rs  # size + SHA-256 duplicate check\n  watcher\u002F\n    mod.rs         # debounced notify-based watcher with hot-reload\ntests\u002F\n  integration.rs   # end-to-end pipeline tests\n```\n\nBefore sending a PR:\n\n```bash\ncargo test\ncargo clippy --all-targets -- -D warnings\ncargo fmt --check\n```\n\nBy participating, you agree to follow [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).\n\n---\n\n## License\n\nLicensed under either of:\n\n- MIT license ([LICENSE](LICENSE))\n- Apache License, Version 2.0 ([Apache-2.0](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0))\n","filo 是一个用 Rust 编写的跨平台命令行工具，旨在自动整理您的下载文件夹及其他杂乱的文件夹。其核心功能包括根据用户自定义规则（通过易读易编辑的 TOML 文件配置）对文件进行分类和去重处理，支持一次性执行或后台持续监控新文件并保持整洁。该工具特别强调安全性、可预测性和可信度：不会覆盖现有文件，确保每次操作结果一致，并提供预览模式以供确认实际移动情况。适用于需要自动化管理个人电脑上文件组织与清理的场景，尤其适合经常下载大量文件且希望保持文件系统有序的用户。",2,"2026-06-11 04:06:57","CREATED_QUERY"]