1DIRENV.TOML(1)                   User Manuals                   DIRENV.TOML(1)
2
3
4

NAME

6       direnv.toml - the direnv configuration file
7
8

DESCRIPTION

10       A configuration file in TOML ⟨https://github.com/toml-lang/toml⟩ format
11       to specify a variety of configuration options for direnv. The  file  is
12       read from $XDG_CONFIG_HOME/direnv/direnv.toml.
13
14
15              For  versions  v2.21.0  and below use config.toml instead of di‐
16              renv.toml
17
18
19

FORMAT

21       See the TOML GitHub Repository ⟨https://github.com/toml-lang/toml⟩  for
22       details about the syntax of the configuration file.
23
24

CONFIG

26       The  configuration  is  specified in sections which each have their own
27       top-level   tables   ⟨https://github.com/toml-lang/toml#table⟩,    with
28       key/value pairs specified in each section.
29
30
31       Example:
32
33
34              [section]
35              key = "value"
36
37
38
39       The following sections are supported:
40
41

[global]

43   bash_path
44       This  allows  one to hard-code the position of bash. It maybe be useful
45       to set this to avoid having direnv to fail when PATH is being mutated.
46
47
48   disable_stdin
49       If set to true, stdin is disabled (redirected to /dev/null) during  the
50       .envrc evaluation.
51
52
53   load_dotenv
54       Also  look  for and load .env files on top of the .envrc files. If both
55       .envrc and .env files exist, the .envrc will always be chosen first.
56
57
58   strict_env
59       If set to true, the .envrc will be loaded with set -euo pipefail.  This
60       option will be the default in the future.
61
62
63   warn_timeout
64       Specify  how  long  to wait before warning the user that the command is
65       taking too long to execute. Defaults to "5s".
66
67
68       A duration string is a possibly signed  sequence  of  decimal  numbers,
69       each with optional fraction and a unit suffix, such as "300ms", "-1.5h"
70       or "2h45m".  Valid time units are "ns", "us" (or "µs"), "ms", "s", "m",
71       "h".
72
73

[whitelist]

75       Specifying whitelist directives marks specific directory hierarchies or
76       specific directories as "trusted" -- direnv will evaluate any  matching
77       .envrc files regardless of whether they have been specifically allowed.
78       This feature should be used with great care, as anyone with the ability
79       to write files to that directory (including collaborators on VCS repos‐
80       itories) will be able to execute arbitrary code on your computer.
81
82
83       There are two types of whitelist directives supported:
84
85
86   prefix
87       Accepts an array of strings. If any of the strings in this list  are  a
88       prefix  of an .envrc file's absolute path, that file will be implicitly
89       allowed, regardless of contents or past usage of direnv allow or direnv
90       deny.
91
92
93       Example:
94
95
96              [whitelist]
97              prefix = [ "/home/user/code/project-a" ]
98
99
100
101       In this example, the following .envrc files will be implicitly allowed:
102
103
104/home/user/code/project-a/.envrc
105
106/home/user/code/project-a/subdir/.envrc
107
108              • and so on
109
110
111
112       In  this example, the following .envrc files will not be implicitly al‐
113       lowed (although they can be explicitly allowed by  running  direnv  al‐
114       low):
115
116
117/home/user/project-b/.envrc
118
119/opt/random/.envrc
120
121
122
123   exact
124       Accepts an array of strings. Each string can be a directory name or the
125       full path to an .envrc file. If a directory name is passed, it will  be
126       treated as if it had been passed as itself with /.envrc appended. After
127       resolving the filename, each string will be checked for being an  exact
128       match  with an .envrc file's absolute path. If they match exactly, that
129       .envrc file will be implicitly allowed, regardless of contents or  past
130       usage of direnv allow or direnv deny.
131
132
133       Example:
134
135
136              [whitelist]
137              exact = [ "/home/user/project-b/.envrc", "/home/user/project-b/subdir-a" ]
138
139
140
141       In this example, the following .envrc files will be implicitly allowed,
142       and no others:
143
144
145/home/user/code/project-b/.envrc
146
147/home/user/code/project-b/subdir-a
148
149
150
151       In this example, the following .envrc files will not be implicitly  al‐
152       lowed  (although  they  can be explicitly allowed by running direnv al‐
153       low):
154
155
156/home/user/code/project-b/subproject-c/.envrc
157
158/home/user/code/.envrc
159
160
161
163       MIT licence - Copyright (C) 2019 @zimbatm and contributors
164
165

SEE ALSO

167       direnv(1), direnv-stdlib(1)
168
169
170
171direnv                               2019                       DIRENV.TOML(1)
Impressum