Tab completion for non-file-system paths or URIs (e.g. gs://...)

140 Views Asked by At

I use cloud storage (eg gcs, s3) in addition to the local file system for data analysis.

My question is: are there tools that enable tab completion (in a shell environment) for file paths or URIs that aren't on local, mounted file systems? Eg for a file URI like gs://path/to/file.txt, I'd like to have tab completion when typing part of the path.

Note: I don't want to use FUSE (or mount a file system or volume in some way). I'm wondering if there are bash or zsh extensions that enable this functionality for non-file-system URIs, presumably with API calls in the background or something.

1

There are 1 best solutions below

1
Catherine O On BEST ANSWER

gcloud interactive shell has auto-complete and auto prompting for any command that has a manual page, including the gcloud, bq, gsutil, and kubectl command-line tools.

To enable the gcloud interactive shell:

  1. Install the gcloud beta components first by running the command gcloud components install beta.
  2. Run gcloud beta interactive to enter gcloud interactive mode.

You can now use the tab to complete a file path or resource assignment

Check this link for the official documentation of gcloud auto-complete.