{
  "description": "Download, inspect and extract Apple firmware. Covers 'download ipsw', 'info' and 'extract'; the many other subcommands (dyld, macho, kernel, ...) are not covered.",
  "name": "ipsw",
  "subcommands": [
    {
      "name": "download",
      "subcommands": [
        {
          "name": "ipsw",
          "description": "Download IPSW files (or just URLs, kernelcache or dyld cache) from ipsw.me. Filters by device, build or version.",
          "options": [
            {
              "names": [
                "--device",
                "-d"
              ],
              "description": "Product type, for example iPhone15,2.",
              "args": {
                "name": "device",
                "description": "Product type, for example iPhone15,2.",
                "isOptional": false
              }
            },
            {
              "names": [
                "--version",
                "-v"
              ],
              "description": "OS version",
              "args": {
                "name": "version",
                "isOptional": false
              }
            },
            {
              "names": [
                "--build",
                "-b"
              ],
              "description": "Build ID",
              "args": {
                "name": "build",
                "isOptional": false
              }
            },
            {
              "names": [
                "--latest"
              ],
              "description": "Latest only"
            },
            {
              "names": [
                "--macos"
              ],
              "description": "macOS IPSWs"
            },
            {
              "names": [
                "--urls",
                "-u"
              ],
              "description": "Print the download URLs instead of downloading."
            },
            {
              "names": [
                "--kernel"
              ],
              "description": "Extract the kernelcache from the remote IPSW."
            },
            {
              "names": [
                "--dyld"
              ],
              "description": "Only dyld_shared_cache"
            },
            {
              "names": [
                "--confirm",
                "-y"
              ],
              "description": "Skip confirmation"
            },
            {
              "names": [
                "--output",
                "-o"
              ],
              "description": "Output folder",
              "args": {
                "name": "output",
                "isOptional": false,
                "template": "folders"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "info",
      "description": "Display information about an IPSW or OTA file.",
      "options": [
        {
          "names": [
            "--json",
            "-j"
          ],
          "description": "JSON output"
        },
        {
          "names": [
            "--list",
            "-l"
          ],
          "description": "List contained files"
        }
      ],
      "args": [
        {
          "name": "ipsw",
          "isOptional": false,
          "template": "filepaths"
        }
      ]
    },
    {
      "name": "extract",
      "description": "Extract the kernelcache, dyld_shared_cache, DeviceTree or other parts from an IPSW or OTA.",
      "options": [
        {
          "names": [
            "--kernel",
            "-k"
          ],
          "description": "Kernelcache"
        },
        {
          "names": [
            "--dyld",
            "-d"
          ],
          "description": "dyld_shared_cache"
        },
        {
          "names": [
            "--dyld-arch",
            "-a"
          ],
          "description": "dyld architectures",
          "args": {
            "name": "dyld_arch",
            "isOptional": false,
            "isVariadic": true,
            "suggestions": [
              {
                "name": "arm64e",
                "description": "arm64e"
              }
            ]
          },
          "isRepeatable": true
        },
        {
          "names": [
            "--dtree"
          ],
          "description": "DeviceTree"
        },
        {
          "names": [
            "--sep"
          ],
          "description": "SEP firmware"
        },
        {
          "names": [
            "--pattern",
            "-p"
          ],
          "description": "Extract files from the IPSW zip whose names match this regex.",
          "args": {
            "name": "pattern",
            "description": "Extract files from the IPSW zip whose names match this regex.",
            "isOptional": false
          }
        },
        {
          "names": [
            "--output",
            "-o"
          ],
          "description": "Output folder",
          "args": {
            "name": "output",
            "isOptional": false,
            "template": "folders"
          }
        }
      ],
      "args": [
        {
          "name": "ipsw",
          "isOptional": false,
          "template": "filepaths"
        }
      ]
    }
  ]
}
