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/config.toml. For many users, this will be located at
13 $HOME/.config/direnv/config.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 Specifying whitelist directives marks specific directory hierarchies or
40 specific directories as "trusted" -- direnv will evaluate any matching
41 .envrc files regardless of whether they have been specifically allowed.
42 This feature should be used with great care, as anyone with the ability
43 to write files to that directory (including collaborators on VCS repos‐
44 itories) will be able to execute arbitrary code on your computer.
45
46
47 There are two types of whitelist directives supported:
48
49
50 prefix
51 Accepts an array of strings. If any of the strings in this list are a
52 prefix of an .envrc file's absolute path, that file will be implicitly
53 allowed, regardless of contents or past usage of direnv allow or direnv
54 deny.
55
56
57 Example:
58
59
60 [whitelist]
61 prefix = [ "/home/user/code/project-a" ]
62
63
64
65 In this example, the following .envrc files will be implicitly allowed:
66
67 · /home/user/code/project-a/.envrc
68
69 · /home/user/code/project-a/subdir/.envrc
70
71 · and so on
72
73
74 In this example, the following .envrc files will not be implicitly
75 allowed (although they can be explicitly allowed by running direnv
76 allow):
77
78 · /home/user/project-b/.envrc
79
80 · /opt/random/.envrc
81
82
83 exact
84 Accepts an array of strings. Each string can be a directory name or the
85 full path to an .envrc file. If a directory name is passed, it will be
86 treated as if it had been passed as itself with /.envrc appended. After
87 resolving the filename, each string will be checked for being an exact
88 match with an .envrc file's absolute path. If they match exactly, that
89 .envrc file will be implicitly allowed, regardless of contents or past
90 usage of direnv allow or direnv deny.
91
92
93 Example:
94
95
96 [whitelist]
97 exact = [ "/home/user/project-b/.envrc", "/home/user/project-b/subdir-a" ]
98
99
100
101 In this example, the following .envrc files will be implicitly allowed,
102 and no others:
103
104 · /home/user/code/project-b/.envrc
105
106 · /home/user/code/project-b/subdir-a
107
108
109 In this example, the following .envrc files will not be implicitly
110 allowed (although they can be explicitly allowed by running direnv
111 allow):
112
113 · /home/user/code/project-b/subproject-c/.envrc
114
115 · /home/user/code/.envrc
116
117
119 This allows one to hard-code the position of bash. It maybe be useful
120 to set this to avoid having direnv to fail when PATH is being mutated.
121
122
124 If set to true, stdin is disabled (redirected to /dev/null) during the
125 .envrc evaluation.
126
127
129 Copyright (C) 2018 zimbatm ⟨http://zimbatm.com⟩ and contributors under
130 the MIT licence.
131
132
134 direnv(1)
135
136
137
138direnv FEBRUARY 2018 DIRENV.TOML(1)