Set/unset the cache directory location intuitively (compared to
dvc config cache), or shows the current configured value.
usage: dvc cache dir [-h] [--global | --system | --project | --local] [-u] [value] positional arguments: value Path to cache directory. Relative paths are resolved relative to the current directory and saved to config relative to the config file location. If no path is provided, it returns the current cache directory.
Helper to set the
cache.dir configuration option. (See
Unlike doing so with
dvc config cache,
dvc cache dir transform paths
value) that are provided relative to the current working directory into paths
relative to the config file location. However, if the
value provided is an
absolute path, then it's preserved as it is.
If no path
value is given, it prints the current path of the cache directory.
The value is read from the system, global, project, and local config files (in
--unset- remove the
cache.dirconfig option from a config file. Don't provide a
valueargument when employing this flag.
--system- use the system config file (e.g.
/etc/xdg/dvc/config) instead of
--global- use the global config file (e.g.
~/.config/dvc/config) instead of the project's
--project- only use the project's config file (
.dvc/config) when reading the value (this is the default when writing).
--local- use the Git-ignored local config file (located in
.dvc/config.local) instead of
.dvc/config. This is useful to save a private
cache.dirvalue that you don't want to track and share with Git.
--help- prints the usage/help message, and exit.
--quiet- do not write anything to standard output. Exit with 0 if no problems arise, otherwise 1.
--verbose- displays detailed tracing information.
$ dvc cache dir ../dir $ cat .dvc/config ... [cache] dir = ../../dir ...
../dir has been resolved relative to the
.dvc/ dir, resulting in
$ dvc cache dir /path/to/dir $ cat .dvc/config ... [cache] dir = /path/to/dir ...
/path/to/dir saved as is.
$ dvc cache dir /home/user/dvc/.dvc/cache