✨ A fast and simple CLI tool to clean and rename file names — powered by Go.
nametidy is a fast and flexible command-line tool for cleaning and renaming file names. It supports operations such as filename cleanup, adding sequence numbers, and undoing changes — all with a simple and intuitive interface.
See nametidy in action:
You can use the following scripts to automate the installation of nametidy. These scripts will detect your system’s architecture and download the appropriate binary.
install.sh
)install.sh
in your current directory):
```bash
curl -LO https://raw.githubusercontent.com/mi8bi/nametidy/main/scripts/install.sh
chmod +x install.sh
./install.sh
This script installs nametidy
to /usr/local/bin
. It may require sudo
privileges if your user doesn’t have write access to this directory.
install.cmd
)Download the script:
You can download install.cmd
directly from the repository (e.g., save it to your Downloads
folder):
https://raw.githubusercontent.com/mi8bi/nametidy/main/scripts/install.cmd
(Right-click the link and select “Save link as…” or “Save As…”)
Run the installer:
Open Command Prompt (cmd.exe
). Navigate to the directory where you saved install.cmd
(e.g., Downloads
) and run it:
cd C:\Users\YourUser\Downloads
install.cmd
Or, if install.cmd
is in your current directory:
install.cmd
This script installs nametidy.exe
to %USERPROFILE%\bin
and attempts to add this directory to your User PATH environment variable. PATH changes will apply to new Command Prompt sessions.
install.ps1
)Download the script:
You can download install.ps1
directly from the repository (e.g., save it to your Downloads
folder):
https://raw.githubusercontent.com/mi8bi/nametidy/main/scripts/install.ps1
(Right-click the link and select “Save link as…” or “Save As…”)
Run the installer:
Open PowerShell. Navigate to the directory where you saved install.ps1
(e.g., Downloads
). You may need to adjust your execution policy to run the script.
Example:
cd C:\Users\YourUser\Downloads
# Then run one of the following:
To run the script for the current session without changing global policy:
PowerShell -ExecutionPolicy Bypass -File .\install.ps1
Alternatively, from within that PowerShell prompt:
# Temporarily bypass execution policy for the current process
Set-ExecutionPolicy Bypass -Scope Process -Force
.\install.ps1
This script installs nametidy.exe
to $env:USERPROFILE\bin
and attempts to add this directory to your User PATH environment variable persistently. PATH changes will apply to new PowerShell sessions or after restarting Windows.
You can download prebuilt binaries from the GitHub Releases page:
nametidy_windows_amd64.zip
or nametidy_linux_amd64.tar.gz
)..tar.gz
files on Linux/macOS:
tar -xzvf nametidy_VERSION_OS_ARCH.tar.gz
For .zip
files on Windows, you can use File Explorer’s built-in “Extract All…” option.
nametidy
(or nametidy.exe
on Windows) executable to a directory in your system’s PATH.
/usr/local/bin/
:
sudo mv nametidy /usr/local/bin/
%USERPROFILE%\bin\
and ensure this directory is added to your PATH environment variable.nametidy --help
(or nametidy.exe --help
on Windows) to verify the installation.nametidy is written in Go. To install it locally:
git clone https://github.com/mi8bi/nametidy.git
cd nametidy
go build
Organize and standardize file names in your target directory using intuitive subcommands.
Removes unwanted characters, converts spaces to underscores, and standardizes file names.
nametidy clean -p ./test_dir
Renamed: ./test_dir/file (1).txt → ./test_dir/file_1.txt
Renamed: ./test_dir/hello world.txt → ./test_dir/hello_world.txt
History file path: ./test_dir/.nametidy_history
Restores the most recent file renaming performed by nametidy
nametidy undo -p ./test_dir
Restored: ./test_dir/file_1.txt → ./test_dir/file (1).txt
Restored: ./test_dir/hello_world.txt → ./test_dir/hello world.txt
Displays changes without modifying any files.
nametidy clean -p ./test_dir -d
[DRY-RUN] ./test_dir/file (1).txt → ./test_dir/file_1.txt
[DRY-RUN] ./test_dir/hello world.txt → ./test_dir/hello_world.txt
Enables detailed logs of the renaming process.
nametidy clean -p ./test_dir -v
2025/03/30 17:39:08 [INFO] Starting file name cleanup...
Renamed: ./test_dir/file (1).txt → ./test_dir/file_1.txt
Renamed: ./test_dir/hello world.txt → ./test_dir/hello_world.txt
History file path: ./test_dir/.nametidy_history
2025/03/30 17:39:08 [INFO] File name cleanup completed.
Adds numerical prefixes to file names. Use -n to set digit length, and -H for hierarchical mode.
nametidy number -p ./test_dir -n 3
Renamed: ./test_dir/image.png → ./test_dir/001_image.png
Renamed: ./test_dir/photo.jpg → ./test_dir/002_photo.jpg
nametidy number -p ./test_dir -n 3 -H
Renamed: ./test_dir/folder1/doc.txt → ./test_dir/folder1/001_doc.txt
Renamed: ./test_dir/folder1/note.pdf → ./test_dir/folder1/002_note.pdf
Renamed: ./test_dir/folder2/image.png → ./test_dir/folder2/001_image.png
Option / Command | Description |
---|---|
clean |
Cleans up file names (e.g., removes symbols, replaces spaces). |
number |
Adds sequence numbers to file names. |
undo |
Reverts the most recent operation. |
-p <path> |
(Required) Target directory to process. |
-n <digits> |
Sets the number of digits for sequence numbers (e.g., -n 3 → 001, 002). |
-H |
Enables hierarchical numbering by folder. |
-d |
Dry run mode — preview changes without applying them. |
-v |
Verbose output — shows logs during execution. |
This project is licensed under the MIT License. For more details, see the LICENSE file.