How to evaluate an expression in the CLI #707
-
I tried |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
You're right that there's no way to just evaluate an expression in isolation (similar to $ alias pklx='pkl eval /dev/null -x'
$ pklx '1 + 2'
3 There's some discussion and example for |
Beta Was this translation helpful? Give feedback.
You're right that there's no way to just evaluate an expression in isolation (similar to
jq -n
). I found myself runningpkl eval -x '...' /dev/null
on occasion when I needed that so I ended up defining a shell alias:There's some discussion and example for
-x
here: https://pkl-lang.org/main/current/pkl-cli/index.html#options