Question: is this possible to use environment variable with a filling template ? #232

Closed
opened 2025-12-30 01:22:33 +01:00 by adam · 1 comment
Owner

Originally created by @alexisvisco on GitHub (Oct 28, 2024).

Hey !

Thanks you for you awesome configuration library, it is pleasant to work with.

I wonder if when filling a template it is possible to say for instance password = env("PG_PASSWORD") ?

Let me explain why : if you want to use this config in production you mght want to use env variables for sensible informations.

Originally created by @alexisvisco on GitHub (Oct 28, 2024). Hey ! Thanks you for you awesome configuration library, it is pleasant to work with. I wonder if when filling a template it is possible to say for instance `password = env("PG_PASSWORD")` ? Let me explain why : if you want to use this config in production you mght want to use env variables for sensible informations.
adam closed this issue 2025-12-30 01:22:33 +01:00
Author
Owner

@alexisvisco commented on GitHub (Oct 28, 2024):

https://pkl-lang.org/main/current/language-reference/index.html#resources

It is possible: path = read("env:PATH")

@alexisvisco commented on GitHub (Oct 28, 2024): https://pkl-lang.org/main/current/language-reference/index.html#resources It is possible: `path = read("env:PATH")`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#232