google/agents-cli8 files

Google Agents CLI Deploy

>

Specification
Skill ID
google/agents-cli/google-agents-cli-deploy
Publisher
google
Repository
agents-cli
Installs
11,136
Files
8
Synced
Sep 16, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

google/agents-cli/google-agents-cli-deployInstalls these files
  • references/agent-runtime.md
  • references/batch-inference.md
  • references/cicd-pipeline.md
  • references/cloud-run.md
  • references/gke.md
  • references/terraform-patterns.md
  • references/testing-deployed-agents.md
  • SKILL.md

What this skill tells the agent

Deployment Guide

Requires: agents-cli (uv tool install google-agents-cli) — install uv first if needed.
Prefer using the agents-cli commands throughout this guide — they wrap Terraform, Docker, and deployment into a tested pipeline. If your project isn't scaffolded yet, see /google-agents-cli-scaffold to add deployment support first.

Reference Files

For deeper details, consult these reference files in references/:

  • `cloud-run.md` — Scaling defaults, Dockerfile, session types, networking
  • `agent-runtime.md` — container-based deploy, unified FastAPI app, the /api passthrough, Terraform resource, deployment metadata, CI/CD differences
  • `gke.md` — GKE Autopilot cluster, Kubernetes manifests, Workload Identity, session types, networking
  • `terraform-patterns.md` — Custom infrastructure, IAM, state management, importing resources
  • `batch-inference.md` — BigQuery Remote Function trigger; for Pub/Sub / Eventarc on ADK see /google-agents-cli-adk-code
  • `cicd-pipeline.md` — Full CI/CD pipeline setup, infra cicd flags, runner comparison, WIF auth, pipeline stages
  • `testing-deployed-agents.md` — Testing instructions per deployment target, curl examples, load tests
Observability: See the /google-agents-cli-observability skill for Cloud Trace, prompt-response logging, BigQuery Analytics, and third-party integrations.

Deployment Target Decision Matrix

Choose the right deployment target based on your requirements:

CriteriaAgent RuntimeCloud RunGKE
ScalingManaged auto-scaling (configurable min/max, concurrency)Fully configurable (min/max instances, concurrency, CPU allocation)Full Kubernetes scaling (HPA, VPA, node auto-provisioning)
NetworkingVPC-SC and PSC-I supported (private VPC connectivity via network attachments)Full VPC support, direct VPC egress, IAP, ingress rulesFull Kubernetes networking
Session stateManaged Agent Engine sessions (ADK wires VertexAiSessionService automatically)In-memory (dev), Cloud SQL, or Agent Platform Sessions backendIn-memory (dev), Cloud SQL, or Agent Platform Sessions backend
Batch/event processingTrigger endpoints reachable via the Agent Engine /api passthroughNative trigger endpoints (Pub/Sub, Eventarc); ADK: see /google-agents-cli-adk-codeCustom (Kubernetes Jobs, Pub/Sub)
Cost modelvCPU-hours + memory-hours (not billed when idle)Per-instance-second + min instance costsNode pool costs (always-on or auto-provisioned)
Setup complexityLower (managed, purpose-built for agents)Medium (Dockerfile, Terraform, networking)Higher (Kubernetes expertise required)
Best forManaged infrastructure, minimal opsCustom infra, full networking controlFull Kubernetes control

Ask the user which deployment target fits their needs. Each is a valid production choice with different trade-offs.

All three targets are container-based, so any language works.

Product name mapping: "Agent Engine" / "Vertex AI Agent Engine" is now Agent Runtime. Use --deployment-target agent_runtime.
Ambient / scheduled / event-driven agents (ADK projects): ADK's trigger_sources registers /apps/{app}/trigger/* endpoints on the same FastAPI app for all targets. On Cloud Run / GKE these are public HTTP routes you point a Pub/Sub push subscription or Eventarc trigger at; on Agent Runtime the same routes are reachable through the Agent Engine /api passthrough (e.g. .../reasoningEngines/v1/{resource}/api/apps/{app}/trigger/pubsub). Cloud Run remains the simplest target for unauthenticated trigger sources. See /google-agents-cli-adk-code (references/adk-python.md, section "12. Event-Driven / Ambient Agents") for the trigger_sources pattern.
OAuth / user consent agents: Use Agent Runtime with Gemini Enterprise for agents that need OAuth 2.0 user consent (e.g., accessing Google Drive, Calendar, or other user-scoped APIs). Cloud Run does not currently support managed OAuth flows. For a worked ADK example, look up OAuth user consent in the topic index in /google-agents-cli-adk-codereferences/samples.md.

Deploying to Dev

Deploy Workflow

Task tracking: Deployment involves multiple sequential steps (infra setup, CI/CD configuration, deploy, verification). Use a task list to track progress through these steps — skipping one often causes failures in later steps that are hard to trace back.

  1. If prototype (no deployment target), first enhance: agents-cli scaffold enhance . --deployment-target <target>
  2. Notify the human: paste the eval scores and test results, then ask "Ready to deploy to dev?"
  3. Wait for explicit approval
  4. Once approved: agents-cli deploy
Agent Runtime timeout recovery: Agent Runtime deploys can take 5-10 minutes and may exceed command timeouts. If the deploy command is cancelled or times out, the deployment continues server-side. Run agents-cli deploy --status to check progress — poll every 60 seconds until it reports completion or failure.

IMPORTANT: Never run agents-cli deploy without explicit human approval.

Do NOT run `agents-cli infra single-project` before deploying. It is not a prerequisite — agents-cli deploy works on its own. Run it separately if the user needs observability features (prompt-response logging, BigQuery analytics) — see /google-agents-cli-observability.

Single-Project Infrastructure Setup (Optional — Advanced)

agents-cli infra single-project runs terraform apply in deployment/terraform/single-project/. Use this to provision single-project GCP infrastructure without CI/CD (service accounts, IAM bindings, telemetry resources, Artifact Registry). Also useful to test things in a single project before going to production. It is NOT required for deploying.

# Optional — provision infrastructure in a single GCP project
agents-cli infra single-project
Note: agents-cli deploy doesn't automatically use the Terraform-created app_sa. Pass the service account explicitly: agents-cli deploy --service-account SA_EMAIL.

Deploy Flag Reference

FlagDescriptionTargets
--projectGCP project IDAll
--regionGCP regionAll
--service-accountService account email for the deployed agentAll
--service-nameOverride the deployed service name (Cloud Run service or Agent Runtime display name); defaults to the project name. If you override it, consider updating your Terraform and CI (if present) — they name resources from the project name. Not supported for GKE, whose names are fully owned by Terraform.Agent Runtime, Cloud Run
--secretsComma-separated ENV=SECRET or ENV=SECRET:VERSION pairsAgent Runtime, Cloud Run
--update-env-varsComma-separated KEY=VALUE environment variablesAgent Runtime, Cloud Run
--agent-identityEnable agent identity (Preview)Agent Runtime
--network-attachmentNetwork attachment resource name for PSC interface (enables private VPC connectivity)Agent Runtime
--dns-peering-domainDNS peering domain suffix, e.g. my-internal.corp. (requires --network-attachment)Agent Runtime
--dns-peering-projectProject ID hosting the Cloud DNS managed zone for DNS peering (requires --network-attachment)Agent Runtime
--dns-peering-networkVPC network name in the target project for DNS peering (requires --network-attachment)Agent Runtime