Upgrading to cf CLI v8
Page last updated:
You can use Cloud Foundry Command Line Interface (cf CLI) v8 to interact with Cloud Foundry API (CAPI) V3. This topic describes the major changes between cf CLI v7
and cf CLI v8, and subsequent improvements added through later v8 releases.
The cf CLI development team aims to provide:
A seamless upgrade experience from cf CLI v7. Changes are minimal. 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 the full list of cf CLI v8 releases, see Releases in the Cloud Foundry CLI repository on GitHub.
New workflows supported by cf CLI v8
Some key new features available through the cf CLI v8 are:
- Asynchronous service operations: All service-related operations are now asynchronous by default. This includes manipulating service keys and route bindings.
Install cf CLI v8
To install cf CLI v8, see Installing the cf CLI.
Prerequisites
The cf CLI v8 requires cf-deployment v16.11.0 or later.
For more information, see the cf CLI Versioning and Support Policy on GitHub.
Command differences
These sections describe changes in commands from cf CLI v7 to cf CLI v8. They also provide important information for those who use the cf CLI in scripts.
For information about possible breaking changes, see the Table of differences below. This table includes removed flag options, updated output, and removed or changed argument requirements.
Manifest differences
When you apply a manifest by running cf push, cf CLI v8 does not provide a manifest diff through the V3 manifest diff endpoint.
This new endpoint supports version 1 manifests only.
For more information, see Create a manifest diff for a space (experimental) in the CAPI documentation.
About scripting
If you have scripts that rely on the cf CLI, this section describes possible changes in cf CLI v8 that might affect scripts.
Some of these changes are:
- Style changes, including changes in the order or wording of the output.
- cf CLI v8 uses CAPI V3 to make requests related to services. CAPI V3 creates asynchronous jobs. If you want to continue to create jobs synchronously, use the new
--wait flag.
- JSON response changes such as additional elements or nesting, which may impact parsing in existing scripts.
Table of differences
The following table summarizes how commands differ between cf CLI v7 and cf CLI v8, including improvements added in later v8 releases.
| Command |
Changes |
cf auth |
- [Update] (v8.12.0): Now supports token-based authentication in addition to username/password. Use
--client-credentials with a client ID and secret, or pass a user or client token directly.
|
cf app |
- [New]: Added
per-route options to output.
- [Update] (v8.16.0): Each process instance now shows a
ready indicator.
|
cf apps |
- [New]: Added
per-route options to output.
|
cf bind-service |
- [Added flag]: Use
--wait to wait for the bind operation to complete.
- [Added flag] (v8.18.0): Use
--strategy to specify the binding strategy.
|
cf bind-route-service |
- [Update]: Bind route operation is async by default.
- [Added flag]: Use
--wait to wait for the bind operation to complete.
|
cf buildpacks |
- [Added flag] (v8.14.0): Use
--lifecycle to filter buildpacks by lifecycle type (for example, buildpack or cnb).
|
cf cleanup-outdated-service-bindings |
- [New command] (v8.18.0): Removes service bindings that no longer have a corresponding service instance. Useful for cleaning up orphaned bindings after service instances are deleted out of band.
|
cf create-buildpack |
- [Added flag] (v8.14.0): Use
--lifecycle to specify the lifecycle type for the buildpack (for example, buildpack or cnb).
|
cf create-route |
- [Added flag]: Use
--option to specify per-route options in key-value format, e.g. option_name=option_value.
|
cf create-service |
- [Added flag]: Use
--wait to wait for the create operation to complete.
|
cf create-service-key |
- [Update]: Create operation is async by default.
- [Added flag]: Use
--wait to wait for the create operation to complete.
|
cf delete-buildpack |
- [Added flag] (v8.14.0): Use
--lifecycle to specify the lifecycle type when deleting a buildpack (for example, buildpack or cnb).
|
cf delete-service |
- [Added flag]: Use
--wait to wait for the delete operation to complete.
|
cf delete-service-key |
- [Update]: Delete operation is async by default.
- [Added flag]: Use
--wait to wait for the delete operation to complete.
|
cf map-route |
- [Added flag]: Use
--app-protocol to use HTTP/2 protocol to communicate with apps. By default, if app-protocol is not set, HTTP/1 protocol is used for HTTP route.
- [Added flag]: Use
--option to specify per-route options for non-existent routes in key-value format, e.g. option_name=option_value.
- [Added flag] (v8.18.0): Use
--destination-port to set the port on the destination app to which traffic is routed.
|
cf marketplace |
- [Added flag]: Use
--show-unavailable to show plans that are not available for use.
|
cf push (with --strategy) |
- [Update] (v8.16.0): When using a rolling or canary deployment strategy, scaling flags (
-i, -m, -k) now apply only to new instances being created by the deployment. Running instances are not restarted before the deployment begins. For more information, see Scaling with Deployments.
|
cf route |
- [New]: New command for viewing details about a route and its destinations.
- [New]: Added
per-route options to output.
|
cf routes |
- [Update]: Added
service instance column to output.
- [Update]: Added
options column to output.
|
cf service |
- [Added flag]: Use
--params to retrieve and display the given service instances’s parameters as JSON. All other output is suppressed.
- [Update]: Displays information about
guid, type, and broker tags.
- [Update]: The
service field is renamed to offering.
- [Update]: The
service broker field is renamed to broker.
- [Update]: The
dashboard field is renamed to dashboard url.
- [Update]: Minor changes to the ordering and wording of each block of information.
- [Update] (v8.18.0): Enhanced to display information about multiple service bindings when an app has more than one binding to the same service instance.
|
cf service-key |
- [Update]: Displays information about
last operation and message as new columns.
- [Response]: All JSON response elements from v7 are now wrapped into an additional element named
credentials.
- [Added flag] (v8.18.0): Use
--json to return the service key output as JSON.
|
cf services |
- [Added flag]: Use
--no-apps to not retrieve bound apps information.
- [Added flag]: Use
--wait to wait for the operation to complete.
- [Update] (v8.18.0): Duplicate app names are no longer shown in the bound apps column when an app has multiple bindings to the same service instance.
|
cf stacks |
- [Update] (v8.18.0): Output now includes a
state column showing the lifecycle state of each stack (ACTIVE, DEPRECATED, RESTRICTED, or DISABLED).
|
cf unbind-service |
- [Added flag]: Use
--wait to wait for the unbind operation to complete.
- [Update] (v8.18.0): Can now handle apps with multiple bindings to the same service instance.
|
cf unbind-route-service |
- [Update]: Unbind route operation is async by default.
- [Added flag]: Use
--wait to wait for the unbind operation to complete.
|
cf update-buildpack |
- [Added flag] (v8.14.0): Use
--lifecycle to specify the lifecycle type when updating a buildpack (for example, buildpack or cnb).
|
cf update-route |
- [New]: New command for managing route-specific options.
- [New flag]: Use
--option to specify per-route options in key-value format, e.g. option_name=option_value.
- [New flag]: Use
--remove-option to specify a per-route option to delete, e.g. option_name.
|
cf update-service |
- [Added flag]: Use
--wait to wait for the update operation to complete.
- [Removed flag]:
--upgrade. Use the cf upgrade-service command to upgrade a plan.
|
cf update-stack |
- [New command] (v8.18.0): Manages the lifecycle state of a stack. Use
--state to set the state (active, deprecated, restricted, or disabled) and --reason to provide a human-readable explanation shown to developers during cf push or cf restage. For more information, see Managing Stack Lifecycle.
|
cf upgrade-service |
- [Added flag]:
--force. There is no longer user interaction required on this command.
|
Create a pull request or raise an issue on the source for this page in GitHub