2025-03-12 20:52:47 +01:00
2023-08-22 22:21:44 +02:00
2025-03-12 09:04:29 +01:00
2025-03-12 20:52:47 +01:00

Bulk String Replacer CLI (bsr) 🔄

GitHub Sponsors Patreon Buy Me a Coffee PayPal

License: AGPL v3 GitHub stars

Bulk String Replacer CLI (bsr) is a powerful Python-based command-line tool that lets you search and replace strings in file names, folder names, and within file contents across multiple directories. Perfect for performing bulk updates quickly and efficiently, bsr supports recursive traversal, hidden files, and a preview mode so you can review changes before theyre applied. 🔧📂


🛠 Features

  • Comprehensive Replacement: Replace strings in folder names, file names, and inside file contents.
  • Recursive Processing: Traverse directories recursively to update all matching files.
  • Hidden Files Support: Option to include hidden files and directories.
  • Preview Mode: Preview changes without modifying any files.
  • Verbose Output: Display detailed logs of the operations performed.

📥 Installation

Install Bulk String Replacer CLI easily via Kevin's Package Manager under the alias bsr:

package-manager clone bsr
package-manager install bsr

This command makes the tool globally available as bsr in your terminal. 🚀


🚀 Usage

Once installed, run Bulk String Replacer CLI using the alias:

bsr old_string --new-string "replacement_value" [options] [paths...]

Options

  • old_string: The string to search for and replace.
  • --new-string: The string that will replace old_string (default is an empty string).
  • --recursive: Process all subdirectories and files recursively.
  • --folder: Replace occurrences within folder names.
  • --files: Replace occurrences within file names.
  • --content: Replace occurrences inside file contents.
  • --preview: Preview changes without applying them.
  • --verbose: Display detailed logs during execution.
  • --hidden: Include hidden files and directories in the operation.

Example Command

bsr "old_value" --new-string "new_value" --recursive --verbose /path/to/first/directory /path/to/second/directory

Replace /path/to/first/directory and /path/to/second/directory with the paths you wish to process.


🧑‍💻 Author

Developed by Kevin Veen-Birkenbach

Learn more about the development of this tool in the original ChatGPT conversation.


📜 License

This project is licensed under the GNU Affero General Public License, Version 3, 19 November 2007.
For more details, see the LICENSE file.


🤝 Contributions

Contributions are welcome! Feel free to fork the repository, submit pull requests, or open issues to help improve Bulk String Replacer CLI. Lets make bulk updates even easier! 😊

Description
No description provided
Readme AGPL-3.0 59 KiB
Languages
Python 100%