darklore / zsh-gcloud-prompt

Show current gcloud config in zsh prompt.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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%}'

About

Show current gcloud config in zsh prompt.

License:MIT License


Languages

Language:Shell 100.0%