databricks-cli icon indicating copy to clipboard operation
databricks-cli copied to clipboard

please support auto-completion

Open snowch opened this issue 1 year ago • 2 comments

I search for documentation to setup auto-completion on the CLI and could not find any, so I'm assuming it hasn't been implemented?

Auto completion makes CLIs so much easier to work with. It would be very useful to have this supported on the databricks CLI.

snowch avatar Jul 19 '22 10:07 snowch

I also think this would be an essential feature for everyday work.

Did investigate and found that Click provides tab completion support... see docs at https://click.palletsprojects.com/en/8.1.x/shell-completion/

When I turned it on using bash, faced issues/bugs.

eval "$(_DATABRICKS_COMPLETE=source_bash databricks)"

databricks <TAB><TAB>
cluster-policies-group  dbfs-group              jobs-group              runs-group              tokens-group
clusters-group          groups-group            libraries-group         secrets-group           workspace-group
configure-cli           instance-pools-group    pipelines-group         stack-group

so the command groups have -group OR -cli unnecessary postfixes. We would need to remove postfix from name OR define the optional name parameter for groups.

Also when I selected clusters-group sub command completion did not work. But when I used a valid sub-command it worked. databricks clusters <TAB><TAB> even though gave me a -cli postfixed list again...

I could not get command options listed.

To sum it up:

  • I would turn this report into a bug-report
  • fix above described bugs
  • add how to get completion enabled into docs
  • enable completion in installation process automatically

zoltan-kecskemethy-epam avatar Aug 04 '22 19:08 zoltan-kecskemethy-epam

+1 for completion here. I may even look into it myself - not sure.

rshutt-va avatar May 11 '23 15:05 rshutt-va