I typed pgcli and watched it fail—again. The database was locked behind a remote network I couldn’t reach. The command-line prompt sat there, mocking me, until I realized the problem wasn’t pgcli at all. It was the network. That’s when I brought Twingate into the picture. Minutes later, pgcli connected like it was running against localhost. No tunnels. No VPN. Just raw, stable access.
pgcli is fast, smart, and friendly for PostgreSQL queries. It gives autocomplete, syntax highlighting, and better workflows without changing the underlying database engine. But it needs a clean, secure path to the database host. That’s where Twingate changes the game.
Twingate creates a private, encrypted link between your local machine and a protected resource. You sign in, the client runs quietly in the background, and instantly your database host becomes reachable as if it were on your LAN. This works without exposing services to the public internet, without juggling firewall rules, and without slow VPN gateways.
To use pgcli with Twingate:
- Install
pgcli from your package manager or pip install pgcli. - Join your Twingate network and log in to your connector.
- Look up your private database hostname or IP provided in Twingate’s resource settings.
- Run:
pgcli -h your-private-db -U youruser -d yourdb
- Work with the speed, color, and autocomplete you expect.
This setup is portable across laptops and networks. Switch from office to home Wi‑Fi, from tethering to coworking spaces—pgcli remains connected as long as Twingate is active. Less time re‑authenticating means more time shipping features and fixing bugs.
Security is not just about encryption, it’s about making sure services stay invisible to attackers. Twingate hides your database behind zero-trust access. Only authenticated devices see it. pgcli doesn’t need to know the difference—it just runs queries.
If you want to see this working now, spin it up on hoop.dev. You’ll have pgcli talking to a private database through Twingate in minutes, no ops ticket required. The sooner you try it, the sooner you’ll stop fighting your network and start getting results.