<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gerald Mathew</title>
    <description>The latest articles on DEV Community by Gerald Mathew (@gerald-1234).</description>
    <link>https://dev.to/gerald-1234</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4038511%2Fdd9220de-6d8d-4d2a-9180-842dfad08cac.jpg</url>
      <title>DEV Community: Gerald Mathew</title>
      <link>https://dev.to/gerald-1234</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gerald-1234"/>
    <language>en</language>
    <item>
      <title>I Built a C++ CLI That Hunts Down Secrets Hiding in Your Git History</title>
      <dc:creator>Gerald Mathew</dc:creator>
      <pubDate>Wed, 02 Sep 2026 21:40:03 +0000</pubDate>
      <link>https://dev.to/gerald-1234/i-built-a-c-cli-that-hunts-down-secrets-hiding-in-your-git-history-ac2</link>
      <guid>https://dev.to/gerald-1234/i-built-a-c-cli-that-hunts-down-secrets-hiding-in-your-git-history-ac2</guid>
      <description>&lt;p&gt;We've all done it. You commit a &lt;code&gt;.env&lt;/code&gt; file by accident, catch it a few commits later, delete it, and breathe a sigh of relief. Except... it's not gone. It's still sitting in your Git history, one &lt;code&gt;git log -p&lt;/code&gt; away from anyone who clones the repo.&lt;/p&gt;

&lt;p&gt;That's the problem &lt;strong&gt;GitHub Secrets Watcher&lt;/strong&gt; is built to catch.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;GitHub Secrets Watcher is a command-line tool written in modern C++20 that scans your GitHub repositories — public or private (with a token) — and walks back through commit history looking for accidentally committed environment and config files: &lt;code&gt;.env&lt;/code&gt;, &lt;code&gt;config.js&lt;/code&gt;, and similar patterns that often carry API keys, database credentials, or other secrets.&lt;/p&gt;

&lt;p&gt;For every hit, it gives you a direct link to the exact commit where the file appears, so you're not stuck digging through history manually to remediate it.&lt;/p&gt;

&lt;p&gt;Importantly, it's strictly &lt;strong&gt;read-only&lt;/strong&gt;. It never modifies, deletes, or rewrites anything in your repositories — it just reports what it finds so you can decide what to do next (rotate the secret, scrub the history, etc.).&lt;/p&gt;

&lt;h2&gt;
  
  
  Key features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scans all repos for a given GitHub username, public by default, private too if you pass a token&lt;/li&gt;
&lt;li&gt;Walks a configurable depth of commit history across branches&lt;/li&gt;
&lt;li&gt;Skips noisy directories like &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;.git&lt;/code&gt;, and &lt;code&gt;dist&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Validates commit hashes before generating links, so you never get a broken URL&lt;/li&gt;
&lt;li&gt;Multi-threaded scanning — set the thread count to match your hardware&lt;/li&gt;
&lt;li&gt;Three output formats: human-readable text (with color-coded terminal output), JSON, or CSV&lt;/li&gt;
&lt;li&gt;Stream-based processing to keep memory usage low even on large histories&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[1/7] Scanning: CareConnect-Clinic-Appointment-System
[INFO] Cloning repository (depth=100)...
[INFO] Scanning history...
[WARN] Found 5 potential environment/configuration files:
     - client/assets/js/config.js
       [LINK] https://github.com/.../blob/c7e0fba.../client/assets/js/config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each finding links straight to the offending commit, so remediation is one click away instead of a history-diving expedition.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Gerald-1234/github-secrets-watcher
&lt;span class="nb"&gt;cd &lt;/span&gt;github-secrets-watcher
&lt;span class="nb"&gt;mkdir &lt;/span&gt;build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;build
cmake ..
make
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run a scan:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./github_secrets_watcher scan &lt;span class="nt"&gt;--username&lt;/span&gt; YOUR_USERNAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add a token for private repos and higher API rate limits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./github_secrets_watcher scan &lt;span class="nt"&gt;--username&lt;/span&gt; YOUR_USERNAME &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--token&lt;/span&gt; YOUR_PERSONAL_ACCESS_TOKEN &lt;span class="nt"&gt;--include-private&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can tune the scan with &lt;code&gt;--depth&lt;/code&gt;, &lt;code&gt;--max-repos&lt;/code&gt;, &lt;code&gt;--threads&lt;/code&gt;, &lt;code&gt;--format&lt;/code&gt;, and &lt;code&gt;--output&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why C++20
&lt;/h2&gt;

&lt;p&gt;This isn't a wrapper around &lt;code&gt;git log&lt;/code&gt; piped through &lt;code&gt;grep&lt;/code&gt; — it uses libcurl for the GitHub API calls and nlohmann/json for parsing, with modern C++20 features throughout. It builds cleanly with CMake or a provided build script on Linux, macOS, and Windows (via MSYS2).&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;p&gt;It's MIT-licensed and open source. If you've got repos going back a few years, there's a decent chance something's buried in there that shouldn't be — I'd genuinely be curious what people find.&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://github.com/Gerald-1234/github-secrets-watcher" rel="noopener noreferrer"&gt;github.com/Gerald-1234/github-secrets-watcher&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback, issues, and PRs welcome.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>security</category>
      <category>cli</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
