mdan16 / cf-ps1

Cloud Foundry prompt for bash and zsh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cf-ps1

The cf-ps1 set the current foundation and organization and space of Cloud Foundry to your Bash/Zsh prompt.

prompt.png

The cf-ps1 inspired by kube-ps1.

Requirements

Supported Shell

  • Bash
  • Zsh

Installing

Bash

Source the cf-ps1.sh in your ~/.bashrc

CF_PS1_API_ENDPOINT_FOUNDATION_POSITION=2 # when your cf api endtpoint is https://api.foundation.example.com 
source /path/to/cf-ps1.sh
PS1="[\u@\h \W $(cf_ps1)]\$ "

Zsh

Source the cf-ps1.sh in your ~/.zshrc

CF_PS1_API_ENDPOINT_FOUNDATION_POSITION=2 # when your cf api endtpoint is https://api.foundation.example.com 
source /path/to/cf-ps1.sh
PROMPT='$(cf_ps1)'$PROMPT

Environment

Variable Format Default Description
CF_PS1_API_ENDPOINT_FOUNDATION_POSITION integer false When a api endpoint is https://api.foundation.example.com, api will be displayed if set to 1, foundation will be displayed if set to 2. If not set, the entire api endpoint will be displayed as foundation.

About

Cloud Foundry prompt for bash and zsh

License:MIT License


Languages

Language:Shell 100.0%