Getting Started
Installation
Pick your operating system or preferred installation method:
- Linux
- Mac
- Windows
- Go Install
- Docker
- Source Code
Download the package for your distro from the releases page.
Debian / Ubuntu
sudo dpkg -i pgxcli_*_linux_amd64.deb
Fedora / RHEL
sudo rpm -i pgxcli_*_linux_amd64.rpm
Alpine
sudo apk add --allow-untrusted pgxcli_*_linux_amd64.apk
Arch Linux You can install from the AUR:
yay -S pgxcli
Or manually install the downloaded package:
sudo pacman -U pgxcli_*_linux_amd64.pkg.tar.zst
Archive (tar.gz)
tar -xzf pgxcli_*_linux_amd64.tar.gz
sudo mv pgxcli /usr/local/bin/
Grab the latest .tar.gz for your architecture from the releases page.
Manual Installation
# For Apple Silicon (M1/M2/M3)
tar -xzf pgxcli_0.3.0_darwin_arm64.tar.gz
sudo mv pgxcli /usr/local/bin/
# For Intel Mac
tar -xzf pgxcli_0.3.0_darwin_amd64.tar.gz
sudo mv pgxcli /usr/local/bin/
Installer (MSI) — recommended
Download the .msi from the releases page and run it. pgxcli will be added to your PATH automatically.
Archive (zip)
Grab the .zip from the releases page, extract it, and place pgxcli.exe anywhere on your PATH.
Make sure you have Go 1.26.4+.
go install github.com/balajz/pgxcli@latest
You can run pgxcli directly using Docker from GitHub Container Registry or Docker Hub:
GitHub Container Registry (GHCR)
docker run -it --rm ghcr.io/balajz/pgxcli:v0.3.0 postgres://user:pass@host:5432/db
Docker Hub
docker run -it --rm balajz/pgxcli:v0.3.0 postgres://user:pass@host:5432/db
Make sure you have Go 1.26.4+.
git clone https://github.com/balajz/pgxcli.git
cd pgxcli
make build
The binary lands in bin/app. Move it wherever you like (e.g., /usr/local/bin/pgxcli).
Quick Start
Connect to a database:
pgxcli mydb myuser
That's it. You'll get a REPL with syntax highlighting, autocompletion, and history — ready to go.
On first run, pgxcli creates a config file at $XDG_CONFIG_HOME/pgxcli/config.toml when XDG_CONFIG_HOME is set, otherwise in the OS-standard user config directory. You can customize your prompt, theme, pager, and more. See Configuration.
Try a Query
SELECT version();
Results render in a clean table with execution time. If the output is long, pgxcli pages it automatically.
Exit
Type \q.
Next Steps
- Connecting — all the ways to connect (flags, URI, interactive form)
- Configuration — customize your prompt, theme, and behavior
- Special Commands — backslash commands reference
- CLI Flags — every flag, documented