___ _ _ / __\ |__ __ _(_)_ __ ___ __ ___ __ / / | '_ \ / _` | | '_ \/ __|/ _` \ \ /\ / / / /___| | | | (_| | | | | \__ \ (_| |\ V V / \____/|_| |_|\__,_|_|_| |_|___/\__,_| \_/\_/
Slice through your HTML with precision!
Installation • Usage • Features • Contributing • License
Chainsaw is a powerful command-line tool that allows you to make surgical changes to your HTML files across entire project directories. With Chainsaw, you can easily find and replace text within specific HTML elements, saving you time and reducing the risk of manual errors.
- 🔍 Search for specific HTML IDs across multiple files
- 🔄 Find and replace text within targeted HTML elements
- 📁 Recursively process entire project directories
- 📝 Detailed logging of all changes
- 💅 Stylish CLI interface powered by Bubble Tea
Run the following command in your terminal:
curl -sSL https://raw.githubusercontent.com/LouisWhit/chainsaw/main/unix-install.sh | bash
Ensure you have Go installed (version 1.16+) Run:
go install github.com/LouisWhit/chainsaw@latest
bashCopychainsaw <project_folder> <html_id> <find_string> <replace_string>
Example:
chainsaw ./my-project "header-nav" "Contact Us" "Get in Touch"
This command will:
Search through all files in ./my-project Find elements with the ID header-nav Replace "Contact Us" with "Get in Touch" within those elements
Chainsaw provides real-time feedback in your terminal and generates a detailed log file in your home directory: Copy~/chainsaw_log-2024-08-07_14-30-45.txt
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is good luck licensed.