{
  "id": "whodb-cli",
  "name": "WhoDB CLI",
  "homepage": "https://github.com/clidey/whodb",
  "description": "Database management CLI with TUI interface, MCP server support, AI, and more",
  "executables": [
    "whodb",
    "whodb-cli"
  ],
  "dotfiles": {
    "paths": [
      "[appData]/whodb/config.json",
      "[xdgData]/whodb/config.json",
      "%APPDATA%/whodb/config.json"
    ],
    "secret": [],
    "secret_paths": [
      {
        "file": [
          "[appData]/whodb/config.json",
          "[xdgData]/whodb/config.json",
          "%APPDATA%/whodb/config.json"
        ],
        "format": "json",
        "match": {
          "key_path": [
            "cli.connections.*.password"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "WhoDB CLI",
    "description": "Run a SQL query or export table data with whodb. Connection management, TUI and MCP modes are not covered.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "query"
        ],
        "label": "Run a SQL query",
        "description": "Execute one SQL statement against a saved connection.",
        "source": [
          {
            "id": "readme",
            "kind": "help",
            "url": "https://github.com/clidey/whodb/blob/main/cli/README.md",
            "revision": "2026-10-27",
            "evidence": "whodb query \"SQL\" [flags]\n- `--connection, -c`: Connection name to use (optional; if omitted, the first available connection is used)\n- `--format, -f`: Output format: `auto`, `table`, `plain`, `json`, `ndjson`, `csv`\n- `--stream`: Stream result rows incrementally (supported for `plain`, `json`, `ndjson`, and `csv`)\n- `--quiet, -q`: Suppress informational messages\n"
          }
        ],
        "field": [
          {
            "id": "sql",
            "label": "SQL",
            "type": "string",
            "position": 0,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "connection",
            "label": "Connection name",
            "type": "string",
            "option": [
              "--connection",
              "-c"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "format",
            "label": "Output format",
            "type": "enum",
            "option": [
              "--format",
              "-f"
            ],
            "choices": [
              {
                "value": "auto",
                "label": "Auto"
              },
              {
                "value": "table",
                "label": "Table"
              },
              {
                "value": "plain",
                "label": "Plain"
              },
              {
                "value": "json",
                "label": "JSON"
              },
              {
                "value": "ndjson",
                "label": "NDJSON"
              },
              {
                "value": "csv",
                "label": "CSV"
              }
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "stream",
            "label": "Stream rows",
            "type": "boolean",
            "option": [
              "--stream"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "quiet",
            "label": "Quiet",
            "type": "boolean",
            "option": [
              "--quiet",
              "-q"
            ],
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "query",
            "label": "Run query",
            "fields": [
              "sql",
              "connection",
              "format"
            ],
            "required": [
              "sql"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "sql",
              "connection",
              "format"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "stream",
              "quiet"
            ]
          }
        ]
      },
      {
        "path": [
          "export"
        ],
        "label": "Export data",
        "description": "Export a table or query result to a CSV or Excel file.",
        "source": [
          {
            "id": "readme",
            "kind": "help",
            "url": "https://github.com/clidey/whodb/blob/main/cli/README.md",
            "revision": "2026-10-27",
            "evidence": "whodb export --connection my-postgres --table users --format csv --output users.csv\n- `--connection, -c`: Connection name (optional; if omitted, the first available connection is used)\n- `--table, -t`: Table name (required unless using `--query`)\n- `--query, -Q`: SQL query to export results from (use instead of `--table`)\n- `--schema, -s`: Schema name\n- `--format, -f`: Export format: `csv` or `excel` (auto-detected from filename if omitted)\n- `--output, -o`: Output file path (required)\n- `--delimiter, -d`: CSV delimiter (default: comma)\n- `--stream`: Stream CSV exports incrementally to the output file\n- `--quiet, -q`: Suppress informational messages\n"
          }
        ],
        "field": [
          {
            "id": "connection",
            "label": "Connection name",
            "type": "string",
            "option": [
              "--connection",
              "-c"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "table",
            "label": "Table",
            "type": "string",
            "option": [
              "--table",
              "-t"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "query",
            "label": "SQL query (instead of table)",
            "type": "string",
            "option": [
              "--query",
              "-Q"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "schema",
            "label": "Schema",
            "type": "string",
            "option": [
              "--schema",
              "-s"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "format",
            "label": "Export format",
            "type": "enum",
            "option": [
              "--format",
              "-f"
            ],
            "choices": [
              {
                "value": "csv",
                "label": "CSV"
              },
              {
                "value": "excel",
                "label": "Excel"
              }
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "output",
            "label": "Output file",
            "type": "path",
            "path": {
              "kind": "file",
              "role": "output"
            },
            "option": [
              "--output",
              "-o"
            ],
            "effect": "overwrite",
            "sources": [
              "readme"
            ]
          },
          {
            "id": "delimiter",
            "label": "CSV delimiter",
            "type": "string",
            "option": [
              "--delimiter",
              "-d"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "stream",
            "label": "Stream CSV",
            "type": "boolean",
            "option": [
              "--stream"
            ],
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "export_table",
            "label": "Export a table",
            "fields": [
              "connection",
              "table",
              "schema",
              "format",
              "output"
            ],
            "required": [
              "table",
              "output"
            ]
          },
          {
            "id": "export_query",
            "label": "Export query results",
            "fields": [
              "connection",
              "query",
              "format",
              "output"
            ],
            "required": [
              "query",
              "output"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "connection",
              "table",
              "query",
              "schema",
              "format",
              "output"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "delimiter",
              "stream"
            ]
          }
        ]
      }
    ]
  }
}
