Skip to content

KurtWeston/ansi-strip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansi-strip

Lightning-fast CLI tool to remove ANSI escape codes and color sequences from text streams and files

Features

  • 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

How to Use

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

Installation

# Clone the repository
git clone https://github.com/KurtWeston/ansi-strip.git
cd ansi-strip

# Install dependencies
cargo build

Usage

cargo run

Built With

  • rust

Dependencies

  • clap
  • regex
  • lazy_static

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Lightning-fast CLI tool to remove ANSI escape codes and color sequences from text streams and files

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages