{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://flowexec.io/schemas/config_schema.json",
  "title": "Config",
  "description": "User Configuration for the Flow CLI.\nIncludes configurations for workspaces, templates, I/O, and other settings for the CLI.\n\nIt is read from the user's flow config directory:\n- **MacOS**: `$HOME/Library/Application Support/flow`\n- **Linux**: `$HOME/.config/flow`\n- **Windows**: `%APPDATA%\\flow`\n\nAlternatively, a custom path can be set using the `FLOW_CONFIG_PATH` environment variable.\n",
  "type": "object",
  "required": [
    "workspaces",
    "currentWorkspace"
  ],
  "definitions": {
    "ColorPalette": {
      "description": "The color palette for the interactive UI.\nThe colors can be either an ANSI 16, ANSI 256, or TrueColor (hex) value.\nIf unset, the default color for the current theme will be used.\n",
      "type": "object",
      "properties": {
        "black": {
          "type": "string"
        },
        "body": {
          "type": "string"
        },
        "border": {
          "type": "string"
        },
        "codeStyle": {
          "description": "The style of the code block. For example, `monokai`, `dracula`, `github`, etc.\nSee [chroma styles](https://github.com/alecthomas/chroma/tree/master/styles) for available style names.\n",
          "type": "string"
        },
        "emphasis": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "gray": {
          "type": "string"
        },
        "info": {
          "type": "string"
        },
        "primary": {
          "type": "string"
        },
        "secondary": {
          "type": "string"
        },
        "success": {
          "type": "string"
        },
        "tertiary": {
          "type": "string"
        },
        "warning": {
          "type": "string"
        },
        "white": {
          "type": "string"
        }
      }
    },
    "Interactive": {
      "description": "Configurations for the interactive UI.",
      "type": "object",
      "required": [
        "enabled"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "notifyOnCompletion": {
          "description": "Whether to send a desktop notification when a command completes.",
          "type": "boolean"
        },
        "soundOnCompletion": {
          "description": "Whether to play a sound when a command completes.",
          "type": "boolean"
        }
      }
    }
  },
  "properties": {
    "colorOverride": {
      "$ref": "#/definitions/ColorPalette",
      "description": "Override the default color palette for the interactive UI.\nThis can be used to customize the colors of the UI.\n"
    },
    "currentNamespace": {
      "description": "The name of the current namespace.\n\nNamespaces are used to reference executables in the CLI using the format `workspace:namespace/name`.\nIf the namespace is not set, only executables defined without a namespace will be discovered.\n",
      "type": "string",
      "default": ""
    },
    "currentVault": {
      "description": "The name of the current vault. This should match a key in the `vaults` map.",
      "type": "string"
    },
    "currentWorkspace": {
      "description": "The name of the current workspace. This should match a key in the `workspaces` or `remoteWorkspaces` map.",
      "type": "string",
      "default": ""
    },
    "defaultLogMode": {
      "description": "The default log mode to use when running executables.\nThis can either be `hidden`, `json`, `logfmt` or `text`\n\n`hidden` will not display any logs.\n`json` will display logs in JSON format.\n`logfmt` will display logs with a log level, timestamp, and message.\n`text` will just display the log message.\n",
      "type": "string",
      "default": "logfmt"
    },
    "defaultTimeout": {
      "description": "The default timeout to use when running executables.\nThis should be a valid duration string.\n",
      "type": "string",
      "default": "30m"
    },
    "interactive": {
      "$ref": "#/definitions/Interactive"
    },
    "templates": {
      "description": "A map of flowfile template names to their paths.",
      "type": "object",
      "default": {},
      "additionalProperties": {
        "type": "string"
      }
    },
    "theme": {
      "description": "The theme of the interactive UI.",
      "type": "string",
      "default": "default",
      "enum": [
        "default",
        "everforest",
        "dark",
        "light",
        "dracula",
        "tokyo-night"
      ]
    },
    "updateCheck": {
      "description": "Whether to check for CLI updates in the background.\nWhen enabled, flow will periodically check GitHub for a newer version and\ndisplay a notice if one is available after each command.\nSet `FLOW_NO_UPDATE_CHECK=1` to suppress checks regardless of this setting.\n",
      "type": "boolean",
      "default": false
    },
    "vaults": {
      "description": "A map of vault names to their paths. The path should be a valid absolute path to the vault file created by flow.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "workspaceMode": {
      "description": "The mode of the workspace. This can be either `fixed` or `dynamic`.\nIn `fixed` mode, the current workspace used at runtime is always the one set in the currentWorkspace config field.\nIn `dynamic` mode, the current workspace used at runtime is determined by the current directory.\nIf the current directory is within a workspace, that workspace is used.\n",
      "type": "string",
      "default": "dynamic",
      "enum": [
        "fixed",
        "dynamic"
      ]
    },
    "workspaces": {
      "description": "Map of workspace names to their paths. The path should be a valid absolute path to the workspace directory.\n",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}