dotenv-audit

Scans .env files and code for exposed secrets and missing entries.

1|1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/dennisonbertram/go-agent-harness --skill dotenv-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotenv-audit
Source: https://github.com/dennisonbertram/go-agent-harness/tree/main/skills/dotenv-audit
Command: npx skills add https://github.com/dennisonbertram/go-agent-harness --skill dotenv-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audit and prevent secrets leaks by scanning environment files (.env) and code for exposed credentials in commits, logs, and runtime messages.

Core Features & Use Cases

  • .env and env. scanning*: Detects .env files that should be ignored or are tracked, and flags potential exposures.
  • Code and log hygiene: Flags hardcoded API keys, tokens, and secrets in source code and log messages.
  • Environment variable discipline: Verifies that os.Getenv usage aligns with a central .env.example and guides remediation.
  • Use Case: Before pushing to a shared repository, run the audit to ensure no secrets are present and that required environment variables are documented.

Quick Start

Run the dotenv-audit tool in your project to scan for secrets exposure in environment files.

Frequently Asked Questions about dotenv-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan my repository for exposed secrets in .env files before pushing?

To scan for exposed secrets in .env files, audit environment files and code to detect tracked .env variants, hardcoded API keys, and os.Getenv usage. This process flags potential credential exposures and verifies .gitignore coverage before you push to a shared repository.

What is the best way to check if my .env files are properly ignored by git?

The best way to check if .env files are ignored is to audit .gitignore coverage for tracked and untracked .env variants. This audit identifies ignored environment files and flags any committed .env files that bypassed gitignore rules.

How do I prevent hardcoded API keys and tokens from leaking in my source code?

Prevent hardcoded API keys from leaking by auditing source code and log messages for exposed credentials. The audit flags secrets directly in code and runtime logs, ensuring environment variables are used safely instead of hardcoded values.

Does my project need a .env.example file to manage environment variables?

Yes, a .env.example file is needed to maintain environment variable discipline. The audit verifies your os.Getenv usage aligns with a central .env.example file, guiding remediation and ensuring all required environment variables are documented.

Why are my environment variables showing up in application logs?

Environment variables appear in logs when secret leakage occurs in runtime messages. The audit scans your code and log hygiene to flag potential secret leakage, identifying where sensitive values are being printed or logged during application execution.

Can I audit environment files and code for secrets without installing extra dependencies?

Yes, you can audit environment files and code for secrets without extra dependencies. The dotenv-audit tool operates independently with no required dependencies, directly scanning your project structure for .env variants and hardcoded credentials.