๐ง Valet configuration
Valet is configurable through environment variables.
There are several ways to make that configuration (and thus the Valet variables) permanent:
- Define variables in your
~/.bashrc
script which is sourced when starting bash. - Other methods:
/etc/environment
, ~/.profile
or ~/.bash_profile
In Valet, you can also set variables in special bash scripts which are sourced when the program starts. These scripts are:
~/.config/valet/config
: the Valet configuration file (this is the recommended way to configure Valet itself).~/.config/valet/startup
: a custom script that is itself sourced by ~/.config/valet/config
which can be used to define or manipulate variables on startup../.env
: a .env
in the current directory.
๐ Valet configuration file
Use the valet self config
command to open the YAML configuration file.
This will also create the file if it does not exist.
Check valet self config --help
for more options regarding the configuration.
We give below the default content of the configuration file, which contains comments for each config variable.
~/.config/valet/config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
| #!/usr/bin/env bash
# description: This script declares global variables used to configure Valet
# shellcheck disable=SC2034
# This file is sourced by Valet on startup which allows you to setup global
# variables to configure Valet. You can define the variables here or export
# them in your shell or in your .bashrc file.
#
# Empty variables will be replaced by the default values during the execution.
# You should not define all the variables, only the ones you want to change.
# Do not add custom code to this script, use the custom startup script instead.
# If you break this file, valet will fail to start.
# You can delete it and run the 'valet self config' command to recreate it.
## -----------
## Custom startup script
## -----------
# You can define a custom startup script that will be sourced by Valet on startup.*
# This allows you to define custom functions or variables that will be available in Valet.
# For example, it is convenient to translate CI_* variables to VALET_* variables.
#
# The script should be named 'startup' and be in the same directory as this file.
_CONFIG_DIR="${BASH_SOURCE[0]}"
if [[ "${_CONFIG_DIR}" != /* ]]; then
# resolve relative path
if pushd "${_CONFIG_DIR%/*}" &>/dev/null; then _CONFIG_DIR="${PWD}"; popd &>/dev/null;
else _CONFIG_DIR="${PWD}"; fi
else
_CONFIG_DIR="${_CONFIG_DIR%/*}" # strip filename
fi
if [[ -f "${_CONFIG_DIR}/startup" ]]; then
source "${_CONFIG_DIR}/startup"
fi
## -----------
## General config
## -----------
# The path to this Valet config file: MUST BE declared outside this file!
# Default to the 'config' file in your config directory.
# VALET_CONFIG_FILE
# The directory in which to find user commands.
# Defaults to the '.valet.d' directory in the user home directory.
VALET_USER_DIRECTORY="${VALET_USER_DIRECTORY:-}"
# The path to the configuration directory, where we store that should be kept between sessions.
# You can backup this directory to keep your configuration.
# Defaults to the '.config' directory in the user home directory.
VALET_CONFIG_DIRECTORY="${VALET_CONFIG_DIRECTORY:-}"
# The path to the directory in which to store the data that should be kept between sessions
# but are not essential for the user configuration (e.g. last choices in menus).
# Defaults to the '.local/state' directory in the user home directory.
VALET_CONFIG_LOCAL_STATE_DIRECTORY="${VALET_CONFIG_LOCAL_STATE_DIRECTORY:-}"
# The directory in which to write work files (small files to capture output of programs).
# You can set it to a tmpfs directory (such as /dev/shm) to speed up the execution of valet.
# Defaults to the temporary directory (TMPDIR or /tmp).
VALET_CONFIG_WORK_FILES_DIRECTORY="${VALET_CONFIG_WORK_FILES_DIRECTORY:-}"
# Number of last choices to remember when selecting an item from a command menu.
# Set to 0 to disable this feature and always display items in the alphabetical order.
VALET_CONFIG_REMEMBER_LAST_CHOICES="${VALET_CONFIG_REMEMBER_LAST_CHOICES:-}"
# The name of a script which will be sourced by Valet on startup if it is present in
# the current directory. This allows you to define custom functions or variables that
# will be available in Valet.
# Defaults to the '.env' file in the current directory.
VALET_CONFIG_DOT_ENV_SCRIPT="${VALET_CONFIG_DOT_ENV_SCRIPT:-}"
# The command (with arguments) that will be used to diff files in the Valet test command.
# The command should have 2 placeholders: %APPROVED_FILE% and %RECEIVED_FILE%. They
# will be replaced by the paths of the approved and received files.
# You can change that command to use your favorite diff tool.
#
# This defaults to:
# - 'delta --paging=never --no-gitconfig --line-numbers --side-by-side %APPROVED_FILE% %RECEIVED_FILE%' if delta is available
# - 'diff --color -u %APPROVED_FILE% %RECEIVED_FILE%' if diff is available
# - 'internalCompare %APPROVED_FILE% %RECEIVED_FILE%' otherwise (internalCompare is a bash function that compares 2 files)
VALET_CONFIG_TEST_DIFF_COMMAND="${VALET_CONFIG_TEST_DIFF_COMMAND:-}"
# Set this to 'true' to disable fuzzy matching of commands and options.
#
# By default, Valet will try to match the command or option you typed with the closest
# command or option available. If you set this to 'true', Valet will only match
# commands and options that are exactly the same as what you typed.
#
# This is useful in a CI environment where you want to make sure that the command
# you typed is the exact command that will be executed.
VALET_CONFIG_STRICT_MATCHING="${VALET_CONFIG_STRICT_MATCHING:-}"
# Set this to 'true' to disable all progress bars / spinners in Valet.
# Useful in a CI environment where you want to disable all animations.
VALET_CONFIG_DISABLE_PROGRESS="${VALET_CONFIG_DISABLE_PROGRESS:-}"
## -----------
## Log/output configuration
## -----------
# If true, will enable the icons (using nerd font).
VALET_CONFIG_ENABLE_NERDFONT_ICONS="${VALET_CONFIG_ENABLE_NERDFONT_ICONS:-}"
# If true, will forcibly enable the color output (otherwise we try to detect color support on start).
VALET_CONFIG_ENABLE_COLORS="${VALET_CONFIG_ENABLE_COLORS:-}"
# If true, will disable the text wrapping for logs.
VALET_CONFIG_DISABLE_LOG_WRAP="${VALET_CONFIG_DISABLE_LOG_WRAP:-}"
# Sets the maximum width for the log output (used only when log wrapping is enabled).
VALET_CONFIG_LOG_COLUMNS="${VALET_CONFIG_LOG_COLUMNS:-}"
# If true, will disable the time for logs.
VALET_CONFIG_DISABLE_LOG_TIME="${VALET_CONFIG_DISABLE_LOG_TIME:-}"
# If true, will print a timestamp instead of simple time in the logs.
VALET_CONFIG_ENABLE_LOG_TIMESTAMP="${VALET_CONFIG_ENABLE_LOG_TIMESTAMP:-}"
# The file descriptor to use for the logs (defaults to 2 to output to stderr).
VALET_CONFIG_LOG_FD="${VALET_CONFIG_LOG_FD:-}"
# A path to directory in which we will create 1 log file per valet execution, which
# will contain the valet logs.
VALET_CONFIG_LOG_TO_DIRECTORY="${VALET_CONFIG_LOG_TO_DIRECTORY:-}"
# A string that will be evaluated to set a variable 'logFile' which represents
# the name of the file in which to write the logs.
# Only used if VALET_CONFIG_LOG_TO_DIRECTORY is set.
# The default is equivalent to setting this string to:
# printf -v logFile '%s%(%F_%Hh%Mm%Ss)T%s' 'valet-' ${EPOCHSECONDS} '.log'
VALET_CONFIG_LOG_FILENAME_PATTERN="${VALET_CONFIG_LOG_FILENAME_PATTERN:-}"
# The bash profiler logs will automatically be cleaned up and improved to make them
# more readable.
# This process can be done in awk (by default if found on your system) or
# you can force to use bash by setting this property to true.
VALET_CONFIG_LOG_CLEANUP_USING_BASH="${VALET_CONFIG_LOG_CLEANUP_USING_BASH:-}"
## -----------
## Log icons configuration
## -----------
# The icon to use for the logs.
VALET_CONFIG_ICON_ERROR="${VALET_CONFIG_ICON_ERROR:-}"
VALET_CONFIG_ICON_WARNING="${VALET_CONFIG_ICON_WARNING:-}"
VALET_CONFIG_ICON_SUCCESS="${VALET_CONFIG_ICON_SUCCESS:-}"
VALET_CONFIG_ICON_INFO="${VALET_CONFIG_ICON_INFO:-}"
VALET_CONFIG_ICON_DEBUG="${VALET_CONFIG_ICON_DEBUG:-}"
VALET_CONFIG_ICON_TRACE="${VALET_CONFIG_ICON_TRACE:-}"
VALET_CONFIG_ICON_ERROR_TRACE="${VALET_CONFIG_ICON_ERROR_TRACE:-}"
VALET_CONFIG_ICON_EXIT="${VALET_CONFIG_ICON_EXIT:-}"
VALET_CONFIG_ICON_STOPPED="${VALET_CONFIG_ICON_STOPPED:-}"
VALET_CONFIG_ICON_KILLED="${VALET_CONFIG_ICON_KILLED:-}"
## -----------
## Profiler configuration
## -----------
# The path to the file in which to write the profiling information for the command.
# Defaults to the ~/valet-profiler-{PID}-command.txt file.
VALET_CONFIG_COMMAND_PROFILING_FILE="${VALET_CONFIG_COMMAND_PROFILING_FILE:-}"
# The profiler log will be cleanup to only keep lines relevant for your command script
# If true, it disables this behavior and you can see all the profiler lines.
VALET_CONFIG_KEEP_ALL_PROFILER_LINES="${VALET_CONFIG_KEEP_ALL_PROFILER_LINES:-}"
# If true, will enable debug mode with profiling for valet ON STARTUP.
# This is intended for Valet developers to debug the startup of Valet.
# To debug your commands, use the -x option.
VALET_CONFIG_STARTUP_PROFILING="${VALET_CONFIG_STARTUP_PROFILING:-}"
# The path to the file in which to write the profiling information for the startup of Valet.
# Defaults to the ~/valet-profiler-{PID}.txt file.
VALET_CONFIG_STARTUP_PROFILING_FILE="${VALET_CONFIG_STARTUP_PROFILING_FILE:-}"
## -----------
## Colors to use in Valet.
## -----------
# You should define a color using an ANSI escape sequence.
# See https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797.
# E.g., this will set the INFO levels logs to blue:
# VALET_CONFIG_COLOR_INFO=$'\e[44m'
VALET_CONFIG_COLOR_DEFAULT="${VALET_CONFIG_COLOR_DEFAULT:-}"
# Colors for logs
VALET_CONFIG_COLOR_DEBUG="${VALET_CONFIG_COLOR_DEBUG:-}"
VALET_CONFIG_COLOR_INFO="${VALET_CONFIG_COLOR_INFO:-}"
VALET_CONFIG_COLOR_WARNING="${VALET_CONFIG_COLOR_WARNING:-}"
VALET_CONFIG_COLOR_SUCCESS="${VALET_CONFIG_COLOR_SUCCESS:-}"
VALET_CONFIG_COLOR_ERROR="${VALET_CONFIG_COLOR_ERROR:-}"
VALET_CONFIG_COLOR_TIMESTAMP="${VALET_CONFIG_COLOR_TIMESTAMP:-}"
VALET_CONFIG_COLOR_HIGHLIGHT="${VALET_CONFIG_COLOR_HIGHLIGHT:-}"
# Colors for help
VALET_CONFIG_COLOR_TITLE="${VALET_CONFIG_COLOR_TITLE:-}"
VALET_CONFIG_COLOR_OPTION="${VALET_CONFIG_COLOR_OPTION:-}"
VALET_CONFIG_COLOR_ARGUMENT="${VALET_CONFIG_COLOR_ARGUMENT:-}"
VALET_CONFIG_COLOR_COMMAND="${VALET_CONFIG_COLOR_COMMAND:-}"
# Colors for the interactive mode
VALET_CONFIG_COLOR_ACTIVE_BUTTON="${VALET_CONFIG_COLOR_ACTIVE_BUTTON:-}"
VALET_CONFIG_COLOR_UNACTIVE_BUTTON="${VALET_CONFIG_COLOR_UNACTIVE_BUTTON:-}"
# Colors for fsfs
VALET_CONFIG_FSFS_RESET_TEXT="${VALET_CONFIG_FSFS_RESET_TEXT:-}"
VALET_CONFIG_FSFS_STATIC="${VALET_CONFIG_FSFS_STATIC:-}"
VALET_CONFIG_FSFS_FOCUS="${VALET_CONFIG_FSFS_FOCUS:-}"
VALET_CONFIG_FSFS_FOCUS_RESET="${VALET_CONFIG_FSFS_FOCUS_RESET:-}"
VALET_CONFIG_FSFS_LETTER_HIGHLIGHT="${VALET_CONFIG_FSFS_LETTER_HIGHLIGHT:-}"
VALET_CONFIG_FSFS_LETTER_HIGHLIGHT_RESET="${VALET_CONFIG_FSFS_LETTER_HIGHLIGHT_RESET:-}"
VALET_CONFIG_FSFS_SELECTED_ITEM="${VALET_CONFIG_FSFS_SELECTED_ITEM:-}"
VALET_CONFIG_FSFS_SELECTED_ITEM_RESET="${VALET_CONFIG_FSFS_SELECTED_ITEM_RESET:-}"
VALET_CONFIG_FSFS_PROMPT_STRING="${VALET_CONFIG_FSFS_PROMPT_STRING:-}"
VALET_CONFIG_FSFS_PROMPT_STRING_RESET="${VALET_CONFIG_FSFS_PROMPT_STRING_RESET:-}"
VALET_CONFIG_FSFS_COUNT="${VALET_CONFIG_FSFS_COUNT:-}"
VALET_CONFIG_FSFS_COUNT_RESET="${VALET_CONFIG_FSFS_COUNT_RESET:-}"
## -----------
## Interactive mode configuration.
## -----------
# Change the default progress bar template.
# See interactive::startProgress.
VALET_CONFIG_PROGRESS_BAR_TEMPLATE="${VALET_CONFIG_PROGRESS_BAR_TEMPLATE:-}"
# Change the default progress bar size
VALET_CONFIG_PROGRESS_BAR_SIZE="${VALET_CONFIG_PROGRESS_BAR_SIZE:-}"
# Change the default time between two frames for the animation of the spinner in the progress
# (in seconds, can be a float number).
# See interactive::startProgress.
VALET_CONFIG_PROGRESS_ANIMATION_DELAY="${VALET_CONFIG_PROGRESS_ANIMATION_DELAY:-}"
# The default number of animation frames to wait between two updates of the progress bar.
VALET_CONFIG_PROGRESS_BAR_UPDATE_INTERVAL="${VALET_CONFIG_PROGRESS_BAR_UPDATE_INTERVAL:-}"
# Change the default spinner characters (one character represents one frame of the animation).
# See interactive::startProgress.
VALET_CONFIG_SPINNER_CHARACTERS="${VALET_CONFIG_SPINNER_CHARACTERS:-}"
# The default character to use to represent the selected item in the interactive mode.
# Used in fsfs, autocompletion, etc...
VALET_CONFIG_INTERACTIVE_SELECTED_ITEM_CHARACTER="${VALET_CONFIG_INTERACTIVE_SELECTED_ITEM_CHARACTER:-}"
# The default character to use to represent the prompt in the interactive mode.
VALET_CONFIG_INTERACTIVE_PROMPT_CHARACTER="${VALET_CONFIG_INTERACTIVE_PROMPT_CHARACTER:-}"
## -----------
## Other configs.
## -----------
# If true, will enable the automatic bump of the version of Valet on build.
# Intended for Valet developers only.
VALET_CONFIG_BUMP_VERSION_ON_BUILD="${VALET_CONFIG_BUMP_VERSION_ON_BUILD:-}"
|
Documentation generated for the version 0.26.6 (2024-11-24).