Maxim is a fast, modern terminal user interface (TUI) for working with PostgreSQL databases. Browse tables, view data, and run SQL queries with intelligent autocomplete—all without leaving your terminal.
- Fast & Modern TUI - Beautiful, keyboard-driven interface built with Bubble Tea
- Database Management - Create, list, and delete PostgreSQL databases
- Docker DB Creation - Spin up a PostgreSQL database inside a Docker container from the UI
- Table Browser - Browse tables and view data with pagination (100 rows per page)
- SQL Editor - Write SQL queries with syntax-aware autocomplete
- Intelligent Autocomplete - Smart suggestions for SQL keywords, table names, and column names
- Keyboard-Driven - Full keyboard navigation—no mouse required
- Connection Management - Save and reuse database connections securely
The easiest way to install Maxim is using Go's go install command:
go install github.com/ASHUTOSH-SWAIN-GIT/maxim@latestPrerequisites:
- Go 1.21 or later installed (download Go)
$GOPATH/binor$GOBINin yourPATH(usually already configured)
The binary will be installed to your $GOPATH/bin or $GOBIN directory (typically ~/go/bin).
Verify installation:
maxim --versionAdding to PATH (if command not found):
If the maxim command is not found after installation, you need to add Go's bin directory to your PATH:
Linux/macOS:
For Bash (add to ~/.bashrc):
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc
source ~/.bashrcFor Zsh (add to ~/.zshrc):
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc
source ~/.zshrcFor Fish (add to ~/.config/fish/config.fish):
echo 'set -gx PATH $PATH (go env GOPATH)/bin' >> ~/.config/fish/config.fish
source ~/.config/fish/config.fishWindows (PowerShell):
# Add to PowerShell profile (run once)
[System.Environment]::SetEnvironmentVariable('Path', $env:Path + ";$env:USERPROFILE\go\bin", 'User')
# Or manually add C:\Users\<YourUsername>\go\bin to your PATH environment variableWindows (Command Prompt):
# Add to PATH permanently (replace <username> with your username)
setx PATH "%PATH%;C:\Users\<username>\go\bin"After adding to PATH, restart your terminal or run source ~/.bashrc (Linux/macOS) / restart PowerShell (Windows).
If you prefer pre-built binaries, download from the Releases page:
- Download the appropriate archive for your platform
- Extract and move to your PATH
- Verify:
maxim --version
See the Releases page for all available binaries.
- PostgreSQL server running and accessible (for local/remote DBs)
- Superuser credentials for database management operations (create/delete databases) on local servers
- For Docker-based databases: Docker installed and running
If you don't already have a PostgreSQL superuser to use with Maxim, create one using one of the options below.
Option A: Using psql
# 1) Switch to the postgres system user (Linux)
sudo -u postgres psql
# 2) Inside psql, create a login role with superuser privileges
CREATE ROLE maxim_admin WITH LOGIN SUPERUSER PASSWORD 'your-strong-password';
# 3) Verify
\du
# 4) Exit psql
\qOption B: Using createuser
# Linux/macOS
sudo -u postgres createuser --superuser maxim_admin
sudo -u postgres psql -c "ALTER USER maxim_admin WITH PASSWORD 'your-strong-password';"Notes
- Use a strong password and store it securely.
- If connecting remotely, ensure
postgresql.confandpg_hba.confallow your host/IP. - On managed services (RDS, Cloud SQL, Azure), use the platform-provided admin user instead of creating your own superuser.
maxim startThis will open the main menu with the following options:
- Connect to a DB
- Create a new DB
- List all DBs
- Delete a DB
Choose "Connect to a DB" from the main menu, or use:
maxim connectEnter your database credentials:
- Port (default: 5432)
- Username
- Password
- Database Name
Your connection details (except password) will be saved for future use.
After connecting, you'll see the database operations menu:
- Show table data - Browse tables and view data with pagination
- Editor - Open the SQL editor
Maxim can create PostgreSQL databases inside Docker containers.
- Docker installed and running
- Verify:
docker version
- Verify:
- Permissions to run Docker (on Linux, add your user to the
dockergroup or usesudo) - An available host port for PostgreSQL (default container port 5432; you choose the host port)
- Open Maxim:
maxim start - Choose: Create a new DB
- Select: Docker
- Enter the following:
- Container name
- Database name
- Username
- Port (host port to map to container
5432) - Password
- Maxim will start a container from
postgres:latest, wait until it is ready, and show a success message with connection details (password is not displayed). - No auto-connect occurs; use the normal connect flow below.
Use the regular connect flow (no separate option needed):
- Host:
localhost - Port: the host port you entered during creation
- Username: the username you entered during creation
- Database: the database name you entered during creation
- Password: the password you entered during creation
- List all DBs includes Docker databases, marked with
[Docker]. - Delete a DB will stop and remove the Docker container when a Docker DB is selected.
- Passwords are never stored; they are masked in any on-screen messages.
- PostgreSQL version is
latestby default.
- "docker: command not found": Install Docker and ensure it’s in
PATH. - "permission denied": On Linux, add your user to the
dockergroup or run withsudo. - "port already in use": Choose a different host port (e.g., 5433, 5434...).
- Container not ready:
docker logs <container_name>to inspect startup. - Manual cleanup:
docker stop <container_name> && docker rm <container_name>
maxim start # Launch interactive TUI interface
maxim connect # Connect to a database
maxim create # Create a new database and user
maxim list # List all databases on the server (includes Docker)
maxim delete # Delete a database (kills Docker container if applicable)
maxim --version # Show version information
maxim --help # Show helpThe SQL Editor provides a split-panel interface:
- Left Panel: Type your SQL queries
- Right Panel: View autocomplete suggestions and results
Keyboard Shortcuts:
Ctrl+A- Execute all queriesCtrl+R- Clear resultsTab- Cycle through autocomplete suggestionsEnter- Select highlighted suggestionEsc- Return to database operations menu
When viewing table data:
- Enter - Load next page (100 rows)
- Arrow keys - Scroll through data
- PageUp/PageDown - Navigate pages
- Esc - Return to menu
Connection details are stored securely in your system's configuration directory:
- Linux/macOS:
~/.config/maxim/config.json - Windows:
%APPDATA%\maxim\config.json
Only connection details (host, port, username, database name) are saved—passwords are never stored and must be entered each time.
Maxim is fully keyboard-driven:
- Arrow Keys / j/k - Navigate menus and lists
- Enter - Select/Submit
- Esc / q - Quit/Go back
- Tab - Move to next field (in forms)
- Shift+Tab - Move to previous field
maxim create
# Follow the prompts to enter:
# - Database name
# - Username
# - Passwordmaxim list
# Shows all databases on the server (includes [Docker] entries)
# Press Esc to return to menumaxim connect
# Enter host, port, username, password, and database name
# Open "Editor" to type queries with autocomplete- Verify PostgreSQL is running:
sudo systemctl status postgresql(Linux) - Check if the port is correct (default: 5432, or your Docker host port)
- Ensure your user has the necessary permissions
- Verify network connectivity to the database server
- Ensure you're using superuser credentials for database creation/deletion
- Check PostgreSQL user permissions
- Verify database ownership
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Bubble Tea - A powerful TUI framework
- Uses Cobra for CLI commands
For issues, questions, or feature requests, please open an issue on GitHub.
Enjoy working with your databases! 🚀