{
  "id": "redis-di-add-context",
  "title": "redis-di add-context",
  "url": "https://redis.io/docs/latest/integrate/write-behind/reference/cli/redis-di-add-context/",
  "summary": "Adds a new context",
  "tags": [
    "docs",
    "integrate",
    "rs",
    "rdi"
  ],
  "last_updated": "2026-04-01T08:10:08-05:00",
  "page_type": "content",
  "content_hash": "8ab0e8eebc4e89ac9c9056723b45e5cb43fa42950abb091ceeb03d62c874af01",
  "sections": [
    {
      "id": "usage",
      "title": "Usage",
      "role": "syntax",
      "text": "[code example]"
    },
    {
      "id": "options",
      "title": "Options",
      "role": "parameters",
      "text": "- `context_name` (REQUIRED):\n\n  - Type: STRING\n  - Default: `none`\n  - Usage: `context-name`\n\n- `loglevel`:\n\n  - Type: Choice(['DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL'])\n  - Default: `info`\n  - Usage: `--loglevel\n-log-level`\n\n- `cluster_host` (REQUIRED):\n\n  - Type: STRING\n  - Default: `none`\n  - Usage: `--cluster-host`\n\n  Host/IP of Redis Enterprise Cluster (service name in case of k8s)\n\n- `cluster_api_port` (REQUIRED):\n\n  - Type: <IntRange 1000<=x<=65535>\n  - Default: `9443`\n  - Usage: `--cluster-api-port`\n\n  API Port of Redis Enterprise Cluster\n\n- `cluster_user` (REQUIRED):\n\n  - Type: STRING\n  - Default: `none`\n  - Usage: `--cluster-user`\n\n  Redis Enterprise Cluster username with either DB Member, Cluster Member or Cluster Admin roles\n\n- `rdi_host` (REQUIRED):\n\n  - Type: STRING\n  - Default: `none`\n  - Usage: `--rdi-host`\n\n  Host/IP of Write-behind Database\n\n- `rdi_port` (REQUIRED):\n\n  - Type: <IntRange 1000<=x<=65535>\n  - Default: `none`\n  - Usage: `--rdi-port`\n\n  Port of Write-behind Database\n\n- `rdi_key`:\n\n  - Type: STRING\n  - Default: `none`\n  - Usage: `--rdi-key`\n\n  Private key file to authenticate with\n\n- `rdi_cert`:\n\n  - Type: STRING\n  - Default: `none`\n  - Usage: `--rdi-cert`\n\n  Client certificate file to authenticate with\n\n- `rdi_cacert`:\n\n  - Type: STRING\n  - Default: `none`\n  - Usage: `--rdi-cacert`\n\n  CA certificate file to verify with\n\n- `help`:\n\n  - Type: BOOL\n  - Default: `false`\n  - Usage: `--help`\n\n  Show this message and exit."
    },
    {
      "id": "cli-help",
      "title": "CLI help",
      "role": "content",
      "text": "[code example]"
    }
  ],
  "examples": [
    {
      "id": "usage-ex0",
      "language": "plaintext",
      "code": "Usage: redis-di add-context [OPTIONS] CONTEXT_NAME",
      "section_id": "usage"
    },
    {
      "id": "cli-help-ex0",
      "language": "plaintext",
      "code": "Usage: redis-di add-context [OPTIONS] CONTEXT_NAME\n\n  Adds a new context\n\nOptions:\n  -log-level, --loglevel [DEBUG|INFO|WARN|ERROR|CRITICAL]\n                                  [default: INFO]\n  --cluster-host TEXT             Host/IP of Redis Enterprise Cluster (service\n                                  name in case of k8s)  [required]\n  --cluster-api-port INTEGER RANGE\n                                  API Port of Redis Enterprise Cluster\n                                  [default: 9443; 1000<=x<=65535; required]\n  --cluster-user TEXT             Redis Enterprise Cluster username with\n                                  either DB Member, Cluster Member or Cluster\n                                  Admin roles  [required]\n  --rdi-host TEXT                 Host/IP of Write-behind Database  [required]\n  --rdi-port INTEGER RANGE        Port of Write-behind Database  [1000<=x<=65535;\n                                  required]\n  --rdi-key TEXT                  Private key file to authenticate with\n  --rdi-cert TEXT                 Client certificate file to authenticate with\n  --rdi-cacert TEXT               CA certificate file to verify with\n  --help                          Show this message and exit.",
      "section_id": "cli-help"
    }
  ]
}
