content/commands/client-id.md
The command just returns the ID of the current connection. Every connection ID has certain guarantees:
CLIENT ID returns the same number, the caller can be sure that the underlying client did not disconnect and reconnect the connection, but it is still the same connection.This command is especially useful together with [CLIENT UNBLOCK]({{< relref "/commands/client-unblock" >}}) which was
introduced also in Redis 5 together with CLIENT ID. Check the [CLIENT UNBLOCK]({{< relref "/commands/client-unblock" >}}) command page for a pattern involving the two commands.
{{% redis-cli %}} CLIENT ID {{% /redis-cli %}}
| Redis
Software | Redis
Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
|:----------------------|:-----------------|:------|
| <span title="Supported">✅ Standard</span>
<span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span>
<span title="Supported"><nobr>✅ Active-Active</nobr></span> | Because Redis Software clustering allows [multiple active proxies]({{< relref "/operate/rs/databases/configure/proxy-policy" >}}), CLIENT ID cannot guarantee incremental IDs between clients that connect to different nodes under multi proxy policies. |
{{< multitabs id="client-id-return-info" tab1="RESP2" tab2="RESP3" >}}
Integer reply: the ID of the client.
-tab-sep-
Integer reply: the ID of the client.
{{< /multitabs >}}