{
  "id": "redis-di-use-context",
  "title": "redis-di use-context",
  "url": "https://redis.io/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-use-context/",
  "summary": "Sets a context to be the active one",
  "tags": [
    "redis-di"
  ],
  "last_updated": "2026-07-13T12:40:14-05:00",
  "page_type": "content",
  "content_hash": "8f4a8a340dd82158e526a92e43d0b3b56c32fa96313a821902f721401b888a38",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Sets a context in the `~/.redis-di` context file to be the active one, so its connection details are\nused by subsequent commands. Create or update a context with\n[`set-context`](https://redis.io/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-set-context)."
    },
    {
      "id": "usage",
      "title": "Usage",
      "role": "syntax",
      "text": "[code example]"
    },
    {
      "id": "options",
      "title": "Options",
      "role": "parameters",
      "text": "This command takes only the\n[global options](https://redis.io/docs/latest/integrate/redis-data-integration/reference/cli/redis-di#global-options)."
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    }
  ],
  "examples": [
    {
      "id": "usage-ex0",
      "language": "plaintext",
      "code": "redis-di use-context <name> [flags]",
      "section_id": "usage"
    },
    {
      "id": "example-ex0",
      "language": "bash",
      "code": "redis-di use-context prod",
      "section_id": "example"
    }
  ]
}
