{
  "slug": "dotenv-validator",
  "name": "gizza-ai/dotenv-validator",
  "version": "0.1.0",
  "title": "Dotenv Validator — Lint .env Files for Duplicate Keys & Bad Interpolation — gizza.ai",
  "description": "Paste a .env file to catch duplicate keys, unquoted spaces, malformed ${VAR} interpolation and undefined references. Runs locally in your browser.",
  "tags": [
    ".env validator",
    "dotenv linter",
    "env file checker",
    "duplicate keys",
    "unquoted values",
    "env interpolation",
    "undefined variable",
    "env lint json"
  ],
  "category": "developer",
  "urls": {
    "page": "https://gizza.ai/tools/dotenv-validator/",
    "markdown": "https://gizza.ai/tools/dotenv-validator/index.md",
    "descriptor": "https://gizza.ai/tools/dotenv-validator/tool.json",
    "deep_link_example": "https://gizza.ai/tools/dotenv-validator/?env=%23%20database%0Aexport%20DB_HOST%3Dlocalhost%0ADB_PORT%3D5432%0AGREETING%3Dhello%20world%0AURL%3Dhttp%3A%2F%2F%24%7BDB_HOST%7D%3A%24%7BDB_PORT%7D%2F%24%7BMISSING%7D%0ADB_HOST%3D127.0.0.1&allow_undefined=HOME%2CPATH%2CCI&check_interpolation=true&require_quotes_for_spaces=true&output=report"
  },
  "cli": "gizza tool dotenv-validator '# database\nexport DB_HOST=localhost\nDB_PORT=5432\nGREETING=hello world\nURL=http://${DB_HOST}:${DB_PORT}/${MISSING}\nDB_HOST=127.0.0.1'",
  "tool": {
    "description": "Lint a .env (dotenv) file and report problems without rewriting it. Pass the file text in `env`; the tool parses KEY=VALUE lines (handling # comments, blank lines, single/double quotes, inline comments and an 'export ' prefix) and flags: duplicate keys (last value wins), unquoted values containing spaces, malformed ${VAR} interpolation (unclosed '${' or empty '${}'), and references to variables that are never defined in the file — plus invalid/lowercase key names, whitespace around '=', empty values, unterminated quotes and CRLF line endings. Each issue carries a line number, a severity (error/warning) and a rule name. Set `allow_undefined` to a comma-separated list of externally-provided variables (shell/CI) so their references are not reported. Turn off `check_interpolation` or `require_quotes_for_spaces` to silence those rule groups. `output` selects 'report' (default, human-readable) or 'json' (structured, for CI).",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "allow_undefined": {
          "description": "Comma-separated variable names that are provided externally (from the shell or CI, e.g. 'HOME,PATH,CI') so references to them via ${VAR} are NOT reported as undefined. Matched case-sensitively. Default none.",
          "type": "string"
        },
        "check_interpolation": {
          "default": true,
          "description": "Validate ${VAR}/$VAR interpolation: flag unclosed '${', empty '${}', and references to variables not defined in the file. Default true.",
          "type": "boolean"
        },
        "env": {
          "description": "The .env file contents to lint (KEY=VALUE lines; # comments, blank lines, quotes and an 'export ' prefix are understood). Nothing is uploaded — the file is only read to report issues.",
          "type": "string"
        },
        "output": {
          "default": "report",
          "description": "Output form: 'report' (default) a human-readable list of issues with line numbers and severities, or 'json' a structured {ok, keys, error_count, warning_count, issues[]} object for CI.",
          "enum": [
            "report",
            "json"
          ],
          "type": "string"
        },
        "require_quotes_for_spaces": {
          "default": true,
          "description": "Flag unquoted values that contain a space (most loaders keep only the first word unless the value is quoted). Default true.",
          "type": "boolean"
        }
      },
      "required": [
        "env"
      ],
      "type": "object"
    }
  }
}