Johnny Matthews | Multipass ZSH completion

A tiny little completion script for Multipass that’ll save you from typing out those pesky VM names every time. This was written on 22nd of May 2025.

If you’re tired of typing multipass list just to remember what you called that Ubuntu instance, this script’s for you. It adds proper tab completion to your shell so you can just type multipass shell <TAB> and see all your VMs pop up like magic.

What it does

Prerequisities

Installation

Dead simple:

  1. Create a completions dir if you don’t have one already:

    mkdir -p ~/.config/zsh/completions
    
  2. Download the completion file into that dir:

    wget -O ~/.config/zsh/completions/_multipass https://raw.githubusercontent.com/johnnymatthews/multipass-zsh-autocomplete/refs/heads/yolo/_multipass
    

    If you’ve not got Wget installed (and don’t wanna install it), use Curl like a pleb:

    curl -o ~/.config/zsh/completions/_multipass https://raw.githubusercontent.com/johnnymatthews/multipass-zsh-autocomplete/refs/heads/yolo/_multipass
    
  3. Add these lines to your ~/.zshrc:

    fpath=(~/.config/zsh/completions $fpath)
    autoload -Uz compinit && compinit
    

    I don’t think it matters where you put these lines, but it might. So, like, ask your local LLM or whatever.

  4. Reload ZSH:

    source ~/.zshrc
    
  5. Done.

Usage

Now you can do lovely things like:

Troubleshooting

Not working? Make sure:

Still not working? Try running compinit manually to reinitialise completions.

Still, still not working? Drop an issue in this repo.