All apps/Open Policy Agent

Open Policy Agent

opa

Policy engine for evaluating, testing and formatting Rego policies.

Runs as opa|macOS, Linux, Windows|www.openpolicyagent.org

Command form

ai-draft · 4 tasks · 14 fields

Common opa jobs: evaluate a query, run tests, format Rego.

Opens the form; the finished command lands at your prompt, unrun
otty gui opa

opa eval

Evaluate a query
Evaluate a queryExample values, fixed in this page — nothing here reaches a terminal
Basic
Query*
string
Policy or data files
any
Input file
file
Output format
string
Advanced
Fail on undefined result
--fail
TasksEach one presets the form for one job
Evaluate
querydatainputformatfail
ParametersOnly these flags are editable in the form
Query
string · positional 0
Policy or data files
path · repeatable
-d--data
Input file
path
-i--input
Output format
string
-f--formatjsonprettyraw
Fail on undefined result
boolean
--fail
Report coverage
boolean
--coverage

opa test

Run Rego tests
Run Rego testsExample values, fixed in this page — nothing here reaches a terminal
Basic
Test paths*
any
Run matching tests (regex)
string
Verbose
-v
Report coverage
-c
TasksEach one presets the form for one job
Run tests
pathsrunverbosecoverage
ParametersOnly these flags are editable in the form
Test paths
path · positional 0 · repeatable
Run matching tests (regex)
string
-r--run
Verbose
boolean
-v--verbose
Report coverage
boolean
-c--coverage

opa fmt

Format Rego files
Format Rego filesExample values, fixed in this page — nothing here reaches a terminal
Basic
Rego files or directories*
any
Show diff only
-d
TasksEach one presets the form for one job
Preview changes
pathsdiff
Format in place
pathswrite
ParametersOnly these flags are editable in the form
Rego files or directories
path · positional 0 · repeatable
Overwrite files
boolean
-w--write
Show diff only
boolean
-d--diff
List files that would change
boolean
-l--list
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed opa against its version. A form that does not match your version is not offered.