Skip to content
Back to search

cxas-scrapi

A powerful Python API, CLI, and set of Agent Skills for CX Agent Studio to automate, evaluate, and scale your agents with ease.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/GoogleCloudPlatform/cxas-scrapi with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/GoogleCloudPlatform/cxas-scrapi'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/googlecloudplatform--cxas-scrapi/badge.svg)](/listings/googlecloudplatform--cxas-scrapi)

HTML

<a href="/listings/googlecloudplatform--cxas-scrapi"><img src="/api/listings/googlecloudplatform--cxas-scrapi/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Environment Setup

Set up Google Cloud Platform credentials and install dependencies.

gcloud auth login
gcloud auth application-default login
gcloud config set project <project name>
uv sync
source .venv/bin/activate

Usage

To run a simple bit of code you can do the following: - Import a Class from `cxas_scrapi` - Define your GCP Project and Location

from cxas_scrapi import Apps

# Instantiate your class object and pass in your credentials
app_client = Apps(project_id='<YOUR_GCP_PROJECT_ID>', location='global')

# Retrieve all Apps existing in your project
apps = app_client.list_apps()
for app in apps:
    print(app.display_name, app.name)

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 207 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # CX Agent Studio Scripting API (CXAS SCRAPI)
  2. [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE.txt)
  3. [![PyPI](https://img.shields.io/pypi/v/cxas-scrapi)](https://pypi.org/project/cxas-scrapi/)
  4. [![Python Unit Tests](https://github.com/GoogleCloudPlatform/cxas-scrapi/actions/workflows/ci.yml/badge.svg)](https://github.com/GoogleCloudPlatform/cxas-scrapi/actions/workflows/ci.yml)
  5. <html>
  6. <h2 align="center">
  7. <!-- Replace with actual image path once uploaded -->
  8. <img src="assets/cxas-scrapi-logo.png" width="256" alt="CXAS SCRAPI Logo"/>
  9. </h2>
  10. <h3 align="center">
  11. A powerful Python API, CLI, and set of Agent Skills for CX Agent Studio to automate, evaluate, and scale your agents with ease.
  12. </h3>
  13. <h3 align="center">
  14. Important Links:
  15. <a href="https://googlecloudplatform.github.io/cxas-scrapi/stable/">Docs</a>,
  16. <a href="examples/">Examples</a>,
  17. <a href="https://googlecloudplatform.github.io/cxas-scrapi/stable/guides/skills/">Agent Skills</a>,
  18. <a href="https://googlecloudplatform.github.io/cxas-scrapi/stable/api/">Core SDK</a>
  19. </h3>
  20. </html>
  21. CX Agent Studio Scripting API (CXAS SCRAPI) is an open-source Python scripting
  22. API, CLI, and set of Agent Skills for CX Agent Studio. It is designed to
  23. simplify building, deploying, and orchestrating agent workflows, from simple
  24. tasks to complex systems. It integrates seamlessly with Agentic IDEs like
  25. Gemini CLI, Claude Code, and Antigravity, exposing advanced tooling for deep
  26. evaluations, real-time latency metrics, offline linting, and conversation
  27. history.
  28. ---
  29. ## Built With
  30. * Python 3.10+
  31. <!-- AUTHENTICATION -->
  32. # Authentication
  33. Authentication can vary depending on how and where you are interacting with SCRAPI.
  34. ## Google Colab
  35. If you're using CXAS SCRAPI with a [Google Colab](https://colab.research.google.com/) notebook, you can add the following to the top of your notebook for easy authentication:
  36. ```py
  37. pip install cxas-scrapi
  38. ```
  39. ```py
  40. project_id = '<YOUR_GCP_PROJECT_ID>'
  41. # this will launch an interactive prompt that allows you to auth with GCP in a browser
  42. !gcloud auth application-default login --no-launch-browser
  43. # this will set your active project to the `project_id` above
  44. !gcloud auth application-default set-quota-project $project_id
  45. ```
  46. After running the above, Colab will pick up your credentials from the environment and pass them to CXAS SCRAPI directly. No need to use Service Account keys!
  47. You can then use CXAS SCRAPI simply like this:
  48. ```py
  49. from cxas_scrapi import Apps
  50. project_id = '<YOUR_GCP_PROJECT_ID>'
  51. location = 'us'
  52. app_client = Apps(project_id=project_id, location=location) # <-- Creds will be automatically picked up from the environment
  53. apps_map = app_client.get_apps_map()
  54. ```
  55. ---
  56. ## Cloud Functions / Cloud Run
  57. If you're using CXAS SCRAPI with [Cloud Functions](https://cloud.google.com/functions) or [Cloud Run](https://cloud.google.com/run), CXAS SCRAPI can pick up on the default environment creds used by these services without any additional configuration!
  58. 1. Add `cxas-scrapi` to your `requirements.txt` file
  59. 2. Ensure the Cloud Function / Cloud Run service account has the appropriate Custom Agent / Conversational Agents IAM Role
  60. Once you are setup with the above, your function code can be used easily like this:
  61. ```py
  62. from cxas_scrapi import Agents
  63. app_name = '<YOUR_APP_NAME>'
  64. a = Agents(project_id='<YOUR_GCP_PROJECT_ID>', location='global')
  65. agents_map = a.get_agents_map(app_name)
  66. ```
  67. ---
  68. ## Local Python Environment
  69. Similar to Cloud Functions / Cloud Run, CXAS SCRAPI can pick up on your local authentication creds _if you are using the gcloud CLI._
  70. 1. Install [gcloud CLI](https://cloud.google.com/sdk/docs/install).
  71. 2. Run `gcloud init`.
  72. 3. Run `gcloud auth login`
  73. 4. Run `gcloud auth application-default login`
  74. 5. Run `gcloud auth list` to ensure your principal account is active.
  75. This will authenticate your principal GCP account with the gcloud CLI, and SCRAPI can pick up the creds from here.
  76. ---
  77. ## Exceptions and Misc.
  78. If you prefer to explicitly assign Service Account credentials programmatically instead of relying on the environmental `application-default`, you can pass the path to your JSON key using `creds_path`.
  79. ```py
  80. from cxas_scrapi import Tools
  81. creds_path = '<PATH_TO_YOUR_SERVICE_ACCOUNT_JSON_FILE>'
  82. t = Tools(project_id='<YOUR_GCP_PROJECT_ID>', location='global', creds_path=creds_path)
  83. tools_map = t.get_tools_map('<YOUR_APP_NAME>')
  84. ```
  85. <!-- GETTING STARTED -->
  86. # Getting Started
  87. ## Environment Setup
  88. Set up Google Cloud Platform credentials and install dependencies.
  89. ```sh
  90. gcloud auth login
  91. gcloud auth application-default login
  92. gcloud config set project <project name>
  93. ```
  94. ```sh
  95. uv sync
  96. source .venv/bin/activate
  97. ```
  98. ## Usage
  99. To run a simple bit of code you can do the following:
  100. - Import a Class from `cxas_scrapi`
  101. - Define your GCP Project and Location
  102. ```python
  103. from cxas_scrapi import Apps
  104. # Instantiate your class object and pass in your credentials
  105. app_client = Apps(project_id='<YOUR_GCP_PROJECT_ID>', location='global')
  106. # Retrieve all Apps existing in your project
  107. apps = app_client.list_apps()
  108. for app in apps:
  109. print(app.display_name, app.name)
  110. ```
  111. # Library Composition
  112. Here is a brief overview of the CXAS SCRAPI library's structure and the motivation behind that structure.
  113. ## [Core](src/cxas_scrapi/core)
  114. The `src/cxas_scrapi/core` directory contains the high level building blocks of CXAS SCRAPI, mapped to core resource types in the CXAS environment (Apps, Agents, Tools, Guardrails, Deployments, Sessions, etc.)
  115. ## [Utils](src/cxas_scrapi/utils)
  116. The `src/cxas_scrapi/utils` directory contains helper functions and background logic for pagination, response flattening, proto conversions, and external integrations like Google Sheets.
  117. ## [Evals](src/cxas_scrapi/evals)
  118. The `src/cxas_scrapi/evals` directory provides tools for executing and analyzing agent performance evaluations, including Golden tests and simulation runs, and extracting metrics like latency.
  119. ## [CLI](src/cxas_scrapi/cli)
  120. The `src/cxas_scrapi/cli` directory implements the command line interface for SCRAPI, offering tools like `cxas lint` to automate development and validation workflows.
  121. ## [Migration](src/cxas_scrapi/migration)
  122. The `src/cxas_scrapi/migration` directory contains tools to facilitate transitioning legacy Dialogflow CX agents to CXAS, including agent generation from flows and artifact building.
  123. <!-- DOCUMENTATION -->
  124. # Documentation
  125. The official documentation is hosted online at [https://googlecloudplatform.github.io/cxas-scrapi/stable/](https://googlecloudplatform.github.io/cxas-scrapi/stable/).
  126. The documentation site is built with [MkDocs Material](https://squidfunk.github.io/mkdocs-material/). To run it locally:
  127. ```sh
  128. # Install dependencies including docs extras
  129. uv sync --extra docs
  130. # Start the local dev server
  131. uv run mkdocs serve
  132. ```
  133. Open [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser. Changes to files in `docs/` will reload automatically.
  134. To build the static site without serving:
  135. ```sh
  136. mkdocs build # output goes to site/
  137. mkdocs build --strict # also fails on warnings (used in CI)
  138. ```
  139. <!-- CONTRIBUTING -->
  140. # Contributing
  141. We welcome any contributions or feature requests you would like to submit!
  142. 1. Fork the Project
  143. 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
  144. 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
  145. 4. Push to the Branch (`git push origin feature/AmazingFeature`)
  146. 5. Open a Pull Request
  147. <!-- LICENSE -->
  148. # License
  149. Distributed under the Apache 2.0 License. See [LICENSE](LICENSE.txt) for more information.
  150. <!-- CONTACT -->
  151. # Contact
  152. Patrick Marlow - [pmarlow@google.com](mailto:pmarlow@google.com) - [@kmaphoenix](https://github.com/kmaphoenix)
  153. Project Link: [https://github.com/GoogleCloudPlatform/cxas-scrapi](https://github.com/GoogleCloudPlatform/cxas-scrapi)
  154. <!-- REFERENCES -->
  155. # References
  156. * [CX Agent Studio Documentation](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps)
  157. * [CX Agent Studio Console](https://ces.cloud.google.com/)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.