# NBIR — Numeric Bulk File Renamer
Rename files in a directory to a sequential numbered scheme (e.g. `base01.jpg`, `base02.pdf`). **Supports all file types.** You can select by extension (all `.jpg`, `.pdf`, etc.), by specific filenames, or both—e.g. all images plus one or two PDFs.
## Installation
From [crates.io](https://crates.io):
```bash
cargo install nbir
```
From source:
```bash
git clone https://github.com/yourusername/simplebulkfilerenamer
cd simplebulkfilerenamer
cargo install --path .
```
## Usage
**List only (no renaming):** See what’s in a directory, grouped by extension:
```bash
nbir --list
nbir -l -d /path/to/folder
```
**Interactive mode (no args):** Run `nbir` with no options. It will ask:
1. “Do you want to run it in the current directory? (y/n)”
2. Show files by extension, then: “Extensions to include (comma-separated, or 'all'/'whole' for whole directory)”
3. “Specific files to add (comma-separated, or leave empty)” — **skipped** if you chose whole directory in step 2
4. “Enter base name (e.g., spacewallpaper)”
5. Preview and “Proceed with renaming? (y/n)”
For **whole directory** in step 2, answer `all`, `whole`, `whole dir`, or `entire` (case-insensitive). You then skip the “Specific files” prompt and go straight to base name.
**CLI mode:** Use `-b` for base name and `-e` / `-f` / `--all` to choose which files to rename:
```bash
nbir [OPTIONS] [--base-name <NAME>]
```
### Options
| `-b` | `--base-name` | — | Base name for renamed files. If omitted, prompts interactively. |
| `-d` | `--directory` | `.` | Directory to work in |
| `-l` | `--list` | — | List files grouped by extension, then exit |
| — | `--all` | — | Include all files (ignores `-e` and `-f`) |
| `-e` | `--ext` | — | Include all files with these extensions (e.g. `-e jpg,png` or `-e jpg -e pdf`). Case-insensitive. |
| `-f` | `--files` | — | Include these specific filenames (e.g. `-f doc.pdf -f readme.txt`) |
| `-y` | `--yes` | `false` | Skip confirmation; rename immediately |
If you pass `-b` but neither `-e`, `-f`, nor `--all`, **all files** in the directory are selected.
### Examples
List what’s in the current directory:
```bash
nbir -l
```
All files of certain extensions:
```bash
nbir -b docs -e pdf,docx
nbir -b imgs -e jpg -e png -e gif
```
Only a few specific files:
```bash
nbir -b out -f report.pdf -f notes.txt
```
Both: all of one extension plus a couple of another:
```bash
nbir -b batch -e jpg,png -f cover.pdf -f readme.txt
```
All files in the directory:
```bash
nbir -b batch --all
```
Interactive (prompts for extensions, specific files, and base name):
```bash
nbir
```