Upgrading to cf CLI v7
Page last updated:
The main goal of Cloud Foundry Command Line Interface (cf CLI) v7 and CAPI V3 is to unlock new app developer workflows for users who require granular control of their apps and other advanced deployment strategies. For more information, see New Workflows Supported below. These workflows were previously limited by CAPI V2.
The cf CLI development team aims to provide:
A seamless upgrade experience from cf CLI v6. Changes have been kept to a minimum. Where there are changes, the team has incorporated feedback from the community to simplify the cf CLI user experience.
Details about potential breaking changes and alternative workflows for scripting environments.
To understand the differences between specific commands, see Command Differences below.
For more information about CAPI V3, see the CAPI V3 documentation. For more information about CAPI V2, see the CAPI V2 documentation.
New workflows supported by cf CLI v7
cf CLI v7 uses CAPI V3, which offers developers more granular control over their apps. It activates new workflows by exposing packages, droplets, builds, and processes. CAPI V3 also includes new resources, for example, sidecars, manifests, and deployments.
Some key new features available with the cf CLI v7 are:
Rolling App Deployments: Push updates to apps without incurring downtime.
Running cf push Sub-Step Commands: Exercise granular control over the cf push process. These commands break down the cf push process into sub steps that can run independently.
Pushing an App with Multiple Processes: Use a single command to push apps that run multiple processes. An example is a web app that has a UI process and a worker process.
Pushing Apps with Sidecar Processes: Run additional processes in the same container as your app.
Using Metadata: Add metadata to objects, for example, spaces, and apps. This aids in operations, monitoring, and auditing.
Installing cf CLI v7
To install cf CLI v7, see the README in the Cloud Foundry CLI repository on GitHub. It includes instructions for downloading the latest CAPI release candidate, which is what the cf CLI v7 beta is tested against.
Prerequisites
The cf CLI v7 requires cf-deployment v13.5.0 or later.
This version of cf-deployment contains CAPI release v1.95.0, which provides the CAPI V3 API v3.85.0.
For more information, see the CAPI release notes and the Cloud Controller release notes on GitHub.
If you target an later version of cf-deployment, cf CLI v7 presents a warning saying that the API version is less than the minimum supported.
Not all commands run correctly.
For example, cf apps
does not work.
Command differences
These sections describe changes in commands from cf CLI v6 to cf CLI v7. They also provide important information for those who use the cf CLI in scripts.
For information about potential breaking changes, see the Table of Differences below. This table includes removed flag options, removed commands, and removed or changed argument requirements.
About scripting
If you have scripts that rely on the cf CLI, this section describes possible changes in cf CLI v7 which might affect scripts.
Some of these changes are:
In cf CLI v7, if your scripts parse error text, output text errors are returned directly from CAPI. Where possible, cf CLI v7 no longer wraps errors it receives from the API.
cf CLI v7 commands output errors and warnings to
stderr
rather thanstdout
to simplify debugging.Style changes including flavor text updates. For more information, see Colors in cf CLI Style Guide in the Cloud Foundry CLI repository on GitHub.
Key-value and table column headers are displayed in lowercase.
Single-quote resource names appear in error cases.
If the services attribute is declared at the top-level of the manifest.yml file, cf CLI v6 generates a warning, but in cf CLI v7, there is no warning and the app is still pushed.
Exit codes
cf CLI v7 attempts to consistently apply the principles of idempotency across all commands which require it. For more information, see General Principles in cf CLI Style Guide in the Cloud Foundry CLI repository on GitHub. Commands now exit 0
if the outcome a user expresses when running a specific command is unchanged after the command is executed. Examples include:
Attempting to delete a resource which does not exist, for example, a space. Commands like
delete-route
anddelete-space
return0
in those cases.If the
create-buildpack
command fails to create a buildpack, the command exits with1
instead of0
, which is the current cf CLI v6 behavior.
Table of differences
The following table summarizes how commands differ between cf CLI v7 and cf CLI v6.
Command | Changes |
---|---|
cf add-network-policy |
|
cf apps |
|
cf bind-security-group |
|
cf check-route |
|
cf create-buildpack |
|
cf create-domain |
|
cf create-org |
|
cf create-quota |
|
cf create-space |
|
cf create-route |
|
cf create-service-auth-token |
This command is removed. |
cf create-service-broker |
|
cf create-user |
|
cf delete |
|
cf delete-domain |
|
cf delete-org |
|
cf delete-quota |
|
cf delete-service-auth-token |
This command is removed. |
cf domains |
|
cf files |
This command is removed. |
cf map-route |
|
cf marketplace |
|
cf migrate-service-instances |
This command is removed. |
cf packages |
|
cf push |
|
cf purge-service-offering |
|
cf quota |
|
cf quotas |
|
cf remove-network-policy |
|
cf rename-buildpack |
This command is removed. Instead, use --rename flag with cf update-buildpack . |
cf restart-app-instance |
|
cf routes |
|
cf run-task |
|
cf scale |
|
cf service-access |
|
cf service-auth-tokens |
This command is removed. |
cf set-health-check |
|
cf set-quota |
|
cf set-running-environment-variable-group |
|
cf set-staging-environment-variable-group |
|
cf ssh |
|
cf start |
|
cf unshare-private-domain |
|
cf update-buildpack |
|
cf update-quota |
|
cf update-service-auth-token |
This command is removed. |
cf v3-COMMAND |
|
cf apply-manifest |
|
cf v3-cancel-zdt-push |
|
cf v3-zdt-push |
|
cf buildpacks |
|