envoke-cli 1.0.0

Resolve variables from literals, commands, scripts, and templates — output as env vars, .env files, or custom formats
{
  "$defs": {
    "Override": {
      "description": "An override provides alternative sources for a variable, activated via\nthe `--override` CLI flag.",
      "properties": {
        "default": {
          "anyOf": [
            {
              "$ref": "#/$defs/Source"
            },
            {
              "type": "null"
            }
          ],
          "description": "Fallback source for this override when the environment has no entry."
        },
        "envs": {
          "additionalProperties": {
            "$ref": "#/$defs/Source"
          },
          "description": "Map of environment names to value sources for this override.",
          "type": "object"
        }
      },
      "type": "object"
    },
    "Source": {
      "additionalProperties": false,
      "description": "How to obtain the value for a variable in a given environment.\n\nExactly one of `literal`, `cmd`, `sh`, `template`, or `skip` must be\nspecified.",
      "properties": {
        "cmd": {
          "description": "A command to execute; stdout is captured and trimmed.",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "literal": {
          "description": "A fixed string value.",
          "type": [
            "string",
            "null"
          ]
        },
        "sh": {
          "description": "A shell script to execute via `sh -c`; stdout is captured and trimmed.",
          "type": [
            "string",
            "null"
          ]
        },
        "skip": {
          "description": "When `true`, the variable is silently omitted from output.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "template": {
          "description": "A minijinja (Jinja2) template string. Reference other variables with `{{\nVAR_NAME }}`.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "Variable": {
      "description": "A single environment variable with per-environment sources.",
      "properties": {
        "default": {
          "anyOf": [
            {
              "$ref": "#/$defs/Source"
            },
            {
              "type": "null"
            }
          ],
          "description": "Fallback source used when the requested environment has no entry in\n`envs`."
        },
        "description": {
          "description": "Human-readable description, rendered as a comment in output.",
          "type": [
            "string",
            "null"
          ]
        },
        "envs": {
          "additionalProperties": {
            "$ref": "#/$defs/Source"
          },
          "description": "Map of environment names to value sources.",
          "type": "object"
        },
        "overrides": {
          "additionalProperties": {
            "$ref": "#/$defs/Override"
          },
          "description": "Named overrides that can be activated via `--override` on the CLI.\nEach override provides alternative `default`/`envs` sources that\ntake precedence over the base sources when active.",
          "type": "object"
        },
        "tags": {
          "default": [],
          "description": "Tags for conditional inclusion. When `--tag` flags are passed on the\nCLI, only variables with at least one matching tag (or no tags) are\nincluded.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Top-level envoke configuration, typically loaded from `envoke.yaml`.",
  "properties": {
    "variables": {
      "additionalProperties": {
        "$ref": "#/$defs/Variable"
      },
      "description": "Map of variable names to their definitions.",
      "type": "object"
    }
  },
  "required": [
    "variables"
  ],
  "title": "Config",
  "type": "object"
}