Skip to content

lateshift/thefck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thefck

Ladies and gentlemen, may I present thefck: a simple tool for finding duplicate files and browsing the indexed results through an embedded Vue 3 app.

A single binary containing all the fun you can think of. And since it’s written in Go, it might even compile and run on your system.

What?

thefck indexes files in a directory tree, stores file metadata in a bbolt database, flags duplicate content, and serves a bundled Vue 3 SPA for browsing the index.

Why?

Because most duplicate-file finders are a giant clusterfuck: gazillions of esoteric options, wrapped in build requirements that make your package manager weep.

Required & mildly funny AI-generated image

yomama

Let’s drop some rhymes.

Yo, I crawl the tree, I hash the block,
I find the dupe and I make it talk.
bbolt in the back, Vue in the front,
one binary doing the whole damn stunt.

Mic drop.

What Gets Indexed

Each indexed file stores:

  • File date
  • File size
  • Absolute path
  • Filename
  • Checksum
  • Duplicate status

Checksums use github.com/cespare/xxhash/v2. The index is stored in bbolt.

Requirements

  • Go 1.25 or newer
  • Node.js and npm, only when rebuilding the SPA

Scan Files

Scan the current directory:

go run ./src

Scan a specific directory:

go run ./src /path/to/files

Use a custom database:

go run ./src --db /path/to/checksums.db /path/to/files

Report new, changed, and missing files while scanning:

go run ./src --report-changes /path/to/files

Duplicate reporting is enabled by default. Disable it with:

go run ./src --report-duplicates=false /path/to/files

Serve The SPA

Start the bundled web UI:

go run ./src serve --db checksums.db --addr 127.0.0.1:8080

Then open:

http://127.0.0.1:8080

The API is available at:

http://127.0.0.1:8080/api/files

The SPA table is searchable and sortable. It starts filtered to duplicate files, shows the active filters above the table, and paginates at 200 files per page.

Build A Binary

Build the command-line app:

go build -o thefck ./src

Run it:

./thefck --report-changes /path/to/files
./thefck serve --db checksums.db --addr 127.0.0.1:8080

Rebuild The SPA

The SPA source lives in js/. It builds into src/web/dist/, which is embedded into the Go binary.

Install dependencies:

cd js
npm install

Build the SPA:

npm run build

Then rebuild the Go binary:

cd ..
go build -o thefck ./src

Notes

  • js/node_modules/ is ignored.
  • js/package-lock.json is intentionally kept for reproducible frontend installs.
  • Generated SPA assets in src/web/dist/ are part of the Go embed flow.
  • The database file is skipped during scans when it lives inside the scanned directory.

About

The file indexer your neighbors warned you about. 🪩🔥💀

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors