An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

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.

![prompt.png](./images/prompt.png)

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