# Install gitleaks on Windows, macOS and Linux

Find secrets and API keys committed to git repositories and files.

gitleaks scans a git repository's whole history, or any directory, for passwords, API keys and tokens. It matches a large set of known secret formats, runs offline and is fast enough to use on every commit.

## How to install gitleaks

```
ot install gitleaks
```

ot downloads gitleaks 8.30.1 as a prebuilt binary from [github.com/gitleaks/gitleaks](https://github.com/gitleaks/gitleaks/releases) and verifies its SHA-256 checksum before installing it. Nothing has to be compiled.

If you do not have ot yet:

macOS and Linux:

```
curl -fsSL https://otinstaller.com/install.sh | sh
```

Windows (PowerShell):

```
irm https://otinstaller.com/install.ps1 | iex
```

Current version: 0.3.0. Both scripts verify the download against its [SHA-256 checksum](https://otinstaller.com/releases/v0.3.0/checksums.txt) before installing.

## How to use gitleaks

Arguments after the tool's name go straight to gitleaks.

Scan the history of the repository in the current directory.

```
ot run gitleaks git -v .
```

Scan plain files that are not in git.

```
ot run gitleaks dir ./config
```

Write a JSON report and hide the secrets in the output.

```
ot run gitleaks git --redact --report-path leaks.json .
```

`ot run gitleaks --help` lists every option.

An AI agent can run gitleaks too: `ot mcp` serves it over the Model Context Protocol. See [OSINT with AI agents](https://otinstaller.com/mcp/).

## gitleaks licence, platforms and versions

- Project: https://github.com/gitleaks/gitleaks
- Licence: MIT
- Runs on: Windows, macOS and Linux
- Takes: repository, directory
- Categories: secrets, code
- Sends traffic to the target: no
- Release binary: version 8.30.1 from github.com/gitleaks/gitleaks, verified by SHA-256

## Questions about gitleaks

### How do I install gitleaks on Windows?

Open PowerShell and install ot with `irm https://otinstaller.com/install.ps1 | iex`. Then run `ot install gitleaks`. ot fetches a pinned version of gitleaks and keeps it under `~/.ot`, apart from the rest of your system.

### Is gitleaks free?

Yes. gitleaks is open source, released under the MIT licence. ot, which installs it, is free under the Apache 2.0 licence.

### Do I need Go or a compiler to install gitleaks?

No. ot downloads the prebuilt gitleaks binary for your platform and checks its SHA-256 checksum. A mismatch installs nothing.

### How do I update or remove gitleaks?

`ot update gitleaks` moves it to the version pinned in ot's registry, and `ot update gitleaks --latest` to the newest upstream release. `ot remove gitleaks` uninstalls it.

## Tools related to gitleaks

- [trufflehog](https://otinstaller.com/tools/trufflehog/): Find and verify leaked credentials in git history, files, buckets and more.
- [cariddi](https://otinstaller.com/tools/cariddi/): Crawl a site for endpoints, secrets, API keys and interesting files.

More: [Secrets and cloud](https://otinstaller.com/osint-tools/secrets/).
