{
  "id": "tor",
  "name": "Tor",
  "homepage": "https://www.torproject.org",
  "description": "The second-generation onion router.",
  "executables": [
    "tor"
  ],
  "dotfiles": {
    "paths": [
      "~/.torrc"
    ],
    "exclude": [],
    "secret": [],
    "side_effect": false,
    "secret_paths": [
      {
        "file": "~/.torrc",
        "match": {
          "prefix": [
            "HashedControlPassword"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Run or check Tor",
    "description": "Start tor with a chosen torrc and SOCKS port, or only verify the configuration. Hashing passwords, key listing and Windows service options 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://gitlab.torproject.org/tpo/core/tor/-/raw/main/doc/man/tor.1.txt",
        "revision": "2026-10-27",
        "evidence": "-f, --torrc-file FILE\n    Specify a new configuration file to contain further Tor configuration options\n--allow-missing-torrc\n    Allow the configuration file specified by -f to be missing\n--ignore-missing-torrc\n    Specify that Tor should treat a missing torrc file as though it were empty.\n--verify-config\n    Verify whether the configuration file is valid.\n--dump-config short|full\n    Write a list of Tor's configured options to standard output.\n--list-torrc-options\n    List all valid options.\nformat --OptionName OptionValue: --SocksPort 9999\n"
      }
    ],
    "field": [
      {
        "id": "torrc",
        "label": "torrc file",
        "type": "path",
        "path": {
          "kind": "file",
          "role": "input"
        },
        "option": [
          "-f",
          "--torrc-file"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "socks_port",
        "label": "SOCKS port",
        "type": "integer",
        "option": [
          "--SocksPort"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "verify_config",
        "label": "Verify configuration only",
        "type": "boolean",
        "option": [
          "--verify-config"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "dump_config",
        "label": "Dump configuration",
        "type": "enum",
        "option": [
          "--dump-config"
        ],
        "choices": [
          {
            "value": "short",
            "label": "Only non-default options"
          },
          {
            "value": "full",
            "label": "All options"
          }
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "list_options",
        "label": "List valid options",
        "type": "boolean",
        "option": [
          "--list-torrc-options"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "allow_missing",
        "label": "Allow missing torrc",
        "type": "boolean",
        "option": [
          "--allow-missing-torrc"
        ],
        "sources": [
          "manual"
        ]
      }
    ],
    "task": [
      {
        "id": "verify",
        "label": "Verify a torrc",
        "fields": [
          "torrc",
          "verify_config"
        ],
        "required": [
          "torrc",
          "verify_config"
        ],
        "set": {
          "verify_config": [
            true
          ]
        }
      },
      {
        "id": "run",
        "label": "Start with a torrc",
        "fields": [
          "torrc",
          "socks_port"
        ],
        "required": [
          "torrc"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "torrc",
          "socks_port",
          "verify_config"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "dump_config",
          "list_options",
          "allow_missing"
        ]
      }
    ]
  }
}
