CCD command-line interface (CLI)

The command-line interface (CLI) is the recommended method of interacting with Cloud Content Delivery (CCD). With this tool, you can use the command line to control every aspect of your project, from file management to organizing your release pipeline..

You can perform many similar functions in the Dashboard, but you need to use the CLI to copy files to your bucket, or synchronize entire folders.

Getting started

To set up CCD for CLI:

  1. If you already have a project, go to the next step. Otherwise, if you are using Unity services for the first time:

    1. Create a Unity ID account (if you don’t already have one).
    2. Log into the Unity Cloud Dashboard.
    3. Select Projects > Create project. In the Create project window, fill in the required details.
  2. Go to cloud.unity.com, and select Products > Cloud Content Delivery.

  3. Click Download CLI on the left.

  4. To download the CLI, locate the version of your operating system, then select the download icon.

  5. In the left-side navigation bar, go to the API Key section.

  6. Copy your API key.

  7. Run the CLI on the machine from which you are uploading content.

  8. Log into the CLI using your API key via the auth command.

CCD is now ready for you to use.

CLI usage

The basic form of a CCD command in the CLI is as follows:

$ ucd [command]

Be sure to enter -h or --help at the end of any command to display any further parameters and flags for that command that might be available.

To see the version of the CLI you are currently using, add the --version flag:

$ ucd --version

You can add the following global flags after any command:

  • --apikey string: User-specified API key for accessing Content Delivery.
  • -h, --help: Displays any further parameters and flags for a given command.
  • -q, --quiet: Disables the display of operations performed by the specified command.
  • -v, --verbose: Displays error information.

For CLI versions greater than 0.11.0, you need to add the --environment flag to most commands. See CLI examples and Using CCD via the CLI.

The available commands are:

auth

Authenticates with CCD.

Usage: ucd auth [command]

Available commands:

  • info: Display current user info.
  • login [apikey]: Log in to access project data and content delivery services.
  • logout: Log out of current account.

badges

Manages badges for a release.

Usage: ucd badges [command]

Available commands:

  • add [badge_name] [release_id]: Add a badge to a release.
  • list: List badges in the current bucket.
  • remove [badge_name]: Remove a badge.

buckets

Manages buckets for a project.

Usage: ucd buckets [command]

Available commands:

  • create [project_guid] [bucket name]: Create bucket for a project.
  • delete [bucket_id]: Delete bucket.
  • info [bucket_id]: Get bucket information.
  • list [project_guid]: List buckets for a project.

config

Manages options for setting and identifying the current bucket.

Usage: ucd config [command]

Available commands:

  • clear: Clear all local configuration options.
  • set environment [environment_id] --project=[project_id]: Set environment as current.
  • set bucket [bucket_id] [flags]: Set the specified bucket as the current (active) bucket.
  • show: Show current local configuration.

entries

Manages entries for the current bucket.

Usage: ucd entries [command]

Available commands:

  • copy [local_path] [entry file name]: Create entry for current bucket from a local file.
  • delete [entry file name]: Delete entry from the current bucket.
  • download [entry file name]: Download entry content from current bucket.
  • info [entry file name]: Get entry info from current bucket.
  • list: List entries for current bucket.
  • sync [local_dir_path]: Sync entries from local directory for current bucket.
  • update [entry file name]: Update entry for current bucket.

To cancel an entries sync command, press Ctrl+C during the process. Any entries synced prior to cancellation remain uploaded, so you must delete them from your bucket.

releases

Manages the releases for the current bucket.

Usage: ucd releases [command]

Available commands:

  • create: Create release from latest version of current bucket.
  • info [release_id]: Get release info for specific release.
  • list: List releases for current bucket.
  • promote [release_id] --target_bucket [bucket_id]: Promote specified release to another bucket. An optional -n, --notes flag adds a note string.
  • update [release_id]: Update an existing release. An optional -n, --notes flag adds a note string.

Bucket and entry names are case-sensitive.

bucket_name is only a label you assign to a bucket upon creation. All other commands require the bucket_ID, which you can find using the buckets list command, or through CCD in the Unity Cloud Dashboard.

CLI examples

  • To create a bucket:
    $ ucd buckets create [project_id] [bucket_name]
  • To delete a bucket:
    $ ucd buckets delete [bucket_id]
  • To list all buckets for a project, including their bucket_id:
    $ ucd buckets list [project_id]
  • To set the current bucket as the active bucket:
    $ ucd config set bucket [bucket_id]
  • To synchronize a local folder with the current bucket:
    $ ucd entries sync [local_dir_path]
  • To view a list of all entries in the current bucket:
    $ ucd entries list

For CLI versions greater than 0.11.0, you need to add the --environment flag to most commands.

Example:

ucd buckets list --environment=[environment_id] [PROJECT_ID]

You can also save an environment to be used in all future commands by using the config environment command:

ucd config set environment [environment_id] --project=[project_id]

If you set the environment in config, you don’t need to add the --environment flag.

For a sequential example of how to use the command-line interface, see Using CCD via the CLI.