memtui

command module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 0 Imported by: 0

README

memtui

CI Go Version Go Report Card License

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

memtui demo

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

Requirements

Requirement Version Note
Go 1.25+ For building from source
Memcached 1.4.31+ Required for lru_crawler metadump support (enabled by default in 1.5+)

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

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

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
In Editor
Key Action
Ctrl+S Save changes
Esc Cancel editing
Ctrl+F Format JSON (in JSON 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 - Auto-decompresses gzip/zlib
  • 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! Please feel free to submit a Pull Request.

License

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package app provides the main application logic for memtui.
Package app provides the main application logic for memtui.
Package client provides Memcached client functionality including connection handling, key enumeration, CAS operations, and server capability detection.
Package client provides Memcached client functionality including connection handling, key enumeration, CAS operations, and server capability detection.
cmd
memtui command
Package main provides the entry point for the memtui CLI application.
Package main provides the entry point for the memtui CLI application.
Package config provides configuration file support for memtui.
Package config provides configuration file support for memtui.
Package models defines the data structures used throughout memtui.
Package models defines the data structures used throughout memtui.
ui
components/command
Package command provides a command palette component for the memtui application.
Package command provides a command palette component for the memtui application.
components/dialog
Package dialog provides dialog components for user interactions.
Package dialog provides dialog components for user interactions.
components/editor
Package editor provides a value editor component for editing Memcached values.
Package editor provides a value editor component for editing Memcached values.
components/serverlist
Package serverlist provides a Bubble Tea component for displaying and managing a list of Memcached servers with connection status.
Package serverlist provides a Bubble Tea component for displaying and managing a list of Memcached servers with connection status.
components/stats
Package stats provides a Bubble Tea component for displaying Memcached server statistics.
Package stats provides a Bubble Tea component for displaying Memcached server statistics.
components/statusbar
Package statusbar provides a status bar component for displaying connection status.
Package statusbar provides a status bar component for displaying connection status.
components/viewer
Package viewer provides a component for displaying Memcached values in various formats.
Package viewer provides a component for displaying Memcached values in various formats.
layout
Package layout provides terminal layout management for memtui.
Package layout provides terminal layout management for memtui.
styles
Package styles provides theme and style definitions for the memtui application.
Package styles provides theme and style definitions for the memtui application.
Package viewer provides formatting and highlighting for data display.
Package viewer provides formatting and highlighting for data display.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL