Pivotal/Cloud Foundry/CLI
Cloud Foundry | Cloud Foundry CLI
Contents |
Installing CF CLI
Mac OSX (High Sierra)
First start by installing homebrew package manager
~$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Tap the Cloud Foundry repo and install CF CLI
~$ brew tap cloudfoundry/tap ~$ brew install cf-cli
For good measure you should install git if you have not.
~$ brew install git
Quick Reference CF CLI
cf-login
Sign into PWS (Pivotal Web Services).
Man file
~$ cf login -u username -o org -s space -a api.run.pivotal.io
To logout it is as simple as
~$ cf logout
cf config
Set configuration variables such as language, timeouts, color, etc.
Man file | Localize
~$ $ cf config --locale YOUR_LANGUAGE Language Examples: English (US): en-US German: de-DE Spanish: es-ES
cf apps
Show all apps in your authenticated instance with their state and some details.
~$ cf apps
cf app
Show expanded details on an app
~$ cf app <app_name>
cf restart
restart an app
~$ cf restart <app_name>
cf restage
Recreate the app's executable artifact using the latest pushed app files and the latest environment (variables, service bindings, buildpack, stack, etc.)
~$ cf restage <app_name>
cf services
list all service instances
~$ cf services
cf logs
Show logs from an app either as a snapshot or live stream
Snapshot: ~$ cf logs <app_name> --recent Stream: ~$ cf logs <app_name>
cf-marketplace
View available elephantsql plans.
~$ cf marketplace -s elephantsql
cf create-service
create a new service, such as a elephantsql instance
~$ cf create-service elephantsql turtle <db_name>
cf bind-service
bind the service to the app
~$ cf bind-service <app_name> <service_name>
cf scale
scale the number of instances to improve app performance such as user load and concurrent requests.
~$ cf scale spring-music -i <number of instances>