Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ocadaruma/zsh-gcloud-prompt
Show current gcloud config in zsh prompt.
https://github.com/ocadaruma/zsh-gcloud-prompt
Last synced: 2 months ago
JSON representation
Show current gcloud config in zsh prompt.
- Host: GitHub
- URL: https://github.com/ocadaruma/zsh-gcloud-prompt
- Owner: ocadaruma
- License: mit
- Created: 2017-04-25T16:32:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-23T10:40:02.000Z (about 5 years ago)
- Last Synced: 2024-10-14T13:01:35.568Z (3 months ago)
- Language: Shell
- Size: 25.4 KB
- Stars: 22
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- trackawesomelist - gcloud-prompt (⭐22) - Shows the current gcloud configuration in the prompt. (Recently Updated / [Oct 14, 2024](/content/2024/10/14/README.md))
README
# zsh-gcloud-prompt
Show current gcloud config in zsh prompt.This script is inspired by [zsh-kubectl-prompt](https://github.com/superbrothers/zsh-kubectl-prompt).
![capture](https://github.com/ocadaruma/zsh-gcloud-prompt/blob/master/capture.png)
## 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%}'
```