Autocompletion - where to get ~/completions/lxd.lxc file from?

Continuing the discussion from [LXD 4.7] Autocompletion on ubuntu 20.04:

I would love to have some bash completion for lxd/Incus. By that I mean that when typing something like

  • lxc list deb <tab> will autocomplete to i.e. debian, debian12
  • lxc exe <tab> will autocomplete to exec

where would you get that file (lxd.lxc) from exactly?
I am on manjaro linux, running lxd 5.7, installed via pacman.

Is it a shortcoming of the distributions package if that is nowhere on the system?

Yes, the file is available in the upstream repository.

Same deal for incus, we have a bash completion script, our Debian packages include that file as you can see when using tab-completion at Linux Containers - Incus - Try it online

The file is here in the upstream repo:

thx. Maybe things got mixed up when I switched from snap lxd to pacman lxd.

I’m using incus 0.6 installed via the Zabbly deb repository on Ubuntu 22.04 minimal, and was also not getting autocompletion features. After installing bash-completion, which is not part of Ubuntu minimal, and restarting the terminal session, I’m getting all the nice auto completion.

I’ll add bash-completions as a Suggests on the incus-client package.

I don’t want it to get pulled automatically but having it mentioned would be good.

1 Like