opa icon indicating copy to clipboard operation
opa copied to clipboard

Add OPA Playground evaluate, publish commands to the cli

Open developer-guy opened this issue 3 years ago • 3 comments

It would be nice if we can add playground capabilities to the OPA CLI, for example, publish, also, open the local folder on the playground page.

Expected Behavior

$ opa publish --rego policy.rego --input input.json --data data.json
https://play.openpolicyagent.org/p/pluFLZm5T7

$ opa playground --policy-dir ./policy <-- maybe, we can define a folder template to be able to open this folder on the playground, for example, it has to include rego, input, and data files.

Actual Behavior

There is no support for that kind of scenario.

Additional Info

The Rego Playground has many useful APIs to use it. https://play.openpolicyagent.org/v1/share <-- get a shareable link https://play.openpolicyagent.org/v1/data <-- evaluate the policy against data and input

we can use them in the CLI to add that kind of capabilities.

developer-guy avatar Mar 05 '21 18:03 developer-guy

@srenatus do you think it makes sense ? 🙏

developer-guy avatar Mar 05 '21 19:03 developer-guy

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Nov 22 '21 21:11 stale[bot]

@developer-guy I don't think we'll want to couple the OPA executable to the Rego playground. Is there are any particular features in the playground you find missing in the editor plugins for VS Code or IntelliJ IDEA?

anderseknert avatar Jun 08 '22 11:06 anderseknert

Closing for now. We can re-visit in future based on use-case, demand etc.

ashutosh-narkar avatar Oct 02 '23 22:10 ashutosh-narkar