← 返回命令列表

Linux command

pkl 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

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

说明

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.

参数

eval _FILE_
Evaluate configuration.
check _FILE_
Validate syntax.
repl
Start interactive mode.
-f _FORMAT_
Output format.
--help
Display help.

FAQ

What is the pkl command used for?

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.

How do I run a basic pkl example?

Run `pkl eval [config.pkl]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does eval _FILE_ do in pkl?

Evaluate configuration.