Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raphico/rename-cli

Bulk file rename
https://github.com/raphico/rename-cli

cli-app esmodules js nodejs

Last synced: 8 days ago
JSON representation

Bulk file rename

Awesome Lists containing this project

README

        

# Bulk File rename

A command-line tool for bulk renaming files based on patterns, dates, and file type

## Features

- **Pattern-Based Renaming:** Rename files by specifying search and replacement patterns.
- **Date-Based Renaming:** Rename files using their creation dates.
- **File-type-Based Renaming:** Rename only files with specified file type
- **Undo Functionality:** Easily revert the last renaming operation.
- **Dry Run Mode:** Preview changes before applying them.

## Installation

1. Clone repository

```bash
git clone [email protected]:Raphico/rename-cli.git
cd rename-cli
```

2. Install dependencies

```bash
npm install
```

3. Create symlink

```bash
npm link
```

## Usage

```bash
bfr --help
```

## Command

| Command | Description | Example |
| ----------------------------- | ------------------------------------------------------ | --------------------------------------------------- |
| `rename` | Rename files in a specified directory. | `bfr rename --pattern "IMG_" --replace "Vacation_"` |
| `undo` | Revert the last rename operation. | `bfr undo` |
| `-p, --pattern ` | Search pattern to match in filenames for renaming. | `--pattern "IMG_"` |
| `-r, --replace ` | String to replace the search pattern with. | `--replace "Vacation_"` |
| `--date-created` | Rename files based on their creation date. | `--date-created` |
| `--date-format ` | Specify the date format (e.g., "YYYY-MM-DD"). | `--date-format "YYYY-MM-DD"` |
| `-s, --sequence` | Add sequential numbers to renamed files. | `--sequence` |
| `-d, --directory ` | Directory containing files to rename. | `--directory "/path/to/photos"` |
| `-f, --file-type ` | Limit renaming to a specific file type (e.g., ".jpg"). | `--file-type ".jpg"` |
| `--dry-run` | Preview renaming changes without applying them. | `--dry-run` |