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.
The easiest way to install Maxim is using Go's go install command:
go install github.com/ASHUTOSH-SWAIN-GIT/maxim@latest
Prerequisites:
- Go 1.21 or later installed (download Go)
- $GOPATH/bin or $GOBIN in your PATH (usually already configured)
The binary will be installed to your $GOPATH/bin or $GOBIN directory (typically ~/go/bin).
Verify installation:
maxim --version
Adding 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 ~/.bashrc
For Zsh (add to ~/.zshrc):
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc
source ~/.zshrc
For Fish (add to ~/.config/fish/config.fish):
echo 'set -gx PATH $PATH (go env GOPATH)/bin' >> ~/.config/fish/config.fish
source ~/.config/fish/config.fish
Windows (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 variable
Windows (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:
maxim --versionSee the Releases page for all available binaries.
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
\q
Option 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
postgresql.conf and pg_hba.conf allow your host/IP.maxim start
This 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 connect
Enter 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:
Maxim can create PostgreSQL databases inside Docker containers.
docker versiondocker group or use sudo)maxim start5432)postgres:latest, wait until it is ready, and show a success message with connection details (password is not displayed).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
[Docker].latest by default.PATH.docker group or run with sudo.docker logs <container_name> to inspect startup.bash
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 help
The SQL Editor provides a split-panel interface:
Keyboard Shortcuts:
- Ctrl+A - Execute all queries
- Ctrl+R - Clear results
- Tab - Cycle through autocomplete suggestions
- Enter - Select highlighted suggestion
- Esc - 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:
~/.config/maxim/config.json%APPDATA%\maxim\config.jsonOnly connection details (host, port, username, database name) are saved—passwords are never stored and must be entered each time.
Maxim is fully keyboard-driven:
maxim create
# Follow the prompts to enter:
# - Database name
# - Username
# - Password
maxim list
# Shows all databases on the server (includes [Docker] entries)
# Press Esc to return to menu
maxim connect
# Enter host, port, username, password, and database name
# Open "Editor" to type queries with autocomplete
sudo systemctl status postgresql (Linux)Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or feature requests, please open an issue on GitHub.
Enjoy working with your databases! 🚀
$ claude mcp add maxim \
-- python -m otcore.mcp_server <graph>