cf CLI Command Structure
Use the Cloud Foundry command line interface (cf CLI) for managing subaccounts in the Cloud Foundry environment, such as creating orgs and spaces, or managing quota.
The cf CLI has a command structure, which makes it really convenient to use. A command has to start with the keyword cf, which will call the executable file.
Next, you could define a global option. Then you have to define a command, which could be a start, stop, create-space for example. Depending on the command, arguments and commands could follow.

cf CLI Login
Prerequisites
- You have created at least one subaccount and enabled the Cloud Foundry environment in this subaccount
- Download and install the cf CLI (see related information).
To login to the cf CLI, you need to set the target API endpoint (like api.cf.ap11.hana.ondemand.com). To log on to the Cloud Foundry environment, use the command cf login.
We recommend to use the option --sso. You need a browser within this logon procedure. Otherwise, log on with the user and password associated with your account in the default identity provider, SAP ID service. If you've forgotten this password and this user is associated with your SAP Universal ID user, reset your password.
To log on with a specific identity provider, use the option --origin.
Below you can see an example of log in using the --sso option.

This is the complete syntax to log in:
cf login [-a API_URL] [-u USERNAME] [-p PASSWORD] [-o ORG] [-s SPACE] [--sso | --sso-passcode PASSCODE] [--origin ORIGIN]
After logon, check the org and space that you are working with. Use cf target -o ORGANISATION -s SPACE to select the space you want to work with!
cf CLI Help and Features
To view the help for the CLI, execute cf --help, which lists the most common CLI commands.

The command cf help -a will list all commands with a short description.
To get help for a specific command, execute cf --help <command> like the btp CLI tool.
The following key features are available:
- Add Organization Members
- Create Spaces
- Add Space Members
- Create Space Quota Plans
- Assign Quota Plans to Spaces
- Change Space Quota Plans
- Delete Spaces
In addition, you can add plug-ins to extend the functionality like:
- Multitarget Application plug-in
- Service Fabric plug-in
- Custom Domain plug-in