Skip to main content

Download service code

You can use the download command to download the deployed Cloud Run service code locally.

Basic Usage

tcb cloudrun download

Usage Example:

# Interactive Download. The CLI will guide you through selecting services.
tcb cloudrun download

# Download the code of the specified service to the current directory
tcb cloudrun download -e env-123456 -s my-service

# Download to the specified directory
tcb cloudrun download -e env-123456 -s api-service --targetPath ./local-code

# Force overwrite existing files
tcb cloudrun download -e env-123456 -s my-service --targetPath ./backup --force

Command Line Parameters

ParameterDescriptionRequired
-e, --env-idEnvironment IDNo
-s, --serviceNameService nameNo
--targetPathTarget path for code download (absolute or relative path, default: current directory)No
--forceForcibly overwrite existing files without prompting for confirmationNo
-h, --helpDisplay command help informationNo

Precautions

  • If files already exist in the target path and --force is not used, it will prompt for confirmation whether to overwrite.
  • Downloaded code includes all service configuration files.
  • It is recommended to first use tcb cloudrun list to view the service list