Skip to main content

mvi: move interactively

Organising files via the command line can be cumbersome, for many reasons. Editing capabilities on the command line are limited. Characters from foreign character sets cannot be inserted. Arguments may require quoting or escaping. Names may be mistaken for flags.

Mvi aims to simplify bulk renames of files and directories by opening the directory listing in a text editor, thus providing a powerful interface for editing destination paths. Names are changed by editing lines in place. Upon exit mvi will show a list of scheduled rename operations and ask for confirmation before committing the changes to disk.

A lot of care is taken to make sure that mvi does not bail out halfway through an operation. File targets are checked for availability before starting a commit - mvi will never overwrite a file. In case of an unexpected IO error mvi will return to the editor for manual resolution, from where it can pick up with the remaining move operations.

examples

The equivalence of mv bar baz in mvi involves an edit of the first line "bar" into "baz" (not shown, but listed by mvi in summary):

$ ls
bar foo

$ mvi
Line 1: bar -> baz
Proceed: continue/edit/abort c
Moved bar -> baz
Done.

$ ls
baz foo

Swapping lines results in swapping files:

$ ls
bar foo

$ mvi
Line 1: bar -> foo
Line 2: foo -> bar
Proceed: continue/edit/abort c
Moved bar -> bar_
Moved foo -> bar
Moved bar_ -> foo
Done.

$ ls
bar foo

Items can be organized in subdirectories by simply editing a (relative or absolute) destination path including directory separators.

$ ls
bar foo

$ mvi
Line 1: bar -> sub/bar
Line 2: foo -> sub/foo
Proceed: continue/edit/abort c
Moved bar -> sub/bar
Moved foo -> sub/foo
Done.

$ ls
sub/

installation

Mvi is available on pypi for installation via pip:

$ pip3 install mvi

Note that in externally managed environments (i.e. having Python packages installed via apt or similar) you may need to add --break-system-packages to step over pip's guard rails. Alternatively you can use pipx to install mvi in an isolated environment:

$ pipx install mvi

see also

The rename command that is available in most distributions allows for bulk move operations based on regular expressions.

Release files for mvi 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mvi 2.0
File Size Uploaded
mvi-2.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mvi 2.0
File Interpreter ABI Platform
mvi-2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / mvi-2.0.tar.gz

Download URL mvi-2.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
072f42bfc8575c7cc4e59d89790c69de1aa63a43d502cf17a5d66bcd7bd09bd9
BLAKE2b-256 checksum
How to use checksums
5125c754ef1262a5d21afc9ce8b62051e580a43c1c5b7b35d1cdde2384403284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.2

Release files / mvi-2.0-py3-none-any.whl

Download URL mvi-2.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2483334b41afc05cec45ac98a2dda6c26584b46dd60ef91343813f8e94fc2f78
BLAKE2b-256 checksum
How to use checksums
68925315c92fd9d743487dce5d50cf7374df9250fa38ff3efafac4b1e9391d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.2

Release history Release notifications | RSS feed

This release

2.0 This release

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page