{
  "name": "multipass",
  "description": "Create, control and connect to Ubuntu instances",
  "options": [
    {
      "names": [
        "-h",
        "--help"
      ],
      "description": "Displays help on commandline options",
      "isPersistent": true
    },
    {
      "names": [
        "--help-all"
      ],
      "description": "Displays help including Qt specific options",
      "isPersistent": true
    },
    {
      "names": [
        "-v",
        "--verbose"
      ],
      "description": "Increase logging verbosity. Repeat the 'v' in the short option for more detail. Maximum verbosity is obtained with 4 (or more) v's, i.e. -vvvv",
      "isPersistent": true
    }
  ],
  "subcommands": [
    {
      "name": "alias",
      "description": "Create an alias",
      "args": [
        {
          "name": "options",
          "isOptional": true
        },
        {
          "name": "definition",
          "description": "Alias definition in the form <instance>:<command>"
        },
        {
          "name": "name",
          "description": "Name given to the alias being defined, defaults to <command>",
          "isOptional": true
        }
      ]
    },
    {
      "name": "aliases",
      "description": "List available aliases",
      "options": [
        {
          "names": [
            "--format"
          ],
          "description": "Output list in the requested format. Valid formats are: table (default), json, csv and yaml",
          "args": [
            {
              "name": "format",
              "suggestions": [
                "table",
                "json",
                "csv",
                "yaml"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "delete",
      "description": "Delete instances",
      "options": [
        {
          "names": [
            "--all"
          ],
          "description": "Delete all instances"
        },
        {
          "names": [
            "-p",
            "--purge"
          ],
          "description": "Purge instances immediately"
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Name of instances to delete",
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "exec",
      "description": "Run a command on an instance",
      "args": [
        {
          "name": "name",
          "description": "Name of the instance to run the command on",
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        },
        {
          "name": "command",
          "description": "Command to execute on the instance"
        }
      ]
    },
    {
      "name": "find",
      "description": "Display available images to create instances from",
      "options": [
        {
          "names": [
            "--format"
          ],
          "description": "Output list in the requested format. Valid formats are: table (default), json, csv and yaml",
          "args": [
            {
              "name": "format",
              "suggestions": [
                "table",
                "json",
                "csv",
                "yaml"
              ]
            }
          ]
        },
        {
          "names": [
            "--show-unsupported"
          ],
          "description": "Show unsupported cloud images as well"
        }
      ],
      "args": [
        {
          "name": "string",
          "description": "An optional value to search for in [<remote:>]<string> format, where <remote> can be either 'release' or 'daily'. If <remote> is omitted, it will search 'release' first, and if no matches are found, it will then search 'daily'. <string> can be a partial image hash or an Ubuntu release version, codename or alias.",
          "isOptional": true
        }
      ]
    },
    {
      "name": "get",
      "description": "Get a configuration setting",
      "options": [
        {
          "names": [
            "--raw"
          ],
          "description": "Output in raw format. For now, this affects only the representation of empty values (i.e. \"\" instead of \"<empty>\")"
        }
      ],
      "args": [
        {
          "name": "key",
          "description": "Path to the setting whose configured value should be obtained",
          "suggestions": [
            "client.gui.autostart",
            "client.gui.hotkey",
            "client.primary-name",
            "local.bridged-network",
            "local.driver",
            "local.privileged-mounts"
          ]
        }
      ]
    },
    {
      "name": "help",
      "description": "Display help about a command",
      "args": [
        {
          "name": "command",
          "description": "Name of command to display help for",
          "isOptional": true
        }
      ]
    },
    {
      "name": "info",
      "description": "Display information about instances",
      "options": [
        {
          "names": [
            "--format"
          ],
          "description": "Output list in the requested format. Valid formats are: table (default), json, csv and yaml",
          "args": [
            {
              "name": "format",
              "suggestions": [
                "table",
                "json",
                "csv",
                "yaml"
              ]
            }
          ]
        },
        {
          "names": [
            "--all"
          ],
          "description": "Display info for all instances"
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Names of instances to display information about",
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "launch",
      "description": "Create and start an Ubuntu instance",
      "options": [
        {
          "names": [
            "--timeout"
          ],
          "description": "Maximum time, in seconds, to wait for the command to complete. Note that some background operations may continue beyond that. By default, instance startup and initialization is limited to 5 minutes each",
          "args": [
            {
              "name": "timeout"
            }
          ]
        },
        {
          "names": [
            "-c",
            "--cpus"
          ],
          "description": "Number of CPUs to allocate. Minimum: 1, default: 1",
          "args": [
            {
              "name": "cpus"
            }
          ]
        },
        {
          "names": [
            "-d",
            "--disk"
          ],
          "description": "Disk space to allocate. Positive integers, in bytes, or with K, M, G suffix Minimum: 512M, default: 5G.",
          "args": [
            {
              "name": "disk"
            }
          ]
        },
        {
          "names": [
            "-m",
            "--mem"
          ],
          "description": "Amount of memory to allocate. Positive integers, in bytes, or with K, M, G suffix Minimum: 128M, default: 1G.",
          "args": [
            {
              "name": "mem"
            }
          ]
        },
        {
          "names": [
            "-n",
            "--name"
          ],
          "description": "Name for the instance. If it is 'primary' (the configured primary instance name), the user's home directory is mounted inside the newly launched instance, in 'Home'",
          "args": [
            {
              "name": "name"
            }
          ]
        },
        {
          "names": [
            "--cloud-init"
          ],
          "description": "Path to a user-data cloud-init configuration, or '-' forstdin",
          "args": [
            {
              "name": "file"
            }
          ]
        },
        {
          "names": [
            "--network"
          ],
          "description": "Add a network interface to the instance, where <spec> is in the \"key=value,key=value\" format",
          "args": [
            {
              "name": "spec"
            }
          ]
        },
        {
          "names": [
            "--bridged"
          ],
          "description": "Adds one `--network bridged` network"
        }
      ],
      "args": [
        {
          "name": "image",
          "description": "Optional image to launch. If omitted, then the default Ubuntu LTS will be used",
          "isOptional": true,
          "generators": [
            {
              "script": [
                "multipass",
                "find",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "list",
      "description": "List all available instances",
      "options": [
        {
          "names": [
            "--format"
          ],
          "description": "Output list in the requested format. Valid formats are: table (default), json, csv and yaml",
          "args": [
            {
              "name": "format",
              "suggestions": [
                "table",
                "json",
                "csv",
                "yaml"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "mount",
      "description": "Mount a local directory in the instance",
      "options": [
        {
          "names": [
            "-g",
            "--gid-map"
          ],
          "description": "A mapping of group IDs for use in the mount. File and folder ownership will be mapped from <host> to <instance> inside the instance. Can be used multiple times",
          "args": [
            {
              "name": "host:instance"
            }
          ]
        },
        {
          "names": [
            "-u",
            "--uid-map"
          ],
          "description": "A mapping of user IDs for use in the mount. File and folder ownership will be mapped from <host> to <instance> inside the instance. Can be used multiple times",
          "args": [
            {
              "name": "host:instance"
            }
          ]
        }
      ],
      "args": [
        {
          "name": "source",
          "description": "Path to the local directory to mount",
          "template": "folders"
        },
        {
          "name": "target",
          "description": "Target mount points, in <name>[:<path>] format, where <name> is an instance name, and optional <path> is the mount point. If omitted, the mount point will be the same as the source's absolute path",
          "isVariadic": true
        }
      ]
    },
    {
      "name": "networks",
      "description": "List all available networks interfaces",
      "options": [
        {
          "names": [
            "--format"
          ],
          "description": "Output list in the requested format. Valid formats are: table (default), json, csv and yaml",
          "args": [
            {
              "name": "format",
              "suggestions": [
                "table",
                "json",
                "csv",
                "yaml"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "purge",
      "description": "Purge all deleted instances permanently"
    },
    {
      "name": "recover",
      "description": "Recover deleted instances",
      "options": [
        {
          "names": [
            "--all"
          ],
          "description": "Recover all deleted instances"
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Names of instances to recover",
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "restart",
      "description": "Restart instances",
      "options": [
        {
          "names": [
            "--timeout"
          ],
          "description": "Maximum time, in seconds, to wait for the command to complete. Note that some background operations may continue beyond that. By default, instance startup and initialization is limited to 5 minutes each",
          "args": [
            {
              "name": "timeout"
            }
          ]
        },
        {
          "names": [
            "--all"
          ],
          "description": "Restart all instances"
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Names of instances to restart. If omitted, and without the --all option, 'primary' will be assumed",
          "isOptional": true,
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "set",
      "description": "Set a configuration setting",
      "args": [
        {
          "name": "key=value",
          "description": "A key-value pair. The key specifies a path to the setting to configure. The value is its intended value",
          "suggestions": [
            "client.gui.autostart=",
            "client.gui.hotkey=",
            "client.primary-name=",
            "local.bridged-network=",
            "local.driver=",
            "local.privileged-mounts="
          ]
        }
      ]
    },
    {
      "name": "shell",
      "description": "Open a shell on a running instance",
      "options": [
        {
          "names": [
            "--timeout"
          ],
          "description": "Maximum time, in seconds, to wait for the command to complete. Note that some background operations may continue beyond that. By default, instance startup and initialization is limited to 5 minutes each",
          "args": [
            {
              "name": "timeout"
            }
          ]
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Name of the instance to open a shell on. If omitted, 'primary' (the configured primary instance name) will be assumed. If the instance is not running, an attempt is made to start it (see `start` for more info)",
          "isOptional": true,
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "start",
      "description": "Start instances",
      "options": [
        {
          "names": [
            "--timeout"
          ],
          "description": "Maximum time, in seconds, to wait for the command to complete. Note that some background operations may continue beyond that. By default, instance startup and initialization is limited to 5 minutes each",
          "args": [
            {
              "name": "timeout"
            }
          ]
        },
        {
          "names": [
            "--all"
          ],
          "description": "Start all instances"
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Names of instances to start. If omitted, and without the --all option, 'primary' (the configured primary instance name) will be assumed. If 'primary' does not exist but is included in a successful start command either implicitly or explicitly), it is launched automatically (see`launch` for more info).",
          "isOptional": true,
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "stop",
      "description": "Stop running instances",
      "options": [
        {
          "names": [
            "--all"
          ],
          "description": "Stop all instances"
        },
        {
          "names": [
            "-t",
            "--time"
          ],
          "description": "Time from now, in minutes, to delay shutdown of the instance",
          "args": [
            {
              "name": "time"
            }
          ]
        },
        {
          "names": [
            "-c",
            "--cancel"
          ],
          "description": "Cancel a pending delayed shutdown"
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Names of instances to stop. If omitted, and without the --all option, 'primary' will be assumed.",
          "isOptional": true,
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "suspend",
      "description": "Suspend running instances",
      "options": [
        {
          "names": [
            "--all"
          ],
          "description": "Suspend all instances"
        }
      ],
      "args": [
        {
          "name": "name",
          "description": "Names of instances to suspend. If omitted, and without the --all option, 'primary' will be assumed.",
          "isOptional": true,
          "isVariadic": true,
          "generators": [
            {
              "script": [
                "multipass",
                "list",
                "--format=json"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "transfer",
      "description": "Transfer files between the host and instances",
      "args": [
        {
          "name": "source",
          "description": "One or more paths to transfer, prefixed with <name:> for paths inside the instance, or '-' for stdin",
          "isVariadic": true,
          "template": "filepaths"
        },
        {
          "name": "destination",
          "description": "The destination path, prefixed with <name:> for paths inside the instance, or '-' for stdout",
          "template": "filepaths"
        }
      ]
    },
    {
      "name": "umount",
      "description": "Unmount a directory from an instance",
      "args": [
        {
          "name": "mount",
          "description": "Mount points, in <name>[:<path>] format, where <name> are instance names, and optional <path> are mount points. If omitted, all mounts will be removed from the named instances.",
          "isVariadic": true
        }
      ]
    },
    {
      "name": "unalias",
      "description": "Remove an alias",
      "args": [
        {
          "name": "name",
          "description": "The name of the alias to remove"
        }
      ]
    },
    {
      "name": "version",
      "description": "Show version details",
      "options": [
        {
          "names": [
            "--format"
          ],
          "description": "Output list in the requested format. Valid formats are: table (default), json, csv and yaml",
          "args": [
            {
              "name": "format",
              "suggestions": [
                "table",
                "json",
                "csv",
                "yaml"
              ]
            }
          ]
        }
      ]
    }
  ]
}
