Home

Awesome

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

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

VariableFormatDefaultDescription
CF_PS1_API_ENDPOINT_FOUNDATION_POSITIONintegerfalseWhen 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.