I think that the solution is clear, make a language server for the command line. Each and every single command line interface is its own language so they all need their own language server that can provide meaningful completions.
Then bash and other shells can add support for language servers and we have the problem solved.