# How to Disable Colored Output in holehe Logs: Complete CLI Guide

> Learn to disable colored output in holehe logs with the --no-color flag. Get a clean CLI experience for your holehe scans. Read our complete guide now.

- Repository: [Palenath/holehe](https://github.com/megadose/holehe)
- Tags: how-to-guide
- Published: 2026-08-18

---

**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`](https://github.com/megadose/holehe/blob/main/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`](https://github.com/megadose/holehe/blob/main/holehe/core.py), the argument parser defines the `--no-color` option at lines 186-188:

```python

# 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:

```bash

# Disable colors for a single email search

holehe -u example@example.com --no-color

```

### Multiple Targets

The flag works consistently across all search modes:

```bash

# 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:

```bash

# 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`:

```bash
alias holehe='holehe --no-color'

```

### Zsh Configuration

Add to `~/.zshrc`:

```bash
alias holehe='holehe --no-color'

```

Reload your shell configuration:

```bash
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`](https://github.com/megadose/holehe/blob/main/holehe/core.py)** — Contains `print_color` function and `--no-color` argument definition
- **[`setup.py`](https://github.com/megadose/holehe/blob/main/setup.py)** — Declares `termcolor` and `colorama` dependencies for cross-platform color support

## Summary

- **`--no-color`** is the single flag that disables all ANSI color output in `holehe`
- The flag controls the `args.nocolor` Boolean checked by `print_color` in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py)
- Colors default to **enabled**; you must explicitly pass `--no-color` to 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.