Skip to content

Repository files navigation

MongoTUI

MongoTUI

PyPI Python License: AGPL-3.0 GitHub release Downloads GitHub Stars

A modern terminal user interface for MongoDB administration — like Compass, but for your terminal.

Built with Python, Textual, and PyMongo. Fast, secure, no web UI needed.

Features

Database Management

  • Browse databases, collections, and documents
  • Create and drop databases
  • View collection stats (document count, size)
  • Query documents with JSON filters
  • Run aggregation pipelines

User & Role Administration

  • Create and delete users
  • Reset passwords
  • Grant and revoke roles (built-in role picker)
  • Browse all users and their permissions

Index Management

  • View indexes with size and key info
  • Create and drop indexes
  • Create search indexes (text & vector search)
  • Vector search support with similarity options

Monitoring

  • Live performance graphs (connections, ops/s, memory)
  • Server stats (version, uptime, storage engine)
  • Replica set status and member health

UI

  • Compass-like sidebar with database/collection tree
  • Tabbed content area
  • Formatted document detail view
  • Keyboard-driven with mouse support

Installation

pip install mongotui

Usage

# Interactive — shows connection screen
mongotui

# Direct connection
mongotui --uri "mongodb://admin:admin@localhost:27017/?authSource=admin"

# Short form
mongotui -u "mongodb://admin:admin@localhost:27017/?authSource=admin"

Quick Start with Docker

# Start a local MongoDB instance
docker compose up -d

# Connect
mongotui -u "mongodb://admin:admin@localhost:27017/?authSource=admin"

Keyboard Shortcuts

Key Action
q Quit
r Refresh
Ctrl+C Force quit
Escape Close modal / go back
Enter Select / expand tree node
Tab Switch between panels

Tech Stack

  • Python 3.11+
  • Textual — TUI framework
  • PyMongo — MongoDB driver
  • textual-plotext — Terminal graphs

Requirements

  • Python 3.11+
  • MongoDB 4.4+ (standalone, replica set, or Atlas)

Perfect For

  • Self-hosted MongoDB deployments
  • Internal infrastructure teams
  • DevOps and platform engineers
  • Development and staging environments
  • Secure administration over SSH
  • Environments where Compass can't be installed

Development

git clone https://github.com/DevOpsPack/mongotui.git
cd mongotui
pip install -e .
mongotui

License

AGPL-3.0

About

Terminal-based MongoDB administration tool focused on user, role, and access management. Built with Python, Textual, and PyMongo.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages