Expand description
Environment and .env file handling.
Enums§
- Envrc
Status - Status of
.envrcafter writing.
Functions§
- dotenv_
has_ murk_ key - Check whether
.envalready contains aMURK_KEYline. - parse_
env - Parse a .env file into key-value pairs.
Skips comments, blank lines,
MURK_*keys, and strips quotes andexportprefixes. - read_
key_ from_ dotenv - Read MURK_KEY from
.envfile if present. - resolve_
key - Resolve the secret key from
MURK_KEYorMURK_KEY_FILE.MURK_KEYtakes priority;MURK_KEY_FILEreads the key from a file. Returns the key wrapped inSecretStringso it is zeroized on drop. - warn_
env_ permissions - Warn if
.envhas loose permissions (Unix only). - write_
envrc - Write a
.envrcfile for direnv integration. - write_
key_ to_ dotenv - Write a MURK_KEY to
.env, removing any existing MURK_KEY lines. On Unix, sets file permissions to 600 atomically at creation time to prevent a TOCTOU window where the secret key is world-readable. On non-Unix platforms, permissions are not hardened.