{
  "id": "tvnamer",
  "name": "tvnamer",
  "homepage": "https://github.com/dbr/tvnamer",
  "description": "A utility to rename files from some.show.s01e03.blah.abc.avi to Some Show - [01x03] - The Episode Name.avi, using data from TheTVDB.",
  "executables": [
    "tvnamer"
  ],
  "dotfiles": {
    "paths": [
      "~/.config/tvnamer/tvnamer.json",
      "~/.tvnamer.json"
    ],
    "exclude": [],
    "secret": [],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Rename TV episodes",
    "description": "Rename TV episode files using data from TheTVDB. Config-file saving and naming-pattern flags are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "readme",
        "kind": "manual",
        "url": "https://github.com/dbr/tvnamer/blob/master/README.md",
        "revision": "2026-10-27",
        "evidence": "tvnamer will only descend one level into directories unless the `-r` (or `--recursive`) flag is specified.\n    tvnamer --recursive dir1/\nThe most useful are most likely `--batch`, `--selectfirst` and `--always`:\n`--selectfirst` will select the first series the search found, but will not automatically rename any episodes.\n`--always` will ask you select the correct series, then automatically rename all files.\n`--batch` will not prompt you for anything. It automatically selects the first series search result, and automatically rename all files\n`--series-id` will allow you to use a specific ID from theTVdb.\ntvnamer --config=/path/to/mytvnamerconfig.json\n"
      }
    ],
    "field": [
      {
        "id": "paths",
        "label": "Files or directories",
        "type": "path",
        "path": {
          "kind": "any",
          "role": "input",
          "must_exist": true
        },
        "position": 0,
        "multiple": true,
        "min": 1,
        "sources": [
          "readme"
        ]
      },
      {
        "id": "recursive",
        "label": "Recurse into directories",
        "type": "boolean",
        "option": [
          "--recursive",
          "-r"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "selectfirst",
        "label": "Select first search result",
        "type": "boolean",
        "option": [
          "--selectfirst"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "always",
        "label": "Always rename",
        "type": "boolean",
        "option": [
          "--always"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "batch",
        "label": "Batch (no prompts)",
        "description": "Selects the first result and renames everything. Use carefully.",
        "type": "boolean",
        "option": [
          "--batch"
        ],
        "effect": "overwrite",
        "sources": [
          "readme"
        ]
      },
      {
        "id": "series_id",
        "label": "TheTVDB series ID",
        "type": "integer",
        "option": [
          "--series-id"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "config",
        "label": "Config file",
        "type": "path",
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "option": [
          "--config"
        ],
        "sources": [
          "readme"
        ]
      }
    ],
    "task": [
      {
        "id": "interactive",
        "label": "Rename interactively",
        "fields": [
          "paths",
          "recursive",
          "series_id",
          "config"
        ],
        "required": [
          "paths"
        ]
      },
      {
        "id": "batch",
        "label": "Rename without prompts",
        "set": {
          "batch": [
            true
          ]
        },
        "lock": [
          "batch"
        ],
        "fields": [
          "paths",
          "recursive",
          "series_id",
          "config"
        ],
        "required": [
          "paths"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "paths",
          "recursive",
          "series_id"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "selectfirst",
          "always",
          "batch",
          "config"
        ]
      }
    ]
  }
}
