> ## Documentation Index
> Fetch the complete documentation index at: https://www.1password.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How 1Password CLI detects configuration directories

1Password CLI configuration directories default to:

* `${XDG_CONFIG_HOME}/op` when `${XDG_CONFIG_HOME}` is set
* `~/.config/op` when `${XDG_CONFIG_HOME}` is not set

1Password CLI detects the configuration directory to read or write to in this order of precedence:

1. A directory specified with `--config`
2. A directory set with the `OP_CONFIG_DIR` environment variable.
3. `~/.op` (following [go-homedir <Icon icon="github" />](https://github.com/mitchellh/go-homedir) to determine the home directory)
4. `${XDG_CONFIG_HOME}/.op`
5. `~/.config/op` (following [go-homedir <Icon icon="github" />](https://github.com/mitchellh/go-homedir) to determine the home directory)
6. `${XDG_CONFIG_HOME}/op`
