pkl

Programmable configuration language from Apple

TLDR

Evaluate Pkl file
$ pkl eval [config.pkl]
Output as JSON
$ pkl eval -f json [config.pkl]
Output as YAML
$ pkl eval -f yaml [config.pkl]
Check syntax
$ pkl check [config.pkl]
Start REPL
$ pkl repl

SYNOPSIS

pkl [command] [options] [file]

DESCRIPTION

pkl is a programmable configuration language developed by Apple. It evaluates .pkl files and generates output in multiple formats including JSON, YAML, XML, and property lists, combining the readability of static configuration with the power of a programming language.Pkl provides type safety, validation, and code reuse through classes and modules, catching configuration errors at evaluation time rather than at deployment. The REPL mode allows interactive exploration and testing of configuration expressions.

PARAMETERS

eval FILE

Evaluate configuration.
check FILE
Validate syntax.
repl
Start interactive mode.
-f FORMAT
Output format.
--help
Display help.

INSTALL

brew install pkl
nix profile install nixpkgs#pkl

CAVEATS

Pkl files can import modules from the network, which may have security implications. The language requires a JVM-based runtime or native binaries for evaluation.

HISTORY

Pkl was created by Apple and open-sourced in February 2024 as a type-safe, programmable configuration language.

SEE ALSO

jsonnet(1), dhall(1)