Skip to main content

Pkl

pkl is a configuration as code language with rich validation and tooling.

🚀 Usage​

Add the following command to your CI configuration file:

fluentci run --wasm pkl eval config.pkl -f yaml -o config.yaml

Commands​

NameDescription
setupInstall pkl.
evalRender pkl module(s)
testRun tests within the given module(s)

Code Examples​

Add fluentci-pdk crate to your Cargo.toml:

[dependencies]
fluentci-pdk = "0.2.1"

Use the following code to call a module function:

use fluentci_pdk::dag;

// ...

dag().call("https://pkg.fluentci.io/[email protected]?wasm=1", "eval", vec!["config.pkl", "-f", "yaml", "-o", "config.yaml"])?;

CI/CD Integration​

The following example demonstrates how to integrate pkl with popular CI providers to render a configuration file using pkl:

ci.yml
name: ci
on:
push:
branches:
- main
jobs:
tasks:
runs-on: ubuntu-latest
steps:
- uses: actions/testout@v2
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: pkl
args: |
eval config.pkl -f yaml -o config.yaml