{
  "type": "object",
  "properties": {
    "projectId": {
      "description": "Project ID. Only required when using a Personal Access Token.",
      "type": ["number", "string"]
    },
    "branch": {
      "description": "Project branch. Use when branching enabled for the project.",
      "type": "string",
      "minLength": 1
    },
    "apiUrl": {
      "description": "The url of Tolgee API.",
      "type": "string"
    },
    "apiKey": {
      "description": "Api key to Tolgee Platform.\n\nWARNING: Make sure you don't leak your API key\nUse `apiKey` only if you are loading it from an environment or other secured source (supported in .js or .yml files) or your config is not public.\n\nIn most cases, it's better to use a one-time `login` command or set it via the `TOLGEE_API_KEY` environment variable.",
      "type": "string"
    },
    "format": {
      "$ref": "#/$defs/format"
    },
    "extractor": {
      "description": "A path to a custom extractor to use instead of the default one.",
      "type": "string"
    },
    "patterns": {
      "description": "File glob patterns to your source code, used for keys extraction.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "strictNamespace": {
      "description": "Require namespace to be reachable, turn off if you don't use namespaces. (Default: true)",
      "type": "boolean"
    },
    "defaultNamespace": {
      "description": "Default namespace used in extraction if not specified otherwise.",
      "type": "string"
    },
    "parser": {
      "description": "Override parser detection.",
      "enum": ["react", "vue", "svelte", "ngx"]
    },
    "headers": {
      "description": "Custom HTTP headers added to every request to the Tolgee API, e.g. when the platform is behind a custom auth/proxy layer.\n\nThe `user-agent`, `x-api-key` and `content-type` headers are reserved and ignored/overridden by the CLI. Custom headers are additive to the Tolgee API key (which is still required).",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "push": {
      "type": "object",
      "properties": {
        "filesTemplate": {
          "description": "A template that describes the structure of the local files and their location with file [structure template format](https://docs.tolgee.io/tolgee-cli/push-pull-strings#file-structure-template-format).\n\nExample: `./public/{namespace}/{languageTag}.json`",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": { "type": "string" }
            }
          ]
        },
        "files": {
          "description": "More explicit alternative to `filesTemplate`. Define, which files should be pushed and attach language/namespace to them. By default Tolgee pushes all files specified here, you can filter them by languages and namespaces properties.",
          "type": "array",
          "items": { "$ref": "#/$defs/fileMatch" }
        },
        "languages": {
          "description": "Specifies which languages should be pushed from push.files.",
          "type": "array",
          "items": { "type": "string" }
        },
        "namespaces": {
          "description": "Specifies which namespaces should be pushed from push.files.",
          "type": "array",
          "items": { "type": "string" }
        },
        "forceMode": {
          "$ref": "#/$defs/forceMode"
        },
        "overrideKeyDescriptions": {
          "description": "Override existing key descriptions from local files (only relevant for some formats).",
          "type": "boolean"
        },
        "convertPlaceholdersToIcu": {
          "description": "Convert placeholders in local files to ICU format. (Default: true)",
          "type": "boolean"
        },
        "tagNewKeys": {
          "description": "Specify tags that will be added to newly created keys.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "removeOtherKeys": {
          "description": "Remove keys which are not present in the import (within imported namespaces).",
          "type": "boolean"
        },
        "errorOnUnresolvedConflict": {
          "$ref": "#/$defs/errorOnUnresolvedConflict"
        },
        "overrideMode": {
          "$ref": "#/$defs/overrideMode"
        }
      }
    },
    "pull": {
      "type": "object",
      "properties": {
        "path": {
          "description": "Path to a folder where the localization files are stored. (Structure itself can be defined with `fileStructureTemplate`)",
          "type": "string"
        },
        "languages": {
          "description": "List of languages to pull. Leave unspecified to export them all.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "namespaces": {
          "description": "List of namespaces to pull. Defaults to all namespaces.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "states": {
          "description": "List of translation states to include. Defaults all except untranslated.",
          "type": "array",
          "items": {
            "enum": ["UNTRANSLATED", "TRANSLATED", "REVIEWED"]
          }
        },
        "tags": {
          "description": "List of tags which to include.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excludeTags": {
          "description": "List of tags which to exclude.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "supportArrays": {
          "description": "Export keys with array syntax (e.g. item[0]) as arrays.",
          "type": "boolean"
        },
        "fileStructureTemplate": {
          "description": "Defines exported file structure: https://docs.tolgee.io/tolgee-cli/push-pull-strings#file-structure-template-format",
          "type": "string"
        },
        "emptyDir": {
          "description": "Empty [path] folder before inserting pulled files.",
          "type": "boolean"
        },
        "delimiter": {
          "description": "Structure delimiter to use. By default, Tolgee interprets `.` as a nested structure. You can change the delimiter, or disable structure formatting by not specifying any value to the option.",
          "type": ["string", "null"]
        }
      }
    },
    "sync": {
      "type": "object",
      "properties": {
        "backup": {
          "description": "Store translation files backup (only translation files, not states, comments, tags, etc.). If something goes wrong, the backup can be used to restore the project to its previous state.",
          "type": "string"
        },
        "continueOnWarning": {
          "description": "Continue the sync regardless of whether warnings are detected during string extraction. By default, as warnings may indicate an invalid extraction, the CLI will abort the sync.",
          "type": "boolean"
        },
        "removeUnused": {
          "description": "Delete unused keys from the Tolgee project (within selected namespaces if specified).",
          "type": "boolean"
        },
        "namespaces": {
          "description": "Specifies which namespaces should be synchronized.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "tag": {
      "type": "object",
      "properties": {
        "filterExtracted": {
          "description": "Extract keys from code and filter by it.",
          "type": "boolean"
        },
        "filterNotExtracted": {
          "description": "Extract keys from code and filter them out.",
          "type": "boolean"
        },
        "filterTag": {
          "description": "Filter only keys with tag. Use * as a wildcard.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "filterNoTag": {
          "description": "Filter only keys without tag. Use * as a wildcard.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tag": {
          "description": "Add tag to filtered keys.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tagOther": {
          "description": "Tag keys which are not filtered.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "untag": {
          "description": "Remove tag from filtered keys. Use * as a wildcard.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "untagOther": {
          "description": "Remove tag from keys which are not filtered. Use * as a wildcard.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "$defs": {
    "fileMatch": {
      "type": "object",
      "properties": {
        "path": { "$ref": "#/$defs/path" },
        "language": {
          "description": "Explicitly map file to language.\n\nIf not provided, backend will try to detect language from language name or it's content.",
          "type": "string"
        },
        "namespace": { "type": "string" }
      },
      "required": ["path"]
    },
    "forceMode": {
      "description": "Specifies how to solve potential conflicts in the pushed data.\n\nOptions:\n\n  `OVERRIDE` - update everything according to local files\n  `KEEP` - create only non-existent strings, don't touch existing ones\n  `NO_FORCE` - throw an error, if there are any conflict",
      "type": "string",
      "enum": ["OVERRIDE", "KEEP", "NO_FORCE"]
    },
    "overrideMode": {
      "description": "Specifies what is considered non-overridable translation: \n - RECOMMENDED - protected reviewed translations are considered as non-overridable\n - ALL - translations that user has permissions for",
      "type": "string",
      "enum": ["ALL", "RECOMMENDED"]
    },
    "errorOnUnresolvedConflict": {
      "description": "Fail the whole import if there are unresolved conflicts in import: \n - yes - fail if any unresolved conflict is present\n no - don't fail and just print unresolved conflicts\n auto - fails when when forceMode=KEEP, otherwise doesn't fail",
      "type": "string",
      "enum": ["yes", "no", "auto"]
    },
    "path": {
      "description": "File glob specifying which files to include.",
      "type": "string"
    },
    "format": {
      "description": "Localization files format for push and pull operations.",
      "enum": [
        "JSON_TOLGEE",
        "JSON_ICU",
        "JSON_I18NEXT",
        "JSON_JAVA",
        "JSON_PHP",
        "JSON_RUBY",
        "JSON_C",
        "PO_PHP",
        "PO_C",
        "PO_JAVA",
        "PO_ICU",
        "PO_RUBY",
        "PO_PYTHON",
        "PO_PYTHON_BRACE",
        "APPLE_STRINGS",
        "APPLE_XLIFF",
        "APPLE_XCSTRINGS",
        "APPLE_SDK",
        "PROPERTIES_ICU",
        "PROPERTIES_JAVA",
        "ANDROID_SDK",
        "ANDROID_XML",
        "COMPOSE_XML",
        "FLUTTER_ARB",
        "CSV_ICU",
        "CSV_JAVA",
        "CSV_PHP",
        "CSV_RUBY",
        "YAML_RUBY",
        "YAML_JAVA",
        "YAML_ICU",
        "YAML_PHP",
        "XLIFF_ICU",
        "XLIFF_JAVA",
        "XLIFF_PHP",
        "XLIFF_RUBY",
        "RESX_ICU",
        "XLSX_ICU",
        "XLSX_JAVA",
        "XLSX_PHP",
        "XLSX_RUBY"
      ]
    }
  }
}
