Agents CLI: the agent lifecycle from a coding agent
Agents CLI gives a coding agent the skills and commands to scaffold, evaluate, deploy and observe agents on Google Cloud. Learn what it adds, which skill covers each lifecycle phase, and when a coding agent, a person or an unattended pipeline should drive each step.
Chapter 3Coding agentsLesson 3 of 4ShowHide
Chapter 3 of 7 in Google Cloud Professional Agentic Architect
- Agents CLI: the agent lifecycle from a coding agentYou're here
Prerequisites: Customising coding agents: rules, hooks, skills, subagents and plugins
What Agents CLI adds to a coding agent
Customising coding agents showed how give a coding agent know-how for a kind of task. applies that idea to one job: building agents on Google Cloud. It is a command-line tool plus a set of skills, and its README is explicit that it is "a tool for coding agents, not a coding agent itself".
uvx google-agents-cli setupSetup (uvx comes with the uv Python tool) installs the agents-cli command
and seven skills into every coding agent it finds on the machine, such as
Antigravity CLI, Claude Code, Codex or Cursor. The skills tell the coding agent
what to do at each phase and which command to run; the commands do the work. A
coding agent without them can still write an agent, but it has to guess the
project layout, the evaluation format and the deployment steps.
Agents CLI builds agents with by default, and has templates for LangChain and the Claude Agent SDK. It does not handle the coding agent's own sign-in; each coding agent authenticates as it always does.
The lifecycle, phase by phase
Agents CLI splits building an agent into phases, each with a skill, and most
with a command. The google-agents-cli-workflow skill is always active and
walks the coding agent through them in order.
| Phase | Skill | Command |
|---|---|---|
| Spec: agree what the agent should do | google-agents-cli-workflow | None (writes a spec file) |
| Scaffold the project | google-agents-cli-scaffold | agents-cli create |
| Build the agent's tools and orchestration | google-agents-cli-adk-code | agents-cli run and playground to try it (the coding agent writes the code) |
| Evaluate against a dataset and metrics | google-agents-cli-eval | agents-cli eval run |
| Deploy to a runtime (targets, service accounts, rollback) | google-agents-cli-deploy | agents-cli deploy |
| Publish to Gemini Enterprise | google-agents-cli-publish | agents-cli publish gemini |
| Observe traces and logs | google-agents-cli-observability | None (built-in tracing) |
The simulation merges Deploy and Publish into one stage, and shows the two loops back to Build.
Step the order-support agent round the loop below, with each phase's skill and command. First predict where a failed evaluation sends the coding agent.
Here is how that runs for an order-support agent that looks up orders and books carrier pickups, with a developer asking their coding agent to build it in a development project:
- Spec. The workflow skill has the coding agent ask the developer what the agent should do, one question at a time, and write the answers to a spec file before any code exists.
- Scaffold. The coding agent runs
agents-cli create order-support -d agent_runtime, which lays out an ADK project set up to deploy to and records that target in the project's manifest file. A--prototypeflag skips the CI/CD and Terraform files for a quick start. - Build and run. Guided by the adk-code skill, the coding agent writes the
tools, then tries them with
agents-cli run "Where is order 1042?"or the localagents-cli playground. - Evaluate.
agents-cli eval rungenerates the order-support agent's responses to a dataset and grades them against the chosen metrics, some scored by an LLM acting as judge. Failures send the coding agent back to step 3. In a Python project the dataset lives intests/eval/datasets/(for examplebasic-dataset.json) in the GenAI Eval SDK'sEvaluationDatasetformat, not ADK's evalset format: the eval commands no longer read*.evalset.jsonfiles, so a project that has them migrates first.agents-cli scaffold upgradedetects and converts them, leaving the old folder in place; check the result before deleting it. - Deploy and publish. The coding agent shows the developer the result of
agents-cli deploy --dry-run, and once the developer approves, runsagents-cli deploy, which reads the target from the manifest.agents-cli publish geminithen registers the deployed agent with so users can reach it. - Observe. Generated projects send traces to Cloud Trace (Google Cloud's
tracing service) by default, and
--otel-to-cloudexports a localrunorplayground's traces and logs to Google Cloud. Prompt-response logging needs a logs bucket, which the Terraform behindagents-cli infra single-project --applycreates (a bareagents-cli deploydoes not), so run it before the first deploy; BigQuery Agent Analytics is opt-in withcreate --bq-analytics. The observability skill helps read the results, and what production shows feeds the next round of building.
For local work a Gemini API key from AI Studio is enough: playground, run
and eval work with the ADK and LangChain templates without a Google Cloud
project. The Claude Agent SDK template is the exception: it needs Google Cloud
credentials even locally. Deploying needs a project with billing and the
permissions the target requires.
Who drives each step
The CLI's documentation describes two ways to drive it: the coding agent "reads the skills and picks the right CLI command at the right phase", or you skip the coding agent, since "every command works standalone". Google's launch post calls these Agent Mode and Human Mode. This lesson splits Human Mode in two, because a person typing and an unattended pipeline need different flags.
- A coding agent drives through the skills. It asks you the questions a command needs rather than guessing, and it acts within its own permission settings, so you can let it run local commands freely and approve the rest.
- A person typing can ask the CLI to prompt for choices:
create -ienables "interactive prompts for human use". - An unattended pipeline must never stop at a prompt, so it passes every
choice as a flag.
create --yesskips prompts and uses defaults.deploytakes--projectexplicitly, since without it the deploy reads the project from gcloud and "stops to ask you to confirm it", and-dwhen there is no manifest to read the target from. The pipeline gates on exit codes: with thresholds set in the eval config,eval runexits 1 when a metric misses one, and the run also fails if any case errors.
Once the order-support project, with its manifest and an eval config that sets
thresholds, is committed, a nightly job with the agents-cli command installed
runs from the project folder:
set -euo pipefail # stop at the first command that fails
agents-cli install --locked # project dependencies; fail if the lock file is out of date
agents-cli eval run # exits 1 on a missed threshold, so the deploy never runs
agents-cli deploy --project my-staging-projectThe first line matters: a plain Bash script carries on after a failed command,
so without set -e (or chaining the commands with &&) the deploy would run
even after the evaluation failed.
The runner also needs credentials: a Google Cloud identity for the deploy (for example a service account through workload identity federation), and a Gemini API key or Google Cloud credentials for metrics that an LLM judges.
Choose the driver by what a mistake would cost. Let the coding agent drive the inner loop of scaffolding, building, running and evaluating in a development project, where every step is cheap to redo. Put repeatable steps that need no judgement, such as a nightly evaluation and staging deploy, in a pipeline.
Keep a person approving steps that change shared resources, such as a deploy to
production or publishing to users. agents-cli deploy --dry-run runs the
pre-flight and read-only Google Cloud checks without deploying, and exits
non-zero if a check fails, which gives that person evidence before they
approve.
Recap
- Agents CLI is a command-line tool plus seven skills that a coding agent uses; it is not a coding agent itself.
- Each lifecycle phase pairs a skill with, mostly, a command:
create,runandplayground,eval run,deployandpublish gemini. Tracing to Cloud Trace is built in, and the observability skill helps read it. - A coding agent drives through the skills, a person can use
-iprompts, and a pipeline passes every choice as flags and gates on exit codes. - Let the coding agent drive cheap, local steps; keep a person approving deploys
and publishing to shared resources, with
deploy --dry-runas evidence.
Sources
Show 9 sourcesHide sources
| Source | Publisher | What it supports |
|---|---|---|
| Agents CLI README (opens in a new tab) | "a tool for coding agents, not a coding agent itself"; uvx google-agents-cli setup; seven skills; works with Antigravity CLI, Claude Code and Codex | |
| Agents CLI in Agent Platform: create to production in one CLI (opens in a new tab) | Google Developers Blog | retrieved 2026-12-02: the CLI is optimized for agent consumption, Agent Mode, and fully supports a Human Mode for deterministic control |
| Getting started (opens in a new tab) | Agents CLI documentation | setup installs the CLI and the skills for the coding agents it finds; ADK, LangChain or the Claude Agent SDK; build with or without a coding agent |
| Lifecycle (opens in a new tab) | Agents CLI documentation | phases Spec, Scaffold, Build and Orchestrate, Evaluate, Deploy, Publish, Observe, with their skills and commands; "Two ways to drive it" |
| Skills reference (opens in a new tab) | Agents CLI documentation | seven skills; google-agents-cli-workflow always active; what each skill covers, including deploy's service accounts and rollback |
| CLI reference (opens in a new tab) | Agents CLI documentation | create -a, -d agent_runtime|cloud_run|gke|none, --prototype, -i "Enable interactive prompts for human use", -y "Non-interactive: skip prompts and use defaults"; run and playground --otel-to-cloud; eval grade --fail-under; deploy --dry-run runs pre-flight and read-only Google Cloud checks; deploy reads its target from agents-cli-manifest.yaml, and -d overrides it or deploys without one |
| "Development", "Deployment", "Evaluation", "CI/CD" and "Observability: Cloud Trace" (opens in a new tab) | Agents CLI documentation | keyless CI authentication through workload identity federation; a coding agent asks the questions one at a time; without --project the deploy stops to confirm the project; eval run exits 1 when a metric misses its threshold so CI can gate on it; generated projects export traces to Cloud Trace with no configuration; prompt-response logging needs a logs bucket provisioned by infra single-project --apply before the first deploy; BigQuery Agent Analytics with create --bq-analytics; a run also fails when any case errored |
| Migrate eval datasets (opens in a new tab) | Agents CLI documentation | eval generate and related commands no longer read tests/eval/evalsets/.evalset.json; agents-cli scaffold upgrade converts them to tests/eval/datasets/-dataset.json in the EvaluationDataset format |
| Authentication (opens in a new tab) | Agents CLI documentation | Gemini API key needs no Google Cloud project and covers playground, run and eval for ADK and LangChain templates; the Claude Agent SDK template needs Google Cloud credentials even locally; deployment needs a project with billing; Agents CLI does not control coding agent authentication |
Suggested videos
Show 2 videosHide videos
Introducing Agents CLI in Agent Platform (opens YouTube in a new tab)
Official launch explainer: Agents CLI as commands plus skills that let a coding agent or a person run the agent lifecycle.
Note: A 4-minute, high-level intro.
A closer look at Agents CLI (opens YouTube in a new tab)
Deeper look at which Agents CLI skills cover each lifecycle phase, including evaluation, which maps to the lesson's phase table.
Review
What is Agents CLI, and what is it not?
Check yourself
A team already uses Claude Code. What does installing Agents CLI add?