> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GCP Cloud Function CLI

> Invoke Google Cloud Functions and list available functions from Paradime Bolt using the paradime run gcp-cloud-function CLI commands with real-time monitoring.

The Paradime SDK provides CLI commands to interact with Google Cloud Functions, allowing you to invoke functions by name and list the functions available in a project and region.

<Warning>
  🔑 **Authentication Required**

  You will need a GCP service account JSON key file with permissions to invoke and list Cloud Functions in your project. Provide it via the `--service-account-key-file` flag or the `GCP_SERVICE_ACCOUNT_KEY_FILE` environment variable.
</Warning>

## Invoke Cloud Functions

Invoke one or more Google Cloud Functions by name, optionally sending a JSON payload and waiting for completion.

### CLI Command

```bash theme={"system"}
paradime run gcp-cloud-function-trigger
```

#### Options

| Flag                         | Type              | Description                                                                                                                                                       |
| ---------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--service-account-key-file` | Required, TEXT    | Path to your GCP service account JSON key file. Can be set via `GCP_SERVICE_ACCOUNT_KEY_FILE` environment variable.                                               |
| `--project`                  | Required, TEXT    | Your GCP project ID. Can be set via `GCP_PROJECT_ID` environment variable.                                                                                        |
| `--location`                 | Required, TEXT    | GCP region (e.g. 'us-central1'). Can be set via `GCP_LOCATION` environment variable.                                                                              |
| `--function-names`           | Required, TEXT    | Comma-separated Cloud Function name(s) to invoke.                                                                                                                 |
| `--payload`                  | Optional, TEXT    | JSON payload to send to the function (optional).                                                                                                                  |
| `--wait` / `--no-wait`       | Optional, Flag    | Wait for the function invocation to complete before returning. Default: `--wait`. Can be set via `GCP_CLOUD_FUNCTION_TRIGGER_WAIT` environment variable.          |
| `--timeout`                  | Optional, INTEGER | Maximum time to wait for completion (in minutes). Only used with `--wait`. Default: 30. Can be set via `GCP_CLOUD_FUNCTION_TRIGGER_TIMEOUT` environment variable. |
| `--help`                     | Optional, Flag    | Show the help message and exit.                                                                                                                                   |

<Info>
  **Recommended Setup**

  For security and convenience, set your GCP credentials as environment variables:

  ```bash theme={"system"}
  GCP_SERVICE_ACCOUNT_KEY_FILE="/path/to/service-account-key.json"
  GCP_PROJECT_ID="your_project_id"
  GCP_LOCATION="us-central1"
  ```
</Info>

### Usage Examples

```bash theme={"system"}
# Invoke a single function (using environment variables)
paradime run gcp-cloud-function-trigger \
  --function-names "my-function"

# Invoke multiple functions with a JSON payload
paradime run gcp-cloud-function-trigger \
  --function-names "process-data,notify-users" \
  --payload '{"key": "value"}'

# With explicit credentials and no wait
paradime run gcp-cloud-function-trigger \
  --service-account-key-file "/path/to/key.json" \
  --project "your_project_id" \
  --location "us-central1" \
  --function-names "my-function" \
  --no-wait
```

## List Cloud Functions

List all Cloud Functions in the specified project and region.

### CLI Command

```bash theme={"system"}
paradime run gcp-cloud-function-list
```

#### Options

| Flag                         | Type           | Description                                                                                                         |
| ---------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------- |
| `--service-account-key-file` | Required, TEXT | Path to your GCP service account JSON key file. Can be set via `GCP_SERVICE_ACCOUNT_KEY_FILE` environment variable. |
| `--project`                  | Required, TEXT | Your GCP project ID. Can be set via `GCP_PROJECT_ID` environment variable.                                          |
| `--location`                 | Required, TEXT | GCP region (e.g. 'us-central1'). Can be set via `GCP_LOCATION` environment variable.                                |
| `--help`                     | Optional, Flag | Show the help message and exit.                                                                                     |

### Usage Examples

```bash theme={"system"}
# List all functions (using environment variables)
paradime run gcp-cloud-function-list

# With explicit credentials
paradime run gcp-cloud-function-list \
  --service-account-key-file "/path/to/key.json" \
  --project "your_project_id" \
  --location "us-central1"
```

## Environment Variable Reference

| Environment Variable                 | Description                                                   |
| ------------------------------------ | ------------------------------------------------------------- |
| `GCP_SERVICE_ACCOUNT_KEY_FILE`       | Path to your GCP service account JSON key file                |
| `GCP_PROJECT_ID`                     | Your GCP project ID                                           |
| `GCP_LOCATION`                       | GCP region (e.g. 'us-central1')                               |
| `GCP_CLOUD_FUNCTION_TRIGGER_WAIT`    | Wait for the function invocation to complete before returning |
| `GCP_CLOUD_FUNCTION_TRIGGER_TIMEOUT` | Maximum time to wait for completion (in minutes)              |


## Related topics

- [GCP Cloud Run CLI](/developers/paradime-cli/gcp-cloud-run-cli.md)
- [GCP Datastream CLI](/developers/paradime-cli/gcp-datastream-cli.md)
- [GCP Dataflow CLI](/developers/paradime-cli/gcp-dataflow-cli.md)
- [GCP Dataproc CLI](/developers/paradime-cli/gcp-dataproc-cli.md)
- [Airflow CLI](/developers/paradime-cli/airflow-cli.md)
