{
  "id": "openfga",
  "name": "OpenFGA CLI",
  "homepage": "https://github.com/openfga/cli",
  "description": "Cross-platform CLI for interacting with an OpenFGA server.",
  "executables": [
    "fga"
  ],
  "platforms": [
    "macos",
    "linux"
  ],
  "dotfiles": {
    "paths": [
      "~/.fga.yaml"
    ],
    "exclude": [],
    "secret": [],
    "secret_paths": [
      {
        "file": "~/.fga.yaml",
        "format": "yaml",
        "match": {
          "key_path": [
            "api-token",
            "client-secret"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "OpenFGA CLI",
    "description": "Check relationships and validate authorization models. Server credentials come from ~/.fga.yaml or FGA_* environment variables and are not part of these forms.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": false,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "query",
          "check"
        ],
        "label": "Check a relationship",
        "description": "Ask whether a user has a relation to an object. Contextual tuples and condition context are left out.",
        "source": [
          {
            "id": "readme",
            "kind": "manual",
            "url": "https://github.com/openfga/cli",
            "evidence": "fga query **check** <user> <relation> <object> [--condition] [--contextual-tuple \"\\<user\\> \\<relation\\> \\<object\\>\"]* --store-id=<store-id> [--model-id=<model-id>]\n* `--store-id`: Specifies the store id\n* `--model-id`: Specifies the model id to target (optional)\n"
          }
        ],
        "field": [
          {
            "id": "store_id",
            "label": "Store ID",
            "type": "string",
            "option": [
              "--store-id"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "model_id",
            "label": "Authorization model ID",
            "type": "string",
            "option": [
              "--model-id"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "user",
            "label": "User",
            "description": "For example user:anne.",
            "type": "string",
            "position": 0,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "relation",
            "label": "Relation",
            "type": "string",
            "position": 1,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "object",
            "label": "Object",
            "description": "For example document:roadmap.",
            "type": "string",
            "position": 2,
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "check",
            "label": "Check",
            "fields": [
              "store_id",
              "model_id",
              "user",
              "relation",
              "object"
            ],
            "required": [
              "store_id",
              "user",
              "relation",
              "object"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "store_id",
              "user",
              "relation",
              "object",
              "model_id"
            ]
          }
        ]
      },
      {
        "path": [
          "model",
          "validate"
        ],
        "label": "Validate a model",
        "description": "Validate an authorization model file without a server.",
        "source": [
          {
            "id": "readme",
            "kind": "manual",
            "url": "https://github.com/openfga/cli",
            "evidence": "* `--file`: File containing the authorization model.\n* `--format`: Authorization model input format. Can be \"fga\", \"json\", or \"modular\". Defaults to the file extension if provided (optional)\n"
          }
        ],
        "field": [
          {
            "id": "file",
            "label": "Model file",
            "type": "path",
            "option": [
              "--file"
            ],
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "readme"
            ]
          },
          {
            "id": "format",
            "label": "Input format",
            "type": "enum",
            "option": [
              "--format"
            ],
            "choices": [
              {
                "value": "fga",
                "label": "fga"
              },
              {
                "value": "json",
                "label": "json"
              },
              {
                "value": "modular",
                "label": "modular"
              }
            ],
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "validate",
            "label": "Validate",
            "fields": [
              "file",
              "format"
            ],
            "required": [
              "file"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "file",
              "format"
            ]
          }
        ]
      }
    ]
  }
}
