{
  "id": "chdig",
  "name": "chdig",
  "homepage": "https://github.com/azat/chdig",
  "description": "Dig into ClickHouse with TUI interface.",
  "executables": [
    "chdig"
  ],
  "platforms": [
    "macos",
    "linux"
  ],
  "dotfiles": {
    "paths": [
      "~/.config/chdig/config.yaml",
      "~/.chdig.yaml"
    ],
    "exclude": [],
    "secret": [],
    "side_effect": false,
    "secret_paths": [
      {
        "file": [
          "~/.config/chdig/config.yaml",
          "~/.chdig.yaml"
        ],
        "format": "yaml",
        "match": {
          "key_path": [
            "password",
            "connections_credentials.*.password"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Connect to ClickHouse",
    "description": "Open the chdig TUI against a ClickHouse server. Passwords, TLS options, log limits and per-view subcommands are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "src",
        "kind": "help",
        "url": "https://github.com/azat/chdig/blob/main/src/interpreter/options.rs",
        "revision": "2026-10-27",
        "evidence": "-u, --url URL\n--host Overrides host in --url (for clickhouse-client compatibility)\n--port Overrides port in --url (for clickhouse-client compatibility)\n--user Overrides user in --url (for clickhouse-client compatibility)\n-C, --connection\n-c, --cluster\n--database Database with the system tables, e.g. a preserved copy; overrides database in --url\n--history Aggregate system.*_log historical data, using merge()\n--internal-queries Do not hide internal (spawned by chdig) queries\n-d, --delay-interval\n"
      }
    ],
    "field": [
      {
        "id": "url",
        "label": "Server URL",
        "type": "string",
        "option": [
          "--url",
          "-u"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "host",
        "label": "Host",
        "type": "string",
        "option": [
          "--host"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "port",
        "label": "Port",
        "type": "integer",
        "option": [
          "--port"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "user",
        "label": "User",
        "type": "string",
        "option": [
          "--user"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "connection",
        "label": "Named connection",
        "type": "string",
        "option": [
          "--connection",
          "-C"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "cluster",
        "label": "Cluster",
        "description": "Aggregate data from all hosts in the cluster.",
        "type": "string",
        "option": [
          "--cluster",
          "-c"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "database",
        "label": "System-tables database",
        "type": "string",
        "option": [
          "--database"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "history",
        "label": "Include historical logs",
        "type": "boolean",
        "option": [
          "--history"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "internal_queries",
        "label": "Show internal queries",
        "type": "boolean",
        "option": [
          "--internal-queries"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "delay_interval",
        "label": "Refresh interval (ms)",
        "type": "integer",
        "option": [
          "--delay-interval",
          "-d"
        ],
        "sources": [
          "src"
        ]
      }
    ],
    "task": [
      {
        "id": "connect",
        "label": "Connect by URL",
        "fields": [
          "url",
          "history"
        ],
        "required": [
          "url"
        ]
      },
      {
        "id": "connect_cluster",
        "label": "Inspect a cluster",
        "fields": [
          "url",
          "cluster"
        ],
        "required": [
          "url",
          "cluster"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "url",
          "connection",
          "cluster",
          "history"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "host",
          "port",
          "user",
          "database",
          "internal_queries",
          "delay_interval"
        ]
      }
    ]
  }
}
