# How to Disable Colored Output in the Holehe CLI

> Learn how to disable colored output in the Holehe CLI using the --no-color flag. Get plain text results for cleaner logs and easier parsing. Enhance your command-line experience today.

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

---

**Pass the `--no-color` flag when running the `holehe` command to disable all ANSI color codes and output plain text.**

The Holehe command-line interface, part of the `megadose/holehe` OSINT tool repository, uses the **termcolor** library to format terminal output. When you need to disable colored output in the Holehe CLI—for logging, piping to other tools, or terminal compatibility—you can use a built-in argument that suppresses all color wrapping.

## How Color Control Works in the Source Code

The color behavior is gated by a specific command-line argument defined in the main entry point. Understanding the implementation helps confirm that the flag reliably disables all styling.

### The `--no-color` Argument Definition

In [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py), the argument parser explicitly defines the flag at lines 186–187. The parser adds the option `--no-color` with a destination variable named `nocolor`. When you include this flag in your command, the parser sets `args.nocolor` to `True`, signaling the application to skip colorization throughout the execution.

### The `print_color` Implementation

The actual color suppression logic resides in the `print_color` helper function within the same file. At lines 108–109, this function checks the state of `args.nocolor`. If the flag is `True`, the function bypasses the termcolor formatting and returns plain text. This ensures that every output pathway respects the `--no-color` setting uniformly.

## Practical Usage Examples

You can invoke the `--no-color` flag with any standard Holehe command to receive unstyled output suitable for scripts or file redirection.

### Basic Command-Line Usage

```bash

# Standard execution with colors (default)

holehe user@example.com

# Execution with colors disabled

holehe user@example.com --no-color

```

### Making It Permanent

If you want to disable colored output by default without typing the flag each time, configure a shell alias:

```bash

# Add to ~/.bashrc or ~/.zshrc

alias holehe='holehe --no-color'

```

After reloading your shell configuration, every invocation of `holehe` will automatically use the `--no-color` behavior.

## Summary

- The `--no-color` flag is the official method to disable colored output in the Holehe CLI, as defined in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) at lines 186–187.
- The color logic is controlled by the `print_color` function, which checks `args.nocolor` at lines 108–109 to conditionally bypass termcolor formatting.
- This option produces plain text output ideal for logging, automation, and environments that do not support ANSI escape codes.

## Frequently Asked Questions

### What library does Holehe use for terminal colors?

Holehe uses the **termcolor** package to apply ANSI color codes to terminal output. This dependency is declared in the project configuration and is gated by the `--no-color` flag to allow plain-text mode.

### Can I set `--no-color` as the default behavior?

Yes. Create a shell alias in your `.bashrc`, `.zshrc`, or equivalent configuration file that includes the flag (e.g., `alias holehe='holehe --no-color'`). This ensures all future invocations disable colored output without manual intervention.

### Does disabling colors affect the tool's functionality or output structure?

No. Disabling colors only removes the ANSI formatting codes. The actual text content, spacing, and data returned by the OSINT modules remain identical whether colors are enabled or disabled.

### Where exactly is the `--no-color` flag defined in the source code?

According to the `megadose/holehe` source code, the flag is defined in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) at lines 186–187 within the argument parser setup. The resulting `nocolor` attribute is consumed by the `print_color` function at lines 108–109 to conditionally skip color wrapping.