Introduction
dbmux is a command line tool for everyday PostgreSQL work. It wraps dump, restore, and query workflows behind short connection names, so you stop retyping hosts and passwords. Every dump and restore is recorded to a history you can list and clear later.
Installation
Install globally with npm:
npm install -g dbmuxOr run the install script:
curl -fsSL https://raw.githubusercontent.com/bhagyamudgal/dbmux/main/install.sh | bashQuick start
Connect once. dbmux tests the connection, saves it under a name, and makes it the active session connection:
dbmux connect -U "postgresql://user:password@localhost:5432/mydb"Query the database without repeating any details:
dbmux query -q "SELECT * FROM users LIMIT 10"Create a dump. With no flags, dbmux shows a picker of live databases:
dbmux dump createRestore one of your recent dumps into a fresh database:
dbmux restore run --fromHistory -d mydb_restored --createEach step resolves its connection the same way: an explicit -n flag
first, then the active session, then your configured default. The full
order is described on the configuration page.
Commands
| Command | Description |
|---|---|
| connect | Connect to a database and save it as a named connection |
| query | Execute SQL queries |
| list | List databases, tables, or saved connections |
| dump | Create, delete, and review database dumps |
| restore | Restore dumps and review restore history |
| db | Delete databases from the server |
| config | Manage configuration and saved connections |
| history | View and manage dump and restore history |
| status | Show the current default connection |
| disconnect | Clear the active connection session |
| update | Update dbmux to the latest version |
Database support
PostgreSQL is fully supported today. SQLite appears in interactive prompts, but its driver is not implemented yet, so picking it fails once dbmux tries to reach the server. Dump, restore, and db delete are restricted to PostgreSQL.