How to Disable Colored Output in holehe Logs: Complete CLI Guide
To disable colored output in holehe logs, use the --no-color command-line flag when running your scan.
The open-source OSINT tool megadose/holehe provides colored terminal output by default to improve readability of account discovery results. When piping output to files, processing logs with other tools, or working in terminals without ANSI support, you can disable all color formatting with a single argument. This guide explains how the --no-color flag works and how to apply it effectively in different workflows.
How holehe Controls Colored Output
The holehe tool implements color output through a centralized print_color function in holehe/core.py. This function wraps the termcolor library to apply ANSI color codes to status messages, success indicators, and error notifications.
The --no-color CLI Flag
In holehe/core.py, the argument parser defines the --no-color option at lines 186-188:
# From holehe/core.py
parser.add_argument('--no-color', action='store_true',
help='disable colored output')
When you pass --no-color, the parser sets args.nocolor to True. The print_color function checks this Boolean flag before applying any color formatting. If args.nocolor is True, the function returns the raw text string without calling termcolor.colored().
Using the --no-color Flag
Basic Usage
Run holehe with the flag appended after your target specification:
# Disable colors for a single email search
holehe -u example@example.com --no-color
Multiple Targets
The flag works consistently across all search modes:
# File-based input without colors
holehe -f emails.txt --no-color
# Single username with plain output
holehe -u johndoe@example.com --no-color
Redirecting Output to Files
Colored output includes ANSI escape sequences that clutter raw log files. Use --no-color when capturing results:
# Clean log file without escape codes
holehe -u target@example.com --no-color > results.txt 2>&1
# Process results with grep or awk
holehe -u target@example.com --no-color | grep "Found"
Making Plain Output Permanent
If you consistently need uncolored output, create a shell alias instead of typing the flag repeatedly.
Bash Configuration
Add to ~/.bashrc:
alias holehe='holehe --no-color'
Zsh Configuration
Add to ~/.zshrc:
alias holehe='holehe --no-color'
Reload your shell configuration:
source ~/.bashrc # or source ~/.zshrc
Now all holehe invocations default to plain text output.
When to Disable Colors
| Scenario | Recommendation |
|---|---|
Piping to grep, awk, or sed |
Use --no-color to avoid matching escape sequences |
| Saving to log files | Use --no-color for readable plain text |
| CI/CD pipelines | Use --no-color to prevent ANSI artifacts in build logs |
| Terminal without color support | Use --no-color or the tool auto-detects |
| Quick interactive scans | Default colored output is fine |
Key Implementation Files
holehe/core.py— Containsprint_colorfunction and--no-colorargument definitionsetup.py— Declarestermcolorandcoloramadependencies for cross-platform color support
Summary
--no-coloris the single flag that disables all ANSI color output inholehe- The flag controls the
args.nocolorBoolean checked byprint_colorinholehe/core.py - Colors default to enabled; you must explicitly pass
--no-colorto disable them - Use shell aliases to make plain output permanent for your workflow
- Disable colors when piping, logging to files, or processing output programmatically
Frequently Asked Questions
Does --no-color affect other holehe features?
No. The --no-color flag only suppresses ANSI escape sequences in terminal output. All account discovery functionality, rate limiting, and result formatting work identically. The flag is purely cosmetic.
Can I disable colors via environment variable?
Not natively. The holehe implementation only checks the CLI argument args.nocolor. To simulate environment-based control, create a wrapper script or alias that always includes --no-color.
Why do I see color codes when redirecting output without the flag?
holehe does not auto-detect output redirection. Without --no-color, termcolor.colored() always applies escape sequences. These appear as [32m, [31m, and similar codes in saved files. Always use --no-color when capturing output.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →