{
  "id": "aria2c",
  "name": "aria2",
  "homepage": "https://aria2.github.io",
  "description": "aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line.",
  "executables": [
    "aria2c"
  ],
  "dotfiles": {
    "paths": [
      "~/.aria2/aria2.conf",
      "[configHome]/aria2/aria2.conf"
    ],
    "exclude": [],
    "secret": [],
    "secret_paths": [
      {
        "file": [
          "~/.aria2/aria2.conf",
          "[configHome]/aria2/aria2.conf"
        ],
        "match": {
          "prefix": [
            "rpc-secret",
            "rpc-passwd",
            "ftp-passwd",
            "http-passwd"
          ]
        }
      }
    ],
    "machine_lines": [
      {
        "file": [
          "~/.aria2/aria2.conf",
          "[configHome]/aria2/aria2.conf"
        ],
        "match": {
          "prefix": [
            "dir",
            "input-file",
            "ca-certificate"
          ]
        },
        "scope": "backup"
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Download files",
    "description": "Download one or more URLs, torrents or metalinks with aria2c. RPC, BitTorrent tuning, cookies and credentials are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "help",
        "kind": "help",
        "revision": "aria2 version 1.37.0",
        "evidence": " -d, --dir=DIR                The directory to store the downloaded file.\n -o, --out=FILE               The file name of the downloaded file. It is\n -s, --split=N                Download a file using N connections.\n -x, --max-connection-per-server=NUM The maximum number of connections to one\n -c, --continue[=true|false]  Continue downloading a partially downloaded\n -i, --input-file=FILE        Downloads URIs found in FILE.\n -j, --max-concurrent-downloads=N Set maximum number of parallel downloads for\n -Z, --force-sequential[=true|false] Fetch URIs in the command-line sequentially\n -k, --min-split-size=SIZE    aria2 does not split less than 2*SIZE byte range.\n -S, --show-files[=true|false] Print file listing of .torrent, .meta4 and\n -T, --torrent-file=TORRENT_FILE  The path to the .torrent file.\n -M, --metalink-file=METALINK_FILE The file path to the .meta4 and .metalink\n -l, --log=LOG                The file name of the log file.\n --max-connection-per-server=4 --min-split-size=1M.\n --file-allocation=METHOD     Specify file allocation method.\n 'none' doesn't pre-allocate file space. 'prealloc'\n"
      }
    ],
    "field": [
      {
        "id": "uris",
        "label": "URLs",
        "description": "HTTP(S), FTP, magnet links, or .torrent/.metalink files.",
        "type": "string",
        "position": 0,
        "multiple": true,
        "sources": [
          "help"
        ]
      },
      {
        "id": "dir",
        "label": "Download directory",
        "type": "path",
        "path": {
          "kind": "directory",
          "role": "output"
        },
        "option": [
          "--dir",
          "-d"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "out",
        "label": "Output file name",
        "type": "string",
        "option": [
          "--out",
          "-o"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "continue",
        "label": "Resume partial download",
        "type": "boolean",
        "option": [
          "--continue",
          "-c"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "split",
        "label": "Connections per file",
        "type": "integer",
        "option": [
          "--split",
          "-s"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "max_conn",
        "label": "Max connections per server",
        "type": "integer",
        "option": [
          "--max-connection-per-server",
          "-x"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "min_split",
        "label": "Min split size",
        "description": "For example 1M.",
        "type": "string",
        "option": [
          "--min-split-size",
          "-k"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "input_file",
        "label": "Read URLs from file",
        "type": "path",
        "path": {
          "kind": "file",
          "role": "input"
        },
        "option": [
          "--input-file",
          "-i"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "concurrent",
        "label": "Parallel downloads",
        "type": "integer",
        "option": [
          "--max-concurrent-downloads",
          "-j"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "file_allocation",
        "label": "File allocation",
        "type": "enum",
        "option": [
          "--file-allocation"
        ],
        "choices": [
          {
            "value": "none",
            "label": "None"
          },
          {
            "value": "prealloc",
            "label": "Pre-allocate"
          }
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "show_files",
        "label": "List torrent contents only",
        "type": "boolean",
        "option": [
          "--show-files",
          "-S"
        ],
        "sources": [
          "help"
        ]
      }
    ],
    "task": [
      {
        "id": "download",
        "label": "Download a URL",
        "fields": [
          "uris",
          "dir",
          "out",
          "continue"
        ],
        "required": [
          "uris"
        ]
      },
      {
        "id": "fast",
        "label": "Fast multi-connection download",
        "set": {
          "split": [
            16
          ],
          "max_conn": [
            16
          ]
        },
        "fields": [
          "uris",
          "dir",
          "split",
          "max_conn",
          "continue"
        ],
        "required": [
          "uris"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "uris",
          "dir",
          "out",
          "continue",
          "split",
          "max_conn"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "min_split",
          "input_file",
          "concurrent",
          "file_allocation",
          "show_files"
        ]
      }
    ]
  }
}
