https://github.com/ruslan-korneev/pgconnect-zsh
This plugin enhances your Oh My Zsh setup by providing an easy way to manage and connect to PostgreSQL databases using pgcli and fzf for a seamless command-line experience.
https://github.com/ruslan-korneev/pgconnect-zsh
fzf oh-my-zsh oh-my-zsh-plugin pgcli postgresql zsh
Last synced: 8 months ago
JSON representation
This plugin enhances your Oh My Zsh setup by providing an easy way to manage and connect to PostgreSQL databases using pgcli and fzf for a seamless command-line experience.
- Host: GitHub
- URL: https://github.com/ruslan-korneev/pgconnect-zsh
- Owner: ruslan-korneev
- License: apache-2.0
- Created: 2024-12-16T07:19:37.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-12-17T08:43:01.000Z (11 months ago)
- Last Synced: 2025-04-01T21:13:33.790Z (8 months ago)
- Topics: fzf, oh-my-zsh, oh-my-zsh-plugin, pgcli, postgresql, zsh
- Language: Shell
- Homepage:
- Size: 2.87 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-zsh-plugins - pgconnect - Provides an easy way to manage and connect to PostgreSQL databases using `pgcli` and [fzf](https://github.com/junegunn/fzf) for a seamless command-line experience. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - pgconnect - Provides an easy way to manage and connect to PostgreSQL databases using `pgcli` and <b><code> 75058⭐</code></b> <b><code> 2613🍴</code></b> [fzf](https://github.com/junegunn/fzf)) for a seamless command-line experience. (Plugins / ZSH on Windows)
README
# PostgreSQL Connection Plugin for Oh My Zsh
This plugin enhances your Oh My Zsh setup by providing an easy way to manage and connect to PostgreSQL databases using `pgcli` and `fzf` for a seamless command-line experience.
## Requirements
Ensure you have the following tools installed before using this plugin:
- [fzf](https://github.com/junegunn/fzf): A command-line fuzzy finder.
- [pgcli](https://github.com/dbcli/pgcli): A Postgres client with auto-completion and syntax highlighting.
## Installation
To install the PostgreSQL Connection Plugin, follow these steps:
1. Clone the repository into your custom Oh My Zsh plugins directory:
```zsh
git clone git@github.com:ruslan-korneev/pgconnect-zsh.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/pgconnect
```
2. Add `pgconnect` to the list of plugins in your `.zshrc` file:
```zsh
plugins=(... pgconnect)
```
3. Reload your Zsh configuration:
```zsh
source ~/.zshrc
```
## Usage
To manage your PostgreSQL connections, configure your `~/.pg_service.conf` file. This file allows you to define multiple database connections. Here is an example configuration:
```ini
[db1]
host=0.0.0.0
port=5862
user=username
dbname=postgres
[db2]
host=0.0.0.0
port=5432
user=postgres
dbname=mysuperdatabase
```
After setting up your `~/.pg_service.conf`, you will be able to see and select these databases from a list using the plugin.

### Security Note
To keep your passwords secure, you can use the `.pgpass` file, which stores your credentials safely. If you prefer, you can also include the password directly in the `~/.pg_service.conf` file using the `password` attribute, though this is not recommended for security reasons.
For more detailed information on configuring these files, refer to the [PostgreSQL documentation on connection service files](https://www.postgresql.org/docs/current/libpq-pgservice.html) and [password file](https://www.postgresql.org/docs/current/libpq-pgpass.html).
---
Feel free to contribute to this project by submitting issues or pull requests. Enjoy seamless PostgreSQL connections with Oh My Zsh!