Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MotherStarry/kti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kti

A simple CLI tool to correct file extensions to match their file signatures.

What kti does:

kti scans recursively through directories and finds files that have file extensions that do not match their file signature.

Kti fully supports the following file extensions:

  • flac
  • gif
  • jpg
  • mkv
  • mp3
  • ogg
  • pdf
  • png
  • wav
  • webp

These 3 may not be always recognized:

  • mp4
  • opus (falls back to ogg)
  • webm (falls back to mkv)

How to install kti:

You first need a working installation of the Rust compiler. Simply visit rustup and follow the steps for the operating system you are using. After you are done and have a working version of rust, you can run this command:

cargo install --git https://github.com/MotherStarry/kti

Do make sure to add .cargo/bin to your path.

Usage:

I strongly recommend you first read through the couple options kti has available, to do so just type kti -h or kti --help in your terminal.

You can generate completions for your shell by using the --generate-completions option and adding the shell you wish to generate completions for piped to the path used by your shell for completions. Fish shell for example:

kti --generate-completions fish > ~/.config/fish/completions/kti.fish

Important: By default kti will change all file extensions for the files that do not match with what kti has found. I advise you first run kti with the --dry-run option and verifying the changes kti plans to make before running kti without it. Example:

kti -d --dry-run

This command will show you what files kti would change.

If you only want to use kti on a single file you can do so with:

kti your_file.png

if you just want to recursively correct all files in the directory you are in its as simple as:

kti

running this will not add any color to the output and will print out all files whether they have different extensions or not and it will also skip hidden files.

if you wish to silence kti you can add the -s option like here:

kti -s

I suggest using kti with the -d option and -c for prettier and likely more readable output or if you wish to limit your search depth you can use the -m option.

About

A simple CLI tool to correct file extensions to match their file signatures.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages