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