mvx 0.2.8

Enhanced file and directory move utility with progress bars and cross-device support
Documentation

mvx / cpx

Enhanced mv and cp commands with directory merging and progress bars.

Installation

cargo install --path .

This installs both mvx (move) and cpx (copy) binaries.

Usage

mvx [OPTIONS] <SOURCES>... <DEST>
cpx [OPTIONS] <SOURCES>... <DEST>

Options

Option Description
-f, --force Overwrite existing files
-n, --dry-run Show what would be done without actually doing it
-q, --quiet Suppress progress bars and info messages
-v, --verbose Show detailed output
-h, --help Print help
-V, --version Print version

Behavior Matrix

Key differences from mv/cp: directories are merged (not nested), destination directories are created automatically, and existing files are never overwritten unless -f is specified.

Single source

Source Dest is file Dest is directory Dest doesn't exist Dest doesn't exist (trailing /)
File Overwrites (-f) Moves/copies into dir Creates file Creates dir, moves/copies into it
Dir Error Merges contents Creates dir, merges Creates dir, merges

Multiple sources

All sources must be the same kind (all files or all directories).

Sources Dest is file Dest is directory Dest doesn't exist Dest doesn't exist (trailing /)
Files Error Moves/copies each into dir Error Creates dir, moves/copies each into dir
Dirs Error Merges each into dir Creates dir, merges each Creates dir, merges each
Mixed Error Error Error Error

Features

Progress Bars

Cross-device operations display progress bars with transfer speed and ETA:

   1.2 GiB [========>-------------------------------]  312 MiB (  45.2 MiB/s, ETA: 00:00:21 ) file.iso -> /mnt/backup/file.iso

Use -q to suppress progress output.

Fast Path Optimization

Same-device moves use rename (instant). Same-filesystem copies use reflink (copy-on-write clone on APFS/Btrfs). The buffered copy fallback with progress bars only kicks in when these fast paths aren't available.

Ctrl+C Handling

Press Ctrl+C once to finish the current file and stop. Press again to force exit immediately.

Examples

# Move a single file
mvx file.txt /backup/

# Copy multiple files to a directory
cpx file1.txt file2.txt /dest/

# Merge directories (preserve existing, fail on conflicts)
mvx source_dir/ dest_dir/

# Merge directories (overwrite conflicts)
mvx -f source_dir/ dest_dir/

# Copy with progress bar suppressed
cpx -q large_file.iso /mnt/usb/

License

MIT License