Using Experimental cf CLI Commands

Page last updated:

This topic describes how to use the experimental Cloud Foundry Command Line Interface (cf CLI) commands offered by the Cloud Controller V3 API.

These commands provide developers with the ability to better orchestrate app deployment workflows. New features include the deployment and management of apps with multiple processes, staging apps with multiple buildpacks, and uploading and staging multiple versions of a single app.

The experimental commands described in this topic require the cf CLI v6.32.0+ and a Cloud Foundry deployment with CC API 3.27.0+. The minimum version of the required CC API will change in subsequent releases.

For more information about cf CLI commands, see the Cloud Foundry CLI Reference Guide. For more information about the Cloud Controller V3 API, see the API documentation.

Note: Because these commands are experimental, they are not guaranteed to be available or compatible in subsequent cf CLI releases.

Overview

The new commands include a v3- prefix. While the syntax of some experimental commands is based on the existing cf CLI, these commands call the V3 API and support new flags to unlock additional features. Other commands expose the new primitives of apps, such as by performing operations on an app’s packages and droplets.

In the V2 APIs, running and staging an app are tightly coupled operations. As a result, an app cannot be staging and running at the same time. The V3 APIs offer developers more granular control over the uploading, staging, and running of an app.

Commands

Consult the following table for a description of the experimental commands.

Command Description
v3-app Retrieves and display an app’s GUID, suppressing all other health and status output
v3-apps Lists all apps in the target space
v3-create-app Creates a V3 app
v3-create-package Uploads a V3 package
v3-delete Deletes a V3 app
v3-droplets Lists droplets of an app
v3-env Shows all environment variables for an app
v3-get-health-check Shows the type of health check performed on an app
v3-packages Lists packages of an app
v3-push Pushes a new app or syncs changes to an existing app
v3-restart Stops all instances of an app and then starts them again, which may cause downtime
v3-restart-app-instance Terminates and then instantiates an app instance
v3-set-droplet Sets the droplet used to run an app
v3-set-env Sets an environment variable for an app
v3-set-health-check Changes type of health check performed on an app’s process
v3-stage Creates a new droplet for an app
v3-start Starts an app
v3-stop Stops an app
v3-unset-env Removes an environment variable from an app

Considerations

Keep in mind the following considerations when using the experimental commands:

  • v3-push supports only a subset of features of push. In particular, it does not support app manifests.
  • For some commands, such as set-env, ssh, and bind-service, no new V3 version exists. In those cases, use the old commands.
  • You can use V3 and old commands together, but some combinations may give unexpected results. For example, if you use V3 commands to create an app with a package but it is not staged, or you use v3-push to push an app but it fails to stage, the old apps command does not return the app.

Declaring Multiple App Processes with a Procfile

Developers can supply a Procfile with their app in order to run multiple long-lived processes using a single codebase.

To use a Procfile, include it in the root of your application directory and push your application.

For more information about Procfiles, see the About Procfiles section of the Production Server Configuration topic.

Create a pull request or raise an issue on the source for this page in GitHub