Skip to main content

Module appdata

Module appdata 

Source
Expand description

CLI appdata directory resolution.

Returns the directory that holds the legacy config.json, the session DB, and any other CLI state. The lookup order mirrors Node CLIโ€™s service-container.ts so users keep one appdata location across CLI versions:

  1. A bw-data directory next to the running executable, if it exists (portable install).
  2. BITWARDENCLI_APPDATA_DIR env var (if set and non-empty).
  3. OS default:
    • macOS: $HOME/Library/Application Support/Bitwarden CLI
    • Windows: %APPDATA%\Bitwarden CLI
    • Other: $XDG_CONFIG_HOME/Bitwarden CLI (falling back to $HOME/.config/Bitwarden CLI)

Functionsยง

appdata_dir
default_appdata_dir ๐Ÿ”’
portable_data_dir ๐Ÿ”’