HELLO(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

HELLO πŸ’– (that's HELLO(3valkey), bestie)

okay so this is the Valkey Command Manual page for HELLO, and ngl it's literally the "hi bestie let's be friends" command. it handshakes with the server. that's the whole vibe. 🫢


✨ SYNOPSIS ✨

HELLO [protover [AUTH username password] [SETNAME clientname]]

🌸 DESCRIPTION 🌸

so what does it DO. three things, pick your fighter: it switches you to a different protocol, and/or it authenticates you, and/or it sets the connection's name. and if you call it with no args at all, it just gives you a contextual client report. iconic behavior honestly.

Valkey speaks two protocols: RESP2 and RESP3. RESP3 has certain advantages, because when the connection is in this mode, Valkey is able to reply with more semantical replies. for instance, valkey-hgetall(7) HGETALL will return a map type, so a client library implementation no longer requires to know in advance to translate the array into a hash before returning it to the caller. like, it just knows. for a full coverage of RESP3, please check the RESP3 specification.

Valkey connections start in RESP2 mode, so clients implementing RESP2 do not need to updated or changed. (yes that sentence is a little cursed, we're keeping it exactly as-is, no cap.) there are no short term plans to drop support for RESP2, although future version may default to RESP3. πŸ‘€

HELLO always replies with a list of current server and connection properties, such as: versions, modules loaded, client ID, replication role and so forth. the availability_zone field only shows up when it is set in the configs, see availability-zone config for more details, added in Valkey 8.1.

when called without any arguments and its default use of RESP2 protocol, the reply looks like this:

> HELLO
 1) "server"
 2) "redis"
 3) "version"
 4) "255.255.255"
 5) "proto"
 6) (integer) 2
 7) "id"
 8) (integer) 5
 9) "mode"
10) "standalone"
11) "role"
12) "master"
13) "modules"
14) (empty array)
15) "availability_zone"
16) "us-east-1"

clients that want to handshake using the RESP3 mode need to call the HELLO command and specify the value "3" as the protover argument, like so:

> HELLO 3
1# "server" => "redis"
2# "version" => "7.2.4"
3# "proto" => (integer) 3
4# "id" => (integer) 10
5# "mode" => "standalone"
6# "role" => "master"
7# "modules" => (empty array)
8# "availability_zone" => "us-east-1"

because HELLO replies with useful information, and given that protover is optional or can be set to "2", client library authors may consider using this command instead of the canonical PING when setting up the connection. (sorry PING, you're still loved, but HELLO ate. πŸ’…)

when called with the optional protover argument, this command switches the protocol to the specified version and also accepts the following options:

  • AUTH <username> <password> β€” directly authenticate the connection in addition to switching to the specified protocol version. this makes calling valkey-auth(7) AUTH before HELLO unnecessary when setting up a new connection. note that the username can be set to "default" to authenticate against a server that does not use ACLs, but rather the simpler requirepass mechanism. πŸŽ€
  • SETNAME <clientname> β€” this is the equivalent of calling valkey-client-setname(7) CLIENT SETNAME. same energy, different font.

πŸ“¬ REPLY πŸ“¬

bestie if you ask for a protover that doesn't exist you get a simple error and honestly? fair.

⚑ COMPLEXITY ⚑

O(1)

like. constant time. it's giving instant. ✨


πŸ‘‘ ACL CATEGORIES πŸ‘‘

@connection @fast


πŸ¦‹ HISTORY πŸ¦‹

  • Available since: 6.0.0
  • Changed in 8.1.0: A new availability_zone field is added to the response if the availability-zone config is set.
  • Changed in 6.2.0: protover made optional; when called without arguments the command reports the current connection's context.

🌈 SEE ALSO 🌈

auth(3valkey), client(3valkey), client-caching(3valkey), client-capa(3valkey), client-getname(3valkey), client-getredir(3valkey), client-help(3valkey), client-id(3valkey), client-import-source(3valkey), client-info(3valkey), client-kill(3valkey), client-list(3valkey), client-no-evict(3valkey), client-no-touch(3valkey), client-pause(3valkey), client-reply(3valkey), client-setinfo(3valkey), client-setname(3valkey), client-tracking(3valkey), client-trackinginfo(3valkey), client-unblock(3valkey), client-unpause(3valkey), echo(3valkey), ping(3valkey), quit(3valkey), reset(3valkey), select(3valkey)


version 9.0.0, dated 2025-10-21 β€” that's the tea, go handshake with a server and slay, ily, bye πŸ’œπŸ§šβ€β™€οΈπŸ“

πŸ“¦ where this page comes from