1DIRENV.TOML(1) User Manuals DIRENV.TOML(1)
2
3
4
6 direnv.toml - the direnv configuration file
7
8
10 A configuration file in TOML ⟨https://github.com/toml-lang/toml⟩ format
11 to specify a variety of configuration options for direnv. Read from at
12 CONFIGURATION_DIR/direnv.toml or $DIRENV_CONFIG/direnv.toml. For many
13 users, CONFIGURATION_DIR will be located at $HOME/.con‐
14 fig/direnv/direnv.toml.
15
16
18 See the TOML GitHub Repository ⟨https://github.com/toml-lang/toml⟩ for
19 details about the syntax of the configuration file.
20
21
23 The configuration is specified in sections which each have their own
24 top-level tables ⟨https://github.com/toml-lang/toml#table⟩, with
25 key/value pairs specified in each section.
26
27
28 Example:
29
30
31 [section]
32 key = "value"
33
34
35
36 The following sections are supported:
37
38
40 bash_path
41 This allows one to hard-code the position of bash. It maybe be useful
42 to set this to avoid having direnv to fail when PATH is being mutated.
43
44
45 disable_stdin
46 If set to true, stdin is disabled (redirected to /dev/null) during the
47 .envrc evaluation.
48
49
50 strict_env
51 If set to true, the .envrc will be loaded with set -euo pipefail. This
52 option will be the default in the future.
53
54
55 warn_timeout
56 Specify how long to wait before warning the user that the command is
57 taking too long to execute. Defaults to "5s".
58
59
60 A duration string is a possibly signed sequence of decimal numbers,
61 each with optional fraction and a unit suffix, such as "300ms", "-1.5h"
62 or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m",
63 "h".
64
65
67 Specifying whitelist directives marks specific directory hierarchies or
68 specific directories as "trusted" -- direnv will evaluate any matching
69 .envrc files regardless of whether they have been specifically allowed.
70 This feature should be used with great care, as anyone with the ability
71 to write files to that directory (including collaborators on VCS repos‐
72 itories) will be able to execute arbitrary code on your computer.
73
74
75 There are two types of whitelist directives supported:
76
77
78 prefix
79 Accepts an array of strings. If any of the strings in this list are a
80 prefix of an .envrc file's absolute path, that file will be implicitly
81 allowed, regardless of contents or past usage of direnv allow or direnv
82 deny.
83
84
85 Example:
86
87
88 [whitelist]
89 prefix = [ "/home/user/code/project-a" ]
90
91
92
93 In this example, the following .envrc files will be implicitly allowed:
94
95 · /home/user/code/project-a/.envrc
96
97 · /home/user/code/project-a/subdir/.envrc
98
99 · and so on
100
101
102 In this example, the following .envrc files will not be implicitly
103 allowed (although they can be explicitly allowed by running direnv
104 allow):
105
106 · /home/user/project-b/.envrc
107
108 · /opt/random/.envrc
109
110
111 exact
112 Accepts an array of strings. Each string can be a directory name or the
113 full path to an .envrc file. If a directory name is passed, it will be
114 treated as if it had been passed as itself with /.envrc appended. After
115 resolving the filename, each string will be checked for being an exact
116 match with an .envrc file's absolute path. If they match exactly, that
117 .envrc file will be implicitly allowed, regardless of contents or past
118 usage of direnv allow or direnv deny.
119
120
121 Example:
122
123
124 [whitelist]
125 exact = [ "/home/user/project-b/.envrc", "/home/user/project-b/subdir-a" ]
126
127
128
129 In this example, the following .envrc files will be implicitly allowed,
130 and no others:
131
132 · /home/user/code/project-b/.envrc
133
134 · /home/user/code/project-b/subdir-a
135
136
137 In this example, the following .envrc files will not be implicitly
138 allowed (although they can be explicitly allowed by running direnv
139 allow):
140
141 · /home/user/code/project-b/subproject-c/.envrc
142
143 · /home/user/code/.envrc
144
145
147 MIT licence - Copyright (C) 2019 @zimbatm and contributors
148
149
151 direnv(1), direnv-stdlib(1)
152
153
154
155direnv 2019 DIRENV.TOML(1)