Skip to content

jpbetz/cel-playground

Repository files navigation

CEL Playground

Evaluate a CEL expression against a yaml file:

./cel-playground eval --expr "deployment.spec.replicas > 10" --variables deployment=test/deployment.yaml

Run a playground server:

./cel-playground serve

Send a request to the server:

curl localhost:8080/eval \
  -H "Content-Type: application/yaml" \
  -X POST \
  -d '{"expression": "1 < x", "variables": {"x": 2}}'

Run a playground UI:

# run a playground server first (see above)

cd ui/cel-playground
npm run start

TODO

  • Include a Web UI in the playground server
  • Share playgrounds with links (encode data in link for small playgrounds, need storage backend for larger playgrouns)
  • Support OpenAPIv3 schemas and compilation (e.g. `--schemas deployment=test/deployment-openapiv3.yaml)
  • Support context cancelation and cost limits

About

Evaluate CEL expressions against yaml files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published