Environment variables in devbox shell

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. There are 2 ways to control environment variables in devbox via devbox.json:

  • Defining them inline in env as key-value pairs
  • Specifying an external file to load as a value to env_from key

All of the environment variables defined in devbox.json file are available upon entering the shell, which means that any process started within a shell will have access to them, including anything that is used with devbox run <command>. This way a program does not have to know how to load environment variables from a file.