We can use the argcomplete package to autocomplete command line options: https://argcomplete.readthedocs.io/en/latest/ This might especially work well for finding variable names if it's also possible to autocomplete the options for arguments.