CLIENT-ID(3valkey)
β¨ CLIENT-ID β¨
okay bestie so this is a page from the Valkey Command Manual (the 3valkey girlies know π
), and it's all about the CLIENT-ID command. sit down, hydrate, let's get into it π
πΈ NAME πΈ
client-id β returns the unique client ID of the connection. that's it. that's the whole vibe. your very own connection's little government name ππ
π¦ SYNOPSIS π¦
CLIENT ID
no args, no drama, no flags. she's low maintenance, she's iconic, she just is β¨
π DESCRIPTION π
so like, this command just hands you the ID of the current connection. that's the whole job. but don't sleep on it, because every connection ID comes with certain guarantees, and these are important, no cap:
- It is never repeated. so if
CLIENT IDgives you the same number twice, you can be absolutely sure that the underlying client did not disconnect and reconnect β it's still the same connection, fr fr. same girl, same vibe check, same connection π«Ά - The ID is monotonically incremental. if one connection's ID is greater than another connection's ID, it is guaranteed that the second connection was established with the server at a later time. so bigger number = showed up later, periodt. β°
this command is especially useful together with valkey-client-unblock(7) CLIENT UNBLOCK β go check the CLIENT UNBLOCK command page for a whole pattern involving the two of them, iykyk π
π REPLY π
valkey-protocol(7) Integer reply: the ID of the client. a whole number, that's your baby's ID π«
β COMPLEXITY β
constant time, bestie. she's fast, she's effortless, she ate π₯
π ACL CATEGORIES π
@connection @slow
(not me side-eyeing the @slow tag on an O(1) command π it's giving "categories are categories")
π HISTORY π
- Available since: 5.0.0 β she's been around, she's a legend, she's not new here π
β¨ EXAMPLES β¨
127.0.0.1:6379> CLIENT ID
(integer) 2873
look at that number. gorgeous. iconic. your number π
π§ SEE ALSO π§
auth(3valkey)client(3valkey)client-caching(3valkey)client-capa(3valkey)client-getname(3valkey)client-getredir(3valkey)client-help(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)hello(3valkey)ping(3valkey)quit(3valkey)reset(3valkey)select(3valkey)
and that's the whole page, bestie!! this was Valkey 9.0.0, dated 2025-10-21. go ask your connection for its ID, she'll tell you π β¨ mwah, bye!! πππ¦
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms