With the release of 2.28 the last bit of work to make bash tab completion for apps inside strictly-confined snaps work automatically has landed.
Tab completion of aliases is enabled transparently from snapd 2.30 (the completer should only see the dealiased command).
For this to work, your app needs to specify a
completer key in its yaml, which points to a bash completion snippet (that you would, in traditional packaging, drop in
/usr/share/bash-completion/completions). With that,
snapd will drop a snippet in that directory which will run the completer confined.
Before 2.28 most of this was already done, but a user would have to manually source a file for it all to work. Some more info and background in a blog post about the pre-2.28 feature.
Two snaps in the store right now that implement this, if you need to take a look, are the
http snap, and
test-snapd-complexion (only in edge). Snapcraft has had support for the
completer attribute of snap apps since version 2.33.
To extend this to tab completion in other shells, for example zsh, all that needs doing is to write a marshaller of the completion request; look at
complete.sh in the snapd source for pointers.