LinuxmacOSWindows

Where Does pgcli Store Config and History?

pgcli keeps connection favorites, query history, and display options in a small config tree in your home directory.

Last updated

pgcli stores personal state in a config folder under your home directory: the main config file with favorites and formatting, plus history and log files beside it. Database contents never land here, only your interaction with them.

The folder name follows XDG on Unix and the profile root on Windows, so dotfile managers can symlink it directly. Connection passwords stay out by default, which keeps the backup safe to keep.

Where pgcli stores this, by platform

Linux
~/.config/pgcli

Main config plus history and logs. Symlink-friendly for dotfile repos. Passwords are not kept here, so copies stay safe to store.

macOS
~/.config/pgcli

Same layout and file names as Linux. Config edits apply on next launch; no daemon restart dance needed.

Windows
%USERPROFILE%\.config\pgcli

Same role under the user profile. If the folder name differs by installer, search AppData for pgcli and symlink what you find.

Frequently asked questions

How do I migrate pgcli to a new computer?

Copy the config directory to the same spot on the new machine. Passwords are usually not stored there, so expect to re-enter credentials per connection.

How do I clear pgcli query history?

Delete the history or log files inside the config directory while pgcli is closed. Keep the main config file if your named queries and favorites should survive.

Notice an outdated path? Let us know.