Skip to content
An interactive file mover inspired by git
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
src
tests
.editorconfig
.eslintrc
.gitignore
.npmrc
CHANGELOG.md
LICENSE
README.md
package-lock.json
package.json
tsconfig.json

README.md

imv (Interactive Move)

Actions Status

An interactive file renamer/mover inspired by git

Install

npm install -g imv

Usage

  1. You give imv a glob pattern of files you want to move or rename.
imv --cleanup './home/*.png'
  1. It opens the list in your favorite code editor (either by the --editor param or automatically via your git config).
./home/customer.png
./home/puppy.png
./home/cat.png
  1. You make the edits you want, with the tools you already use like multiple cursors and regex.
./home-page/user.png
./home-page/puppy.png
./home-page/cat.png
  1. Save the file and close it …sounds familiar to git commit/rebase?
  2. imv will make the changes, the file on each line becomes the new file location.
  3. imv deletes the old /home directory because we specified --cleanup and all the files have moved.
  4. You're done!
Usage: imv [options] <glob>

imv -- interactive move files

Options:
  -v, --version          output the version number
  -e, --editor <editor>  use this editor to modify your file paths
  -i, --ignore <glob>    ignore files that match this glob pattern
  -g, --gitignore        ignore files that match patterns in .gitignore
  -o, --overwrite        overwrite existing files
  -t, --trash            send existing files to the trash bin
  -c, --cleanup          remove empty affected folders after moving files
  -h, --help             output usage information

Limitations

To keep things simple, there are a few limitations:

  • It only moves files from the directory and any subdirectories where the imv command was made.
  • It cannot overwrite files that are also matched by the input glob pattern.
  • It cannot swap two file paths.

Development

You can install imv locally to develop on:

npm install
npm run dist
npm link

You can now use the imv command from your terminal. npm start will build in watch mode so you can make edits as you use the tool.

imv uses TypeScript for type safety, ESLint for linting, and Jest for testing.

You can’t perform that action at this time.