CLI Basics

In this section we will cover the basics of installing and using the CF command line interface (CLI).

Install the CLI

Select and install the appropriate installer for your laptop:

After the installer has finished, run the cf command

Checking Your Work

You should see output similar to the following:

   cf - A command line tool to interact with Cloud Foundry

   [environment variables] cf [global options] command [arguments...

Notice that the CF CLI is self documenting. You can type any command with --help to see details. Typing cf only lists all available commands.

cf <some-command> --help

Log In

You can use the CLI to log into any Cloud Foundry you have an account in.

Use cf help -a to find out how to login to Pivotal Web Services/The Swisscom Application Cloud/anynines public PaaS. The API endpoint you need for Pivotal Web Services is The anynines public PaaS endpoint is You can find the URL to use for The Swisscom Application Cloud by clicking on ‘Settings’ when looking at your space in the Swisscom UI.

Are you logged into Pivotal Web Services/The Swisscom Application Cloud/anynines public PaaS?

What org and space are you targeting?

Checking Your Work

You can see where you are logged in using cf target. You should see something similar to:

API endpoint:
API version:    2.78.0
Org:            my-org
Space:          my-space

Target Orgs & Spaces

You can change the org and space you are targeting without logging in again.

$ cf target -o ORG -s SPACE

Beyond the Class

© 2019 Copyright Cloud Foundry Foundation. All Rights Reserved.