A command-line interface tool for managing PostgreSQL databases with a focus on simplicity, security, and user experience. Features interactive prompts, beautiful terminal output, and secure credential storage.
A JavaScript CLI tool that helps you configure database connections and create new databases with ease.
- 🔧 Interactive configuration system
- 🗄️ PostgreSQL database management
- 🎨 Beautiful terminal output with colors and boxes
- 🔐 Secure password storage using system keychain
- 💾 Connection string generation
- PostgreSQL server installed and running
- Node.js 16.x or higher
- npm or yarn package manager
- sudo access (for global installation)
- System keychain requirements:
- Linux:
libsecret
andgnome-keyring
- macOS: Keychain Access
- Windows: Credential Manager
- Linux:
You can install the CLI tool in two ways:
npm install -g https://github.com/paulgeorge35/db-cli
# Clone the repository
git clone https://github.com/paulgeorge35/db-cli
cd db-cli
# Install dependencies
npm install
# Link the package globally
npm link
db-cli config
This interactive command will help you set up your database connection:
? Enter database host: localhost
? Enter port: (5432)
? Enter username: (root)
? Enter password: [hidden]
db-cli add db
Example output:
? Enter database name: myapp_development
✔ Database created successfully!
Connection string: postgresql://root:****@localhost:5432/myapp_development
View your current database configuration:
# Hide password (default)
db-cli view
# Show password
db-cli view --show-password
Remove all saved configuration:
db-cli reset
Get help on available commands:
db-cli --help
The tool uses two secure storage mechanisms:
-
Non-sensitive configuration (host, port, username) is stored using the
conf
package in:- macOS:
~/Library/Preferences/db-cli-nodejs
- Windows:
%APPDATA%/db-cli-nodejs/Config
- Linux:
~/.config/db-cli-nodejs
- macOS:
-
Passwords are securely stored in the system's native keychain:
- macOS: Keychain Access
- Windows: Credential Manager
- Linux: Secret Service API (GNOME Keyring/KWallet)
Core dependencies:
boxen
(^8.0.1): Create boxes in terminalchalk
(^5.4.1): Terminal string stylingyargs
(^17.7.2): Command-line argument parsinginquirer
(^9.2.15): Interactive command promptspg
(^8.11.3): PostgreSQL clientconf
(^12.0.0): Configuration storage
This project is licensed under the MIT License - see the LICENSE file for details.
Paul George - [email protected]
Project Link: https://github.com/paulgeorge35/db-cli