https://github.com/mdan16/cf-ps1
Cloud Foundry prompt for bash and zsh
https://github.com/mdan16/cf-ps1
bash cf-cli cloudfoundry zsh
Last synced: 8 months ago
JSON representation
Cloud Foundry prompt for bash and zsh
- Host: GitHub
- URL: https://github.com/mdan16/cf-ps1
- Owner: mdan16
- License: mit
- Created: 2021-08-25T11:28:30.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-01T06:42:19.000Z (about 3 years ago)
- Last Synced: 2025-01-29T09:14:53.583Z (10 months ago)
- Topics: bash, cf-cli, cloudfoundry, zsh
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zsh-plugins - cf-ps1 - Displays the current foundation and organization and space of [Cloud Foundry](https://www.cloudfoundry.org/) in your prompt. (Themes / ZSH on Windows)
- fucking-awesome-zsh-plugins - cf-ps1 - Displays the current foundation and organization and space of 🌎 [Cloud Foundry](www.cloudfoundry.org/) in your prompt. (Themes / ZSH on Windows)
README
# cf-ps1
The cf-ps1 set the current foundation and organization and space of [Cloud Foundry](https://www.cloudfoundry.org/) to your Bash/Zsh prompt.

The cf-ps1 inspired by [kube-ps1](https://github.com/jonmosco/kube-ps1).
## Requirements
- [jq](https://stedolan.github.io/jq/)
## Supported Shell
- Bash
- Zsh
## Installing
### Bash
Source the cf-ps1.sh in your `~/.bashrc`
```sh
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`
```sh
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. |