{
  "slug": "dotenv-to-shell",
  "name": "gizza-ai/dotenv-to-shell",
  "version": "0.1.0",
  "title": "Dotenv to Shell — Convert .env to export Statements Online — gizza.ai",
  "description": "Turn a .env file into export-prefixed shell statements (posix, bash, fish) — and back — with safe quoting for spaces, $, backticks and quotes. Runs in your browser.",
  "tags": [
    ".env to export",
    "dotenv to shell",
    "env to bash",
    "source .env",
    "export env vars",
    "shell quoting",
    "env to fish",
    "convert env file"
  ],
  "category": "developer",
  "urls": {
    "page": "https://gizza.ai/tools/dotenv-to-shell/",
    "markdown": "https://gizza.ai/tools/dotenv-to-shell/index.md",
    "descriptor": "https://gizza.ai/tools/dotenv-to-shell/tool.json",
    "deep_link_example": "https://gizza.ai/tools/dotenv-to-shell/?input=%23%20database%0Aexport%20DB_HOST%3Dlocalhost%0ADB_PORT%3D5432%0AGREETING%3Dhello%20world%0AAPI_TOKEN%3Ds3cr3t%24val&direction=to-shell&shell=posix&quote=auto"
  },
  "cli": "gizza tool dotenv-to-shell '# database\nexport DB_HOST=localhost\nDB_PORT=5432\nGREETING=hello world\nAPI_TOKEN=s3cr3t$val'",
  "tool": {
    "description": "Convert a .env file into export-prefixed shell statements (and back), handling quoting and special characters. Pass the source text in `input`. With `direction=to-shell` (default) each KEY=VALUE line becomes a shell statement for the chosen `shell` dialect — 'posix'/'bash' emit `export KEY=value`, 'fish' emits `set -gx KEY value` — with values safely quoted so spaces, `$`, backticks, `#`, quotes and newlines stay literal when the output is sourced. `quote=auto` (default) leaves safe values unquoted and single-quotes the rest; `quote=single` always quotes. Full-line comments and blank lines are preserved, an inline `# comment` and an 'export ' prefix on input are stripped, and keys that aren't valid shell identifiers are skipped with a note. With `direction=to-env` it parses `export`/`set -gx`/`setenv` statements back into a plain .env file. Everything runs locally; nothing is uploaded.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "direction": {
          "default": "to-shell",
          "description": "Conversion direction: 'to-shell' (default) turns a .env file into shell statements; 'to-env' parses shell export statements back into a plain .env file.",
          "enum": [
            "to-shell",
            "to-env"
          ],
          "type": "string"
        },
        "input": {
          "description": "The source text. For to-shell: a .env file (KEY=VALUE lines; # comments, blank lines, single/double quotes, inline comments and an 'export ' prefix are handled). For to-env: shell statements (export KEY=…, set -gx KEY …, setenv KEY …).",
          "type": "string"
        },
        "quote": {
          "default": "auto",
          "description": "Value quoting for to-shell. 'auto' (default) leaves safe values unquoted and single-quotes only values containing spaces or special characters; 'single' always single-quotes. Special characters ($, backtick, quotes, #, newlines) are always kept literal. Ignored for to-env.",
          "enum": [
            "auto",
            "single"
          ],
          "type": "string"
        },
        "shell": {
          "default": "posix",
          "description": "Target shell dialect for to-shell. 'posix' and 'bash' emit identical `export KEY=value` statements (also works in zsh/sh); 'fish' emits `set -gx KEY value`. Ignored for to-env (which auto-detects the input dialect).",
          "enum": [
            "posix",
            "bash",
            "fish"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}