{
  "id": "csvq",
  "name": "csvq",
  "homepage": "https://mithrandie.github.io/csvq",
  "description": "SQL-like query language for csv",
  "executables": [
    "csvq"
  ],
  "platforms": [
    "macos",
    "linux"
  ],
  "dotfiles": {
    "paths": [
      "[configHome]/csvq/csvq_env.json",
      "~/.csvq_env.json",
      "~/.csvq/csvq_env.json",
      "[configHome]/csvq/csvqrc",
      "~/.csvqrc",
      "~/.csvq/csvqrc"
    ],
    "exclude": [],
    "secret": []
  },
  "commands": {
    "format": 1,
    "label": "Run a query on CSV files",
    "description": "Run one SQL-like query (or a script file) against CSV and other delimited files. Encoding, locale, subcommands and interactive mode are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "manual",
        "kind": "manual",
        "url": "https://mithrandie.github.io/csvq/reference/command.html",
        "revision": "2026-10-27",
        "evidence": "csvq [options] [subcommand] [\"query\"|argument]\n--delimiter value, -d value\n--format value, -f value\n--no-header, -n\n--out FILE, -o FILE\n--quiet, -q\n--repository PATH, -r PATH\n--source FILE, -s FILE\n--write-delimiter value, -D value\n(The manual page typesets the double dash as an en dash.)\nvalue(case ignored): CSV, TSV, FIXED, JSON, JSONL, LTSV, GFM, ORG, BOX, TEXT\n"
      }
    ],
    "field": [
      {
        "id": "query",
        "label": "Query",
        "description": "A SQL-like statement, quoted. Leave empty when loading statements from a source file.",
        "type": "string",
        "position": 0,
        "sources": [
          "manual"
        ]
      },
      {
        "id": "source",
        "label": "Source file",
        "description": "Load the query or statements from a file.",
        "type": "path",
        "option": [
          "--source",
          "-s"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "format",
        "label": "Output format",
        "type": "enum",
        "option": [
          "--format",
          "-f"
        ],
        "choices": [
          {
            "value": "CSV",
            "label": "CSV"
          },
          {
            "value": "TSV",
            "label": "TSV"
          },
          {
            "value": "FIXED",
            "label": "Fixed-length"
          },
          {
            "value": "JSON",
            "label": "JSON"
          },
          {
            "value": "JSONL",
            "label": "JSON Lines"
          },
          {
            "value": "LTSV",
            "label": "LTSV"
          },
          {
            "value": "GFM",
            "label": "GitHub Markdown table"
          },
          {
            "value": "ORG",
            "label": "Org-mode table"
          },
          {
            "value": "BOX",
            "label": "Box-drawing table"
          },
          {
            "value": "TEXT",
            "label": "Text table"
          }
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "out",
        "label": "Output file",
        "description": "Export select results to a file instead of standard output.",
        "type": "path",
        "option": [
          "--out",
          "-o"
        ],
        "path": {
          "kind": "file",
          "role": "output",
          "must_exist": false
        },
        "effect": "overwrite",
        "sources": [
          "manual"
        ]
      },
      {
        "id": "repository",
        "label": "Directory of data files",
        "type": "path",
        "option": [
          "--repository",
          "-r"
        ],
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "delimiter",
        "label": "Input delimiter",
        "type": "string",
        "option": [
          "--delimiter",
          "-d"
        ],
        "suggestions": [
          {
            "value": ",",
            "label": "Comma"
          },
          {
            "value": "\\t",
            "label": "Tab"
          },
          {
            "value": ";",
            "label": "Semicolon"
          }
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "write_delimiter",
        "label": "Output delimiter",
        "type": "string",
        "option": [
          "--write-delimiter",
          "-D"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "no_header",
        "label": "Files have no header row",
        "type": "boolean",
        "option": [
          "--no-header",
          "-n"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "quiet",
        "label": "Quiet",
        "type": "boolean",
        "option": [
          "--quiet",
          "-q"
        ],
        "sources": [
          "manual"
        ]
      }
    ],
    "task": [
      {
        "id": "query",
        "label": "Query CSV files",
        "fields": [
          "query",
          "format",
          "repository",
          "no_header"
        ],
        "required": [
          "query"
        ]
      },
      {
        "id": "script",
        "label": "Run a script file",
        "fields": [
          "source",
          "format",
          "out",
          "repository"
        ],
        "required": [
          "source"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "query",
          "source",
          "format",
          "out",
          "repository"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "delimiter",
          "write_delimiter",
          "no_header",
          "quiet"
        ]
      }
    ]
  }
}
