Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mat2cc/redis_tui
Redis terminal application
https://github.com/mat2cc/redis_tui
command-line go golang redis redis-client terminal-based tui
Last synced: 2 months ago
JSON representation
Redis terminal application
- Host: GitHub
- URL: https://github.com/mat2cc/redis_tui
- Owner: mat2cc
- License: gpl-3.0
- Created: 2023-10-06T13:01:46.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-09T03:49:21.000Z (10 months ago)
- Last Synced: 2024-05-18T00:27:44.559Z (6 months ago)
- Topics: command-line, go, golang, redis, redis-client, terminal-based, tui
- Language: Go
- Homepage:
- Size: 68.4 KB
- Stars: 79
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- charm-in-the-wild - redis_tui - A Redis database browser. (_built with Bubble Tea_) (Applications / Database Tools)
README
# redis_tui
Redis terminal browser written in go, with the use of charmbraclet's [bubbletea](https://github.com/charmbracelet/bubbletea)
https://github.com/mat2cc/redis_tui/assets/19396939/8389236f-71c7-4062-b103-4c53a1ca94db
## Install
**homebrew**:
```sh
brew install mat2cc/tap/redis_tui
```**go**:
```sh
go install github.com/mat2cc/redis_tui@latest
```## Usage
```sh
redis_tui -address localhost:6379 -db 2
```Enter your `redis://` address, db, etc. and connect to redis.
*note:* this will also work wish ssh tunneling into a redis database.
Check `--help` for more options!While in the redis_tui, press `?` for movement instructions
## Under the hood
redis_tui is powered by the [redis SCAN command](https://redis.io/commands/scan) where we are gathering a variable number of keys per scan (configured by the `--scan-size` arguments, with default of 1000). A cursor is kept so that every time the `m` key is pressed, more keys will be fetched.
To get the redis type information, we are using a [Redis Pipeline](https://redis.io/docs/manual/pipelining/) which will batch all of the type reqests for each scan into one transaction. This can be disabled by setting `--include-types=false`, where type information will only be retrieved when opening the details view for a specific key.
## Production Considerations
The redis SCAN command can safely be used in production since we can limit the number of keys returned per request. Some things to keep in mind when querying production redis or when performance in a concern:
- reduce the number of elements returned per request with the `--scan-size` argument (the `m` key can always fetch more keys)
- if possible query against a replica redis db
- set the `--include-types=false` to omit the redis pipeline that gathers type data for all keys