Skip to content
/ memtui Public

A modern TUI client for Memcached with tree-structured key navigation, smart JSON/binary formatting, and Vim keybindings

License

Notifications You must be signed in to change notification settings

nnnkkk7/memtui

Repository files navigation

memtui logo

memtui

A modern, intuitive TUI (Terminal User Interface) client for Memcached, built with Go.


CI Go Version Go Report Card License


memtui demo

Table of Contents


Why memtui?

Ever tried to debug Memcached data? Traditional tools like telnet or nc make it painful to browse keys, understand data formats, or safely edit values.

memtui brings the developer experience you expect from modern tools:

  • Browse all keys in a tree — Uses lru_crawler metadump to enumerate keys (requires Memcached 1.4.31+)
  • Auto-detect data formats — Recognizes JSON, gzip/zlib, and binary data automatically
  • Edit with conflict detection — CAS support detects concurrent modifications during edits

Highlights

  • Hierarchical Key Navigation — Browse keys organized in a tree structure with folder-like grouping
  • Smart Value Viewer — Auto-detect and format JSON, with syntax highlighting
  • VS Code-style Command Palette — Quick access to all commands with Ctrl+P
  • Real-time Key Filtering — Fuzzy search through thousands of keys instantly
  • Safe Operations — Confirmation dialogs for destructive operations
  • Vim-style Keybindings — Navigate with j/k, familiar to terminal users

Installation

Homebrew (macOS / Linux)

brew install nnnkkk7/tap/memtui

Using Go Install

go install github.com/nnnkkk7/memtui/cmd/memtui@latest

From Source

git clone https://github.com/nnnkkk7/memtui.git
cd memtui
go build -o memtui ./cmd/memtui

Requirements

Requirement Version Note
Go 1.25+ For building from source
Memcached 1.4.31+ Required for lru_crawler metadump support

Quick Start

  1. Start Memcached:
# Using Docker
docker run -d -p 11211:11211 memcached:latest
  1. Run memtui:
memtui                        # Connect to localhost:11211 (default)
memtui -addr localhost:11211  # Specify address
memtui --help                 # Show help

Use Cases

  • Debugging — Quickly inspect cached values during development
  • Data Migration — View and verify data before/after migrations
  • Cache Analysis — Understand key naming patterns and data distribution
  • Incident Response — Rapidly inspect cache state during outages

Keyboard Shortcuts

Navigation
Key Action
j / Move down
k / Move up
Enter Select key / Expand folder
Tab Switch between key list and viewer
Esc Return to key list / Close dialog
Commands
Key Action
Ctrl+P Open command palette
/ Filter keys (fuzzy search)
r Refresh key list
n Create new key
e Edit selected key's value
d Delete selected key
c Copy value to clipboard
? Show help
q Quit
In Value Viewer
Key Action
j / Scroll down
k / Scroll up
g Go to top
G Go to bottom
J JSON view mode
H Hex view mode
T Text view mode
A Auto view mode

Features

Tree-structured Key List

Keys are automatically organized into a hierarchical tree based on common delimiters (:, /, .). For example:

user:1001:profile  ─┐
user:1001:session  ─┼→  user/
user:1002:profile  ─┘     ├── 1001/
cache:api:users    ─┐     │     ├── profile
cache:api:posts    ─┘     │     └── session
                          ├── 1002/
                          │     └── profile
                          cache/
                            └── api/
                                  ├── users
                                  └── posts

Smart Value Detection

The viewer automatically detects and formats:

  • JSON — Pretty-printed with syntax highlighting
  • Compressed data — Detects gzip/zlib (displayed as hex in auto mode)
  • Binary data — Displays hex dump
  • Plain text — Shows as-is

Command Palette

Press Ctrl+P to open the VS Code-style command palette for quick access to all features with fuzzy search.


Configuration

Configuration file location: ~/.config/memtui/config.yaml

# Connection settings
connection:
  default_address: localhost:11211  # Default server address

# UI settings
ui:
  theme: dark           # dark or light
  key_delimiter: ":"    # Key hierarchy delimiter (e.g., ":", "/", ".")

CLI flags override config file settings:

memtui -addr localhost:11212  # Overrides connection.default_address

Built With

  • Bubble Tea — TUI framework based on The Elm Architecture
  • Bubbles — Common Bubble Tea components
  • Lip Gloss — Style definitions for terminal apps
  • gomemcache — Memcached client for Go

Contributing

Contributions are welcome! Here's how you can help:


Support

If you find memtui useful, please consider giving it a star on GitHub! It helps others discover the project and motivates continued development.

Star on GitHub


License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A modern TUI client for Memcached with tree-structured key navigation, smart JSON/binary formatting, and Vim keybindings

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •