Files
iris-context/commands/ops/opa.go
T
VERSE ebde9ba68f refactor(commands): separate commands and its core into two folders (#32)
- I think it would be better if one for commands only, one for the spec
handling core logic so people won't be confused by the core logic inside
the commands folder (cleaner I guess)
- Regen docs
2026-07-05 11:27:30 +07:00

76 lines
4.6 KiB
Go

package ops
import (
"github.com/versenilvis/iris/spec"
)
func init() {
spec.Register(&spec.Spec{
Name: "opa",
Description: "Open Policy Agent (OPA)",
Subcommands: []spec.Subcommand{
{Name: "bench", Description: "Benchmark a Rego query"},
{Name: "build", Description: "Build an OPA bundle"},
{Name: "check", Description: "Check Rego source files"},
{Name: "completion", Description: "Generate the autocompletion script for the specified shell"},
{Name: "bash", Description: "Generate the autocompletion script for bash"},
{Name: "fish", Description: "Generate the autocompletion script for fish"},
{Name: "powershell", Description: "Generate the autocompletion script for powershell"},
{Name: "zsh", Description: "Generate the autocompletion script for zsh"},
{Name: "deps", Description: "Analyze Rego query dependencies"},
{Name: "eval", Description: "Evaluate a Rego query"},
{Name: "exec", Description: "Execute against input files"},
{Name: "fmt", Description: "Format Rego source files"},
{Name: "inspect", Description: "Inspect OPA bundle(s)"},
{Name: "parse", Description: "Parse Rego source file"},
{Name: "run", Description: "Start OPA in interactive or server mode"},
{Name: "sign", Description: "Generate an OPA bundle signature"},
{Name: "test", Description: "Execute Rego test cases"},
{Name: "version", Description: "Print the version of OPA"},
{Name: "help", Description: "Help about any command"},
},
Options: []spec.Option{
{Name: "--benchmem", Description: "Report memory allocations with benchmark results"},
{Name: "--bundle", Description: "Set bundle file(s) or directory path(s). This flag can be repeated"},
{Name: "--count", Description: "Number of times to repeat each benchmark"},
{Name: "--data", Description: "Set policy or data file(s). This flag can be repeated"},
{Name: "--fail", Description: "Exits with non-zero exit code on undefined/empty result and errors"},
{Name: "--format", Description: "Set output format"},
{Name: "--ignore", Description: "Set query import(s). This flag can be repeated"},
{Name: "--input", Description: "Set input file path"},
{Name: "--metrics", Description: "Report query performance metrics"},
{Name: "--package", Description: "Set query package"},
{Name: "--partial", Description: "Perform partial evaluation"},
{Name: "--schema", Description: "Set schema file path or directory path"},
{Name: "--stdin", Description: "Read query from stdin"},
{Name: "--stdin-input", Description: "Read input document from stdin"},
{Name: "--target", Description: "Set the runtime to exercise"},
{Name: "--unknowns", Description: "Set paths to treat as unknown during partial evaluation"},
{Name: "--help", Description: "Help for bench"},
{Name: "--capabilities", Description: "Set capabilities.json file path"},
{Name: "--claims-file", Description: "Enable debug output"},
{Name: "--entrypoint", Description: "Set slash separated entrypoint path"},
{Name: "--exclude-files-verify", Description: "Set file names to exclude during bundle verification"},
{Name: "--output", Description: "Set the output filename"},
{Name: "--revision", Description: "Set output bundle revision"},
{Name: "--scope", Description: "Scope to use for bundle signature verification"},
{Name: "--signing-alg", Description: "Name of the signing algorithm"},
{Name: "--signing-key", Description: "Set the output bundle target type"},
{Name: "--verification-key", Description: "Name assigned to the verification key used for bundle verification"},
{Name: "--strict", Description: "Enable compiler strict mode"},
{Name: "--no-descriptions", Description: "Disable completion descriptions"},
{Name: "--coverage", Description: "Report coverage"},
{Name: "--disable-early-exit", Description: "Disable 'early exit' optimizations"},
{Name: "--disable-indexing", Description: "Disable indexing optimizations"},
{Name: "--disable-inlining", Description: "Set paths of documents to exclude from inlining"},
{Name: "--explain", Description: "Enable query explanations"},
{Name: "--fail-defined", Description: "Exits with non-zero exit code on defined/non-empty result and errors"},
{Name: "--instrument", Description: "Enable query instrumentation metrics (implies --metrics)"},
{Name: "--pretty-limit", Description: "Set limit after which pretty output gets truncated"},
{Name: "--profile", Description: "Perform expression profiling"},
{Name: "--profile-limit", Description: "Set number of profiling results to show"},
{Name: "--profile-sort", Description: "Set sort order of expression profiler results"},
},
})
}