memtui

Crates.iomemtui
lib.rsmemtui
version0.3.2
created_at2025-11-23 13:16:49.610021+00
updated_at2025-12-08 01:05:42.795523+00
descriptionAn interactive TUI (Terminal User Interface) for browsing and inspecting key-value stores (Redis, Memcached, etc.)
homepagehttps://github.com/dmk/memtui
repositoryhttps://github.com/dmk/memtui
max_upload_size
id1946547
size651,692
Dmytro Koval (dmk)

documentation

README

memtui

memtui is an interactive TUI (Terminal User Interface) that lets you browse, search, and inspect key-value stores from a single interface. Built in Rust for speed and reliability.

Features

MVP (v0.1)

  • Multi-backend support: Redis, Memcached, etcd
  • Connection management: Save and load connection profiles
  • Key browsing: List, search (fuzzy + pattern matching), sort keys
  • Value inspection: View values with pagination for large data
  • Server info: Display version, uptime, memory usage
  • Clean UI: Three-panel layout with mouse support and help modal

Read-only by default

All operations are read-only to prevent accidents. Write operations will be opt-in via flag.

Architecture

┌───────────────────────────────────────────────────────┐
│                     memtui                            │
├───────────────────────────────────────────────────────┤
│                                                       │
│  ┌─────────────┐  ┌──────────────┐  ┌──────────────┐  │
│  │ Connections │  │  Key Browser │  │ Value Viewer │  │
│  │             │  │              │  │              │  │
│  │  • Redis    │  │  Filter: *   │  │  {           │  │
│  │  • Memcache │  │              │  │    "user":.. │  │
│  │  • etcd     │  │  user:123    │  │    "email".. │  │
│  │             │  │  user:456    │  │  }           │  │
│  │             │  │  session:*   │  │              │  │
│  └─────────────┘  └──────────────┘  └──────────────┘  │
│                                                       │
│  Status: Connected | Keys: 1,234 | [?] Help           │
└───────────────────────────────────────────────────────┘

Two-layer design

Layer 1: Backend abstraction

  • Trait-based backend system
  • Each store (Redis, Memcached, etcd) implements Backend trait
  • Unified API: connect(), scan_keys(), get(), info(), etc.
  • Capability flags: backends declare what features they support

Layer 2: UI layer

  • Backend-agnostic display code
  • Unified keybindings across all backends
  • Pluggable formatters for different value types
  • Consistent UX regardless of backend

Roadmap

Near future

  • Format auto-detection (JSON, msgpack, binary)
  • Syntax highlighting for JSON
  • Raw command mode
  • Status bar with real-time connection info

Later

  • Multi-connection support (connect to multiple DBs at once)
  • TLS/SSL support
  • Tree view for hierarchical keys
  • Write operations (set, delete) with confirmations
  • Export/import functionality
  • Config file support
  • Custom themes and keybindings

Way later

  • Additional backends: Valkey, DragonflyDB, Consul, ZooKeeper
  • Cluster mode support
  • Pub/Sub monitoring
  • Real-time key watching (etcd-style)
  • Transaction support
  • Plugin system for custom formatters

Contributing

This is early stage. If you want to add a backend, implement the Backend trait in src/backend/.

Development

Quick Start

# Build and run
make run

# Run tests
make test

# Format and lint
make fmt
make clippy

# Full verification (CI checks)
make verify

See CONTRIBUTING.md for more details.

License

Apache License 2.0 - see LICENSE for details

Commit count: 0

cargo fmt