ENVDOT(1p)

πŸ“¦
version 0.022 Β· 3 versions
, in ubuntu stonking

✨ NAME ✨

okay so envdot β€” she reads your .env file and turns everything inside it into environment variables, for a bunch of different shells πŸ’–


🌸 VERSION 🌸

this is version 0.022 bestie, no cap ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

envdot [options]

    eval `envdot`

Options:

    --help
    --man
    --version
    --export --no-export
    --shell -s
    --dotenv -e

πŸŽ€ CLI interface without dependencies πŸŽ€

the envdot command also ships as a self contained executable, which is literally the best thing. you can just download it and run it as-is, no installing CPAN packages required 🫢 obviously you still need Perl, but like… Perl comes with literally any normal Linux install, so we're fine.

this is highkey convenient if you wanna, for example, drop envdot into a docker container build 🐳

curl -LSs -o envdot https://raw.githubusercontent.com/mikkoi/env-dot/main/envdot.self-contained
chmod +x ./envdot

πŸ’œ DESCRIPTION πŸ’œ

envdot reads your .env file and converts it into environment variable commands that suit different shells (shell families): sh, csh and fish. three vibes, one tool, periodt πŸ’…

now, .env files can be written in different flavors. envdot supports the often used sh compatible flavor and the docker flavor β€” and heads up, those two are not compatible with each other πŸ™ˆ so know which one you're writing.

if you've got several .env files (main character with options, we love that), you can read them all in at one go with the environment variable ENVDOT_FILEPATHS. just separate the full paths with the : character ✨

Env::Dot will load the files in reverse order, starting from the last. this is the exact same ordering as the PATH variable: the first one overrules the following ones β€” so when reading from the last path to the first path, if the same variable shows up in more than one file, the later one replaces the one already read πŸ‘‘

if you've set ENVDOT_FILEPATHS, then envdot will use that. otherwise? it uses the command line parameter. and if there's no parameter at all, then the default value is used. default is the file .env in the current directory πŸ’–

🌈 NAME (yes, again, she said it twice, iconic) 🌈

envdot β€” Read .env file and turn its content into environment variables for different shells. πŸ’«


✨ OPTIONS ✨

  • --help β€” prints a brief help message and then exits. quick lil hello πŸ‘‹
  • --man β€” prints the manual page and exits. yes bestie, the whole thing πŸ“–
  • --version β€” prints the version and exits ⭐
  • --export, --no-export β€” write commands to set variables for the local shell, or to export them. you usually wanna export the variables to all subsequent programs and subshells, aka make them into actual environment variables πŸ’…

Default: export

  • -s, --shell β€” which shell (family) are you using? supported: sh, csh, fish 🐚

Default: sh

  • -e, --dotenv β€” path to the .env file πŸ“

Default: current directory .env


🌟 EXAMPLES 🌟

    eval `envdot --no-export --shell csh`

    eval `envdot --dotenv subdir/.env`

    ENVDOT_FILEPATHS='../.env:subdir/.env:.env' eval `envdot`

look at her go πŸ˜­πŸ’–


🧚 DEPENDENCIES 🧚

no external dependencies outside Perl's standard distribution. she's low maintenance, she's self-sufficient, she's THAT girl πŸ‘‘


πŸ’€ SEE ALSO πŸ’€

Env::Assert will verify that you definitely, for sure have those environmental variables you need. it also has an executable which can, for example, perform the check at the beginning of a docker container run 🐳✨

Dotenv and ENV::Util <https://metacpan.org/pod/ENV::Util> are packages which also implement functionality to use .env files in Perl.

Config::ENV and Config::Layered::Source::ENV provide other means to configure an application with the help of environment variables πŸ’œ

shdotenv <https://github.com/ko1nksm/shdotenv> is a project to provide dotenv for shells with support for POSIX-compliant and multiple .env file syntax 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Mikko Koivunalho <mikkoi@cpan.org> 🫢


this software is copyright (c) 2023 by Mikko Koivunalho.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself πŸ’–


and that's the whole thing bestie!! this page came to you via perl v5.40.1, dated 2026-05-09, and it's the ENVDOT(1p) page from the User Contributed Perl Documentation ✨ slay, go set some env vars πŸ’…πŸŒΈ

πŸ“¦ where this page comes from