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 } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/opa.ts" license = "MIT" [[commands.subcommand]] path = ["eval"] label = "Evaluate a query" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/opa.ts" license = "MIT" [[commands.subcommand.field]] id = "query" label = "Query" type = "string" position = 0 sources = ["fig"] [[commands.subcommand.field]] id = "data" label = "Policy or data files" type = "path" option = ["-d", "--data"] multiple = true path = { kind = "any", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "input" label = "Input file" type = "path" option = ["-i", "--input"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] 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"] [[commands.subcommand.field]] id = "fail" label = "Fail on undefined result" type = "boolean" option = ["--fail"] sources = ["fig"] [[commands.subcommand.field]] id = "coverage" label = "Report coverage" type = "boolean" option = ["--coverage"] sources = ["fig"] [[commands.subcommand.task]] id = "eval" label = "Evaluate" fields = ["query", "data", "input", "format", "fail"] required = ["query"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["query", "data", "input", "format"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["fail", "coverage"] [[commands.subcommand]] path = ["test"] label = "Run Rego tests" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/opa.ts" license = "MIT" [[commands.subcommand.field]] id = "paths" label = "Test paths" type = "path" position = 0 multiple = true path = { kind = "any", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "run" label = "Run matching tests (regex)" type = "string" option = ["-r", "--run"] sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["-v", "--verbose"] sources = ["fig"] [[commands.subcommand.field]] id = "coverage" label = "Report coverage" type = "boolean" option = ["-c", "--coverage"] sources = ["fig"] [[commands.subcommand.task]] id = "test" label = "Run tests" fields = ["paths", "run", "verbose", "coverage"] required = ["paths"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["paths", "run", "verbose", "coverage"] [[commands.subcommand]] path = ["fmt"] label = "Format Rego files" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/opa.ts" license = "MIT" [[commands.subcommand.field]] id = "paths" label = "Rego files or directories" type = "path" position = 0 multiple = true path = { kind = "any", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "write" label = "Overwrite files" type = "boolean" option = ["-w", "--write"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "diff" label = "Show diff only" type = "boolean" option = ["-d", "--diff"] sources = ["fig"] [[commands.subcommand.field]] id = "list" label = "List files that would change" type = "boolean" option = ["-l", "--list"] sources = ["fig"] [[commands.subcommand.task]] id = "preview" label = "Preview changes" set = { diff = [true] } fields = ["paths", "diff"] required = ["paths"] [[commands.subcommand.task]] id = "write" label = "Format in place" set = { write = [true] } fields = ["paths", "write"] required = ["paths"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["paths", "write", "diff", "list"]