
Pkl Has a Free API — Heres How Apple Reinvented Configuration Files
Pkl (pronounced 'pickle') is Apple's new configuration language — type-safe, composable, and generates JSON, YAML, or any format. Replace your brittle YAML with something that actually catches errors. Why Pkl? Type-safe : Catch config errors before deployment Composable : Inherit, extend, amend configurations Multi-output : Generate JSON, YAML, XML, properties IDE support : Autocomplete, go-to-definition Validation : Built-in constraints Apple-backed : Open source from Apple Install # macOS brew install pkl # Linux curl -L https://github.com/apple/pkl/releases/latest/download/pkl-linux-amd64 -o pkl chmod +x pkl Basic Config // config.pkl name = "my-app" version = "1.2.3" server { host = "0.0.0.0" port = 8080 maxConnections = 100 } database { url = "postgres://localhost:5432/mydb" pool { min = 5 max = 20 } } Generate JSON: pkl eval config.pkl -f json Type Safety class ServerConfig { host: String port: Int(isBetween(1, 65535)) maxConnections: Int(isPositive) tls: Boolean = false } class
Continue reading on Dev.to Tutorial
Opens in a new tab
