mirror of
https://github.com/apple/pkl.git
synced 2026-03-04 07:00:07 +01:00
TOML support #42
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @padhia on GitHub (Feb 7, 2024).
Hi, just came here to check Pkl out. Unless it's hidden somewhere, I didn't see TOML being supported as an output format. Would it be possible to add TOML support?
Thanks!
@bioball commented on GitHub (Feb 7, 2024):
Hi, at the moment, TOML support is implemented via a package, rather than in the standard library.
https://pkl-lang.org/package-docs/pkg.pkl-lang.org/pkl-pantry/pkl.toml/current/index.html
You can render TOML via:
@padhia commented on GitHub (Feb 7, 2024):
Thank you for the link. Please consider adding TOML to a future version of the CLI to make generating TOML files easier.
@zaxebo1 commented on GitHub (Feb 12, 2024):
toml is extremely popular configuration/interchange format. Kindly do consider it adding it in the mainstream code
@bioball commented on GitHub (Feb 23, 2024):
We're working on it!
@brimworks commented on GitHub (Jul 10, 2025):
Any updates on supporting TOML? Our team is a bit weary of downloading arbitrary code off the internet just to get toml support.
@bioball commented on GitHub (Jul 10, 2025):
pkl.tomlis a package that you can include as a dependency in a project. This means that its integrity is verified whenever it is downloaded, and can also vendor inside your repo (by setting the cache dir to a local relative path).To use toml as a dependency, your PklProject should have:
You'll then want to run
pkl project resolveto create aPklProject.deps.jsonfile in the same folder. Once you have that, you can import toml using dependency notation:Or, if you don't want to use projects for some reason, you can also specify the SHA checksum as part of the import itself:
All this to say: you shouldn't need to be concerned about the TOML package as coming from the internet.