whatisgithub

What is pkl?

apple/pkl — explained in plain English

Analysis updated 2026-05-18

11,347JavaAudience · developerComplexity · 3/5Setup · moderate

In one sentence

Pkl is a configuration-as-code language from Apple that adds types, validation, and reusable templates to configuration files, outputting to JSON, YAML, or other formats.

Mindmap

mindmap
  root((Pkl))
    What it does
      Configuration language
      Validation at gen time
      Reusable templates
    Output formats
      JSON
      YAML
      Other formats
    Integrations
      VS Code plugin
      IntelliJ plugin
      Go bindings
      Swift bindings
    Ecosystems
      Kubernetes templates
      Bazel build rules
      JVM languages
    Use cases
      App configuration
      Service configs
      Design systems
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Replace a YAML configuration file with Pkl so invalid values are caught at generation time, not at runtime.

USE CASE 2

Write a shared configuration template that multiple services can extend with their own values.

USE CASE 3

Configure a Kubernetes deployment using the official Pkl Kubernetes templates.

USE CASE 4

Read and validate Pkl configuration files directly from a Go or Swift application using the official bindings.

What is it built with?

JavaGoSwift

How does it compare?

apple/pklmission-peace/interviewjhy/jsoup
Stars11,34711,34111,365
LanguageJavaJavaJava
Setup difficultymoderatemoderateeasy
Complexity3/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

So what is it?

Pkl (pronounced "pickle") is a programming language for writing configuration files, created by Apple and released as open source. The problem it solves is that YAML and JSON files, which are widely used for configuration in software projects, have no built-in way to validate their contents. Pkl lets you write configuration with types, constraints, and reusable templates, so errors are caught at generation time rather than when the configuration is applied at runtime. A Pkl file describes a configuration structure that can be checked against rules you define in the language itself. For example, you can specify that a port number must be between 1 and 65535, or that a hostname must match a particular pattern. When you generate the final configuration output, Pkl checks these rules and reports any violations. The output can be formatted as JSON, YAML, or other formats that your existing tools already understand. The language integrates with common development environments. There are editor plugins for VS Code, IntelliJ IDEA, and Neovim that provide syntax highlighting and autocomplete. There are bindings for Go, Swift, and JVM-based languages so Pkl configurations can be read and validated directly from application code. Official Kubernetes templates and Bazel build rules are also available if you work in those ecosystems. The full documentation lives at pkl-lang.org and includes an introduction, a language reference, and worked examples. Contributions, questions, and suggested language improvements are managed through GitHub issues, discussions, and a separate repository called pkl-evolution for larger change proposals. Pkl is an open source project from Apple.

Copy-paste prompts

Prompt 1
How do I define a Pkl configuration file that validates port numbers and rejects values outside 1 to 65535?
Prompt 2
I want to generate YAML from a Pkl configuration. Show me the command and a simple example.
Prompt 3
How do I set up Pkl in VS Code and what autocomplete features does the extension provide?
Prompt 4
Create a Pkl template for a microservice configuration that other services can extend with custom overrides.
Prompt 5
How do I read a Pkl configuration file from a Go application using the official pkl-go bindings?

Frequently asked questions

What is pkl?

Pkl is a configuration-as-code language from Apple that adds types, validation, and reusable templates to configuration files, outputting to JSON, YAML, or other formats.

What language is pkl written in?

Mainly Java. The stack also includes Java, Go, Swift.

How hard is pkl to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is pkl for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.