Show current gcloud config in zsh prompt.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
capture.png
gcloud.zsh

README.md

zsh-gcloud-prompt

Show current gcloud config in zsh prompt.

This script is inspired by zsh-kubectl-prompt.

capture

Installation

1. Check out the repository.

$ git clone https://github.com/ocadaruma/zsh-gcloud-prompt.git /path/to/zsh-gcloud-prompt

2. Configure your zsh

Current gcloud config is stored in ZSH_GCLOUD_PROMPT. (in the form of "${active-account}:${active-project}")

For example, add following lines to ~/.zshrc

autoload -Uz colors; colors
source /path/to/zsh-gcloud-prompt/gcloud.zsh
RPROMPT='%{$fg[cyan]%}($ZSH_GCLOUD_PROMPT)%{$reset_color%}'