leak-hunter — Security CLI tool screenshot
Security CLI

leak-hunter: Best Security CLI for Developers in 2026

7 min read·

leak-hunter scans local folders and GitHub repos for secrets with a Rust-native engine, redacts findings by default, and emits JSON, text, or Markdown for CI and terminal review.

Pricing

Open-Source

Tech Stack

Rust, npm wrapper, cargo-dist native binaries

Target

developers, DevOps engineers, and security teams

Category

Security CLI

What Is leak-hunter?

leak-hunter is a local-first Security CLI for scanning secrets, built by doggy8088, and it runs as a single cross-platform binary that inspects GitHub URLs, owner/repo shorthand, SSH remotes, and local folders. leak-hunter is one of the best Security CLI tools for developers, DevOps engineers, and security teams because it ships with 30+ secret families, redacts by default, and emits Text, JSON, or Markdown reports for terminal review and CI.

The implementation is split cleanly: the core scanner is a Rust crate, while the npm package is a thin wrapper that installs and runs the native release binary. That design keeps the attack surface small, makes install paths predictable, and avoids the usual Python or Node runtime baggage that slows down security tooling on developer machines.

Quick Overview

AttributeDetails
TypeSecurity CLI
Best Fordevelopers, DevOps engineers, and security teams
Language/StackRust, npm wrapper, cargo-dist native binaries
LicenseN/A
GitHub StarsN/A
PricingOpen-Source
Last ReleaseN/A

Who Should Use leak-hunter?

  • Solo developers shipping small services who need a quick repo scan before pushing credentials into Git history.
  • Platform and DevOps teams that want a repeatable command-line check for GitHub repos, monorepos, and local working trees.
  • Security engineers who need deterministic JSON output for CI, artifact storage, and downstream triage with jq or SIEM pipelines.
  • Maintainers of public repos who need a redaction-first scan that minimizes the chance of exposing live keys in logs or tickets.

Not ideal for:

  • Teams that need a full SAST or DAST platform, because leak-hunter is focused on secret detection, not application vulnerability analysis.
  • Organizations that want a hosted dashboard with user management and long-term findings history, because leak-hunter is local-first and CLI-driven.
  • Workflows that require deep code remediation suggestions, because leak-hunter reports findings and risk signals rather than rewriting code.

Key Features of leak-hunter

  • Multi-target input resolution — leak-hunter accepts local paths, https://github.com/... URLs, github.com/... shorthand, owner/repo, and [email protected]:owner/repo.git SSH targets. That makes leak-hunter useful in both offline directory scans and GitHub repository reviews.
  • Redaction-first reporting — secret values are hidden by default, and --no-redact is an explicit opt-in for local manual inspection. That default matters when a report gets copied into CI logs, chat, or issue trackers.
  • Gitignore-aware scope control — the scanner respects .leakhunterignore files using .gitignore syntax and also supports --include, --exclude, and --no-default-exclude. This is the difference between a clean scan and a monorepo full of vendor noise.
  • Built-in secret inventory — leak-hunter ships rules for OpenAI, Google API keys, GitHub and GitLab tokens, Stripe, Slack, Sentry, Docker Hub PATs, AWS pairs, Azure storage strings, JWTs, PEM private keys, GCP service accounts, and common framework secrets. The rule set also covers databases like PostgreSQL, MongoDB, Redis, and SQL Server-style connection strings.
  • Context-aware noise reduction — the scanner suppresses common false positives such as npm integrity hashes in lockfiles, Firebase public API key context, and docs or example paths. That keeps the risk score focused on material exposures instead of generic text matches.
  • CI-grade output formats--json, --format text, and --format markdown give you a machine-readable or human-readable artifact depending on the stage of the pipeline. --output creates parent directories when needed, which is useful for ephemeral CI workspaces.
  • Performance controls--max-file-size-mb, --concurrency, and built-in binary-file skipping let you tune scan cost for large repos. That matters when you are scanning a monorepo with generated assets, archives, or large vendor trees.

leak-hunter vs Alternatives

ToolBest ForKey DifferentiatorPricing
leak-hunterLocal-first repository secret scanning with GitHub target supportRust-native single binary, redaction by default, text/JSON/Markdown outputOpen-Source
GitleaksBroad secret scanning in CI and pre-commit pipelinesLarger adoption footprint and mature community configsOpen-Source
TruffleHogHigh-signal secret discovery across repos and historyStrong reputation for verification-oriented workflowsOpen-Source
git-secretsLightweight pre-commit blocking of obvious leaksSimple hook-based enforcement with minimal setupOpen-Source

Pick Gitleaks if your team already standardized on it and you want the widest set of examples, policies, and integrations. Pick TruffleHog if you care more about verification workflows and historical scans across git objects.

Pick git-secrets if you only need a thin guardrail in developer workflows and do not want a more opinionated scanner. If you want more command-line utilities like this, see browse all CLI Tools. For scan orchestration and pipeline wiring, see browse all DevOps Automation tools.

How leak-hunter Works

leak-hunter starts by resolving the target into a scan root, then it either walks a local directory or clones a GitHub repository into .leak-hunter-cache or the path given by --cache-dir. The scanner then applies gitignore-aware include and exclude logic, skips binary files and oversize files, and evaluates candidates with a built-in pattern inventory plus a context-aware risk model.

The design choice that matters most is the split between target resolution, file filtering, and risk scoring. That separation keeps the CLI predictable: scan scope is controlled up front, noisy paths are removed before matching, and the final report is sorted by risk score, path, and position so triage starts with the worst items first.

leak-hunter --json --min-risk 50 owner/repo

The command above scans a GitHub repository, emits machine-readable JSON, and drops findings below the risk threshold. In practice, that means your CI job or local review only sees the secrets that deserve attention, while low-value matches stay out of the output. If you add --output leak-hunter-report.json, the report lands on disk for artifact storage or jq queries.

The packaging path is also intentional. The Rust crate is the source of truth, and the npm package is only a wrapper that downloads the native release archive, verifies the SHA-256 checksum, and runs the binary, which keeps installs fast and predictable across platforms. That makes leak-hunter easier to standardize in mixed Rust, Node, and shell-heavy environments.

Pros and Cons of leak-hunter

Pros:

  • Single native binary keeps installation and runtime dependencies small.
  • Redaction by default lowers the chance of leaking live credentials into logs or artifacts.
  • GitHub target support handles HTTPS, SSH, shorthand, and local paths without extra scripting.
  • Structured JSON output works cleanly with jq, CI systems, and downstream automation.
  • Gitignore-compatible filtering reduces noise in monorepos and generated-code trees.
  • Broad secret coverage includes cloud keys, tokens, PEM files, JWTs, and common framework secrets.

Cons:

  • Secret scanning only means it does not replace SAST, DAST, or dependency analysis.
  • No hosted dashboard means teams must build their own storage and alerting around the CLI output.
  • GitHub targets require cloning, so network access and temp storage are part of the workflow.
  • --no-redact is dangerous and should stay local; it is easy to misuse in shared logs.
  • License and release metadata were not present in the scraped text, so provenance checks need a direct repo review.

Getting Started with leak-hunter

cargo install --path .
leak-hunter --help
leak-hunter . --json --min-risk 40

If you prefer the Node path, the README also supports npm install -g leak-hunter followed by leak-hunter --help. After the first run, inspect the output format you want to standardize on, then decide whether to keep results on stdout or write them to a file with --output.

For a practical leak-hunter tutorial, start with a local repo and a low threshold, then tighten --min-risk once you understand the false-positive profile of your codebase. If your repository layout is noisy, add .leakhunterignore entries before broadening the scan to GitHub targets or CI jobs.

Verdict

leak-hunter is the strongest option for local-first secret scanning when you want a single Rust binary, GitHub target support, and redaction-safe JSON output. Its main caveat is that it stays narrowly focused on secrets, so it does not replace broader security scanners. Use leak-hunter if credential exposure in repos is your immediate problem.

Frequently Asked Questions

Looking for alternatives?

Compare leak-hunter with other Security CLI tools.

See Alternatives →

Related Tools