the cache is saved to "$HOME/.gcloud_cmd_cache.db", which database contains only 1 simple table with schema:.we detect whether the alpha or beta release track flags are required in each file, and use this to update the gcloud invocation, as appropriate.the signature of each gcloud command is inferred from the python filenames and directory structure in the lib/surface of the google-cloud-sdk.we determine the google-cloud-sdk root directory from the gcloud path (for brew users this will be: "$(brew -prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk.The local sqlite database is populated is a notably not-fancy way: when the keybinding is invoked, the commands in this cache are piped into fzf with a -preview option to display each command's -help docs.we create a local cache ( sqlite database) of gcloud commands for use with fzf.The fzf-gcloud completion mechanism works in the following way: Implementation Details Implementation Summary # =īindkey '^K' fzf-gcloud-widget # <- change if you prefer a different keybinding or ~/.antigen/bundles/mbhynes/fzf-gcloud-main/ (or wherever you've placed it in your system), as noted below: You can alter this by changing the bindkey line in the.The widget is by default bound to the keybinding CTRL-K ( '^K').Something like the below may work? … YMMV. Antigen supports providing an optional branch to antigen bundle and has good documentation, so it's the recommended package manager for installing fzf-gcloud. Please note that since there is no master branch for this repository (we use main), the some default load commands for popular zsh package managers will fail. Adding invocation for 'gcloud beta sql import bak' (build from /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/surface/sql/import/bak.py)Īdding invocation for 'gcloud beta sql import csv' (build from /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/surface/sql/import/csv.py)Īdding invocation for 'gcloud beta sql import sql' (build from /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/surface/sql/import/sql.py)Īdding invocation for 'gcloud beta sql backups delete' (build from /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/surface/sql/backups/delete.py)Īdding invocation for 'gcloud beta sql backups describe' (build from /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/lib/surface/sql/backups/describe.py) You will be greeted by a wall of logging messages like those below for about a minute, after which you may use fzf-gcloud without having to repopulate the cache. The first time you use CTRL-K, the gcloud command cache will be populated. Please note that the branch to checkout is main, which must be specified in the antigen invocation (see antigen bundle for more details): antigen bundle 'mbhynes/fzf-gcloud' -branch=main Add the following lines in your ~/.zshrc to source the functions to source them:.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |