KEYDB-CLI(1)

πŸ“¦ version 6.3.4, in epel 10, epel 9, fedora 43, fedora 44

πŸ’– KEYDB-CLI πŸ’–

okay so this is the manual page for keydb-cli β€” that's section 1 of the manual, the User commands girlies πŸ’… β€” and bestie, you're gonna eat this up.


✨ NAME ✨

keydb-cli β€” the KeyDB client, aka your lil bestie that talks to the server 🫢


🌸 SYNOPSIS 🌸

keydb-cli [ options ] [cmd [arg [arg ...]]]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so KeyDB?? it's an open source (BSD licensed πŸ’–) in-memory data structure store β€” like, it does database, cache, and message broker duties all at once, main character energy fr fr. You can find it at https://docs.keydb.dev/ ✨

And keydb-cli? It's a command line client to keydb-server. That's the whole vibe. It's the little remote control for your server bestie 🌈


πŸ’… OPTIONS πŸ’…

  • -h hostname β€” which server hostname we're pulling up to (default: 127.0.0.1). Home sweet localhost 🏠
  • -p port β€” server port (default: 6379).
  • -s socket β€” server socket. Heads up bestie: this one overrides hostname and port. It's giving "I'm the priority now" πŸ‘‘
  • -a password β€” the password you use when connecting to the server πŸ”
  • -r repeat β€” run the specified command N times. Spam it, queen πŸ“£
  • -i interval β€” when -r is in play, it waits interval seconds per command. And yes, sub-second times are a thing β€” like -i 0.1. We love precision πŸ’«
  • -n db β€” database number.
  • -x β€” read the last argument from STDIN. Sneaky, lowkey iconic.
  • -d delimiter β€” multi-bulk delimiter in for raw formatting (default: 0.
  • -c β€” enable cluster mode. It follows -ASK and -MOVED redirections like the loyal bestie it is 🧚
  • --raw β€” use raw formatting for replies. (This is the default when STDOUT is not a tty.)
  • --no-raw β€” force formatted output even when STDOUT is not a tty. No raw here, we're being fancy ✨
  • --csv β€” output in CSV format.
  • --stat β€” print rolling stats about the server: mem, clients, ...
  • --latency β€” enter a special mode continuously sampling latency ⏱️
  • --latency-history β€” like --latency but it tracks latency changes over time. Default time interval is 15 sec, and you change it using -i.
  • --latency-dist β€” shows latency as a spectrum. Requires xterm 256 colors 🌈 Default time interval is 1 sec, change it using -i.
  • --lru-test β€” simulate a cache workload with an 80-20 distribution πŸ“Š
  • --slave β€” simulate a slave, showing commands received from the master πŸ‘€
  • --rdb filename β€” transfer an RDB dump from a remote server to a local file πŸ“¦
  • --pipe β€” transfer raw KeyDB protocol from stdin to the server 🚰
  • --pipe-timeout n β€” in --pipe mode, abort with error if, after sending all data, no reply is received within n seconds. Default timeout: 30. Use 0 to wait forever ⏳
  • --bigkeys β€” sample KeyBD keys looking for big keys πŸ”
  • --scan β€” list all keys using the SCAN command.
  • --pattern pat β€” useful with --scan to specify a SCAN pattern 🎯
  • --intrinsic-latency sec β€” run a test to measure intrinsic system latency. The test runs for the specified amount of seconds.
  • --eval file β€” send an EVAL command using the Lua script at file πŸ§™β€β™€οΈ
  • --ldb β€” used with --eval, enables the KeyDB Lua debugger.
  • --ldb-sync-mode β€” like --ldb but uses the synchronous Lua debugger. In this mode the server is blocked and script changes are are not rolled back from the server memory. > 🚨 bestie, read that again β€” blocked server, no rollback. Be careful out here.
  • --help β€” output this help and exit.
  • --version β€” output version and exit.

πŸŽ€ EXAMPLES πŸŽ€

cat /etc/passwd | keydb-cli -x set mypasswd
keydb-cli get mypasswd
keydb-cli -r 100 lpush mylist x
keydb-cli -r 100 -i 1 info | grep used_memory_human:
keydb-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3
keydb-cli --scan --pattern '*:12345*'

look at that pipeline in the fourth one 😭 the way it just works.


πŸ™ˆ BUGS πŸ™ˆ

Found a lil bug? Same, we're all just doing our best. Go here: https://docs.keydb.dev/ and https://github.com/JohnSully/KeyDB.git/issues πŸ›


Copyright Β© 2006-2016 Salvatore Sanfilippo Copyright Β© 2019- John Sully

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Redis nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

that's the whole page bestie, no cap πŸ’œ and yeah, this came out under KeyDB, dated 2019, for KEYDB-CLI(1) β€” you're welcome, go slay πŸŽ€βœ¨

πŸ“¦ where this page comes from