Lightning-fast CLI tool to remove ANSI escape codes and color sequences from text streams and files
- Strip all ANSI color codes (foreground and background)
- Remove cursor movement and positioning sequences
- Remove text formatting codes (bold, italic, underline, etc.)
- Process stdin for pipeline integration (cat file.log | ansi-strip)
- Process single or multiple files with glob patterns
- Preserve original text content and whitespace exactly
- Write cleaned output to stdout or specified file
- Optional verbose mode showing what was stripped
- Handle malformed or incomplete ANSI sequences gracefully
- Optimized for processing large log files (GB+) efficiently
Use this project when you need to:
- Quickly solve problems related to ansi-strip
- Integrate rust functionality into your workflow
- Learn how rust handles common patterns
# Clone the repository
git clone https://github.com/KurtWeston/ansi-strip.git
cd ansi-strip
# Install dependencies
cargo buildcargo run- rust
clapregexlazy_static
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.