{
  "id": "opa",
  "name": "Open Policy Agent",
  "description": "Policy engine for evaluating, testing and formatting Rego policies.",
  "homepage": "https://www.openpolicyagent.org",
  "executables": [
    "opa"
  ],
  "commands": {
    "format": 1,
    "label": "Open Policy Agent",
    "description": "Common opa jobs: evaluate a query, run tests, format Rego.",
    "quality": "ai-draft",
    "base": "fig:opa",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/opa.ts",
        "license": "MIT"
      }
    ],
    "subcommand": [
      {
        "path": [
          "eval"
        ],
        "label": "Evaluate a query",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/opa.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "query",
            "label": "Query",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "data",
            "label": "Policy or data files",
            "type": "path",
            "option": [
              "-d",
              "--data"
            ],
            "multiple": true,
            "path": {
              "kind": "any",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "input",
            "label": "Input file",
            "type": "path",
            "option": [
              "-i",
              "--input"
            ],
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "format",
            "label": "Output format",
            "type": "string",
            "option": [
              "-f",
              "--format"
            ],
            "suggestions": [
              {
                "value": "json",
                "label": "JSON"
              },
              {
                "value": "pretty",
                "label": "Pretty"
              },
              {
                "value": "raw",
                "label": "Raw"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "fail",
            "label": "Fail on undefined result",
            "type": "boolean",
            "option": [
              "--fail"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "coverage",
            "label": "Report coverage",
            "type": "boolean",
            "option": [
              "--coverage"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "eval",
            "label": "Evaluate",
            "fields": [
              "query",
              "data",
              "input",
              "format",
              "fail"
            ],
            "required": [
              "query"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "query",
              "data",
              "input",
              "format"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "fail",
              "coverage"
            ]
          }
        ]
      },
      {
        "path": [
          "test"
        ],
        "label": "Run Rego tests",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/opa.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "paths",
            "label": "Test paths",
            "type": "path",
            "position": 0,
            "multiple": true,
            "path": {
              "kind": "any",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "run",
            "label": "Run matching tests (regex)",
            "type": "string",
            "option": [
              "-r",
              "--run"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "verbose",
            "label": "Verbose",
            "type": "boolean",
            "option": [
              "-v",
              "--verbose"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "coverage",
            "label": "Report coverage",
            "type": "boolean",
            "option": [
              "-c",
              "--coverage"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "test",
            "label": "Run tests",
            "fields": [
              "paths",
              "run",
              "verbose",
              "coverage"
            ],
            "required": [
              "paths"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "paths",
              "run",
              "verbose",
              "coverage"
            ]
          }
        ]
      },
      {
        "path": [
          "fmt"
        ],
        "label": "Format Rego files",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/opa.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "paths",
            "label": "Rego files or directories",
            "type": "path",
            "position": 0,
            "multiple": true,
            "path": {
              "kind": "any",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "write",
            "label": "Overwrite files",
            "type": "boolean",
            "option": [
              "-w",
              "--write"
            ],
            "effect": "overwrite",
            "sources": [
              "fig"
            ]
          },
          {
            "id": "diff",
            "label": "Show diff only",
            "type": "boolean",
            "option": [
              "-d",
              "--diff"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "list",
            "label": "List files that would change",
            "type": "boolean",
            "option": [
              "-l",
              "--list"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "preview",
            "label": "Preview changes",
            "set": {
              "diff": [
                true
              ]
            },
            "fields": [
              "paths",
              "diff"
            ],
            "required": [
              "paths"
            ]
          },
          {
            "id": "write",
            "label": "Format in place",
            "set": {
              "write": [
                true
              ]
            },
            "fields": [
              "paths",
              "write"
            ],
            "required": [
              "paths"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "paths",
              "write",
              "diff",
              "list"
            ]
          }
        ]
      }
    ]
  }
}
