/fs-indexer

CLI to index part of a file system

Primary LanguageTypeScriptMIT LicenseMIT

fs-indexer

oclif Version Downloads/week License

Installation

For the hashing function, you need to install b3sum and xxh128sum. In order to extract exif information from images and videos, you need to install exiftool.

On a Mac, this can be achieved with brew install b3sum xxhash exiftool.

Usage

$ npm install -g fs-indexer
$ fs-indexer COMMAND
running command...
$ fs-indexer (--version)
fs-indexer/0.0.7 darwin-arm64 node-v22.0.0
$ fs-indexer --help [COMMAND]
USAGE
  $ fs-indexer COMMAND
...

Commands

fs-indexer crawl PATH

index the folder provided

USAGE
  $ fs-indexer crawl PATH [-d <value>] [-a BLAKE3|XXHASH] [--exif] [-l <value>] [-m <value>] [--debug]

FLAGS
  -a, --hashingAlgorithms=<option>...  hashing algorithms to use
                                       <options: BLAKE3|XXHASH>
  -d, --database=<value>               [default: fs-index.db] database file
  -l, --limit=<value>                  stop after indexing n files
  -m, --minutes=<value>                stop after n minutes
      --debug                          enable debug logging
      --exif                           extract exif data

DESCRIPTION
  index the folder provided

See code: src/commands/crawl.ts

fs-indexer help [COMMAND]

Display help for fs-indexer.

USAGE
  $ fs-indexer help [COMMAND...] [-n]

ARGUMENTS
  COMMAND...  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for fs-indexer.

See code: @oclif/plugin-help

fs-indexer info

prints information about the database

USAGE
  $ fs-indexer info [-d <value>] [--duplicates] [--debug]

FLAGS
  -d, --database=<value>  [default: fs-index.db] database file
      --debug             enable debug logging
  --duplicates

DESCRIPTION
  prints information about the database

See code: src/commands/info.ts

fs-indexer lookup PATH

searches for files within the database

USAGE
  $ fs-indexer lookup PATH [-d <value>] [--debug] [--remove] [--exif]

FLAGS
  -d, --database=<value>  [default: fs-index.db] database file
      --debug             enable debug logging
      --exif              look for files with similar exif date
      --remove            remove files if similar found in the index. Be careful with this flag. Only hashes are
                          compared, not the files content.

DESCRIPTION
  searches for files within the database

See code: src/commands/lookup.ts

fs-indexer verify PATH

verifies that the content of the database is in sync with the file system

USAGE
  $ fs-indexer verify PATH [-d <value>] [-a BLAKE3|XXHASH] [-l <value>] [-m <value>] [-p] [--debug]

FLAGS
  -a, --hashingAlgorithms=<option>...  hashing algorithms to use
                                       <options: BLAKE3|XXHASH>
  -d, --database=<value>               [default: fs-index.db] database file
  -l, --limit=<value>                  stop after indexing n files
  -m, --minutes=<value>                stop after n minutes
  -p, --purge                          deletes files that do not exist anymore from the database
      --debug                          enable debug logging

DESCRIPTION
  verifies that the content of the database is in sync with the file system

See code: src/commands/verify.ts