{
  "schema_version": 2,
  "id": "commands/client-getname",
  "title": "CLIENT GETNAME",
  "url": "https://redis.io/docs/latest/commands/client-getname/",
  "summary": "Returns the name of the connection.",
  "since": "2.6.9",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:21+01:00",
  "page_type": "content",
  "content_hash": "0d7c24b7e223bedaf107f2984819c7b5b2df5533cf92c4829499f6b3cbef7ad9",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The `CLIENT GETNAME` returns the name of the current connection as set by [`CLIENT SETNAME`](https://redis.io/docs/latest/commands/client-setname). Since every new connection starts without an associated name, if no name was assigned nil is returned."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): the connection name of the current connection.\n* [Nil reply](../../develop/reference/protocol-spec#bulk-strings): the connection name was not set.\n\n**RESP3:**\n\nOne of the following:\n* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): the connection name of the current connection.\n* [Null reply](../../develop/reference/protocol-spec#nulls): the connection name was not set."
    }
  ],
  "examples": []
}
