Back to paths

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.

advanced~20 min#agentic-ai#coding-agents#agents-cli#adk#deployment
Chapter 3Coding agentsLesson 3 of 4Show

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 setup

Setup (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.

PhaseSkillCommand
Spec: agree what the agent should dogoogle-agents-cli-workflowNone (writes a spec file)
Scaffold the projectgoogle-agents-cli-scaffoldagents-cli create
Build the agent's tools and orchestrationgoogle-agents-cli-adk-codeagents-cli run and playground to try it (the coding agent writes the code)
Evaluate against a dataset and metricsgoogle-agents-cli-evalagents-cli eval run
Deploy to a runtime (targets, service accounts, rollback)google-agents-cli-deployagents-cli deploy
Publish to Gemini Enterprisegoogle-agents-cli-publishagents-cli publish gemini
Observe traces and logsgoogle-agents-cli-observabilityNone (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.

Simulation: agents-cli-loop

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:

  1. 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.
  2. 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 --prototype flag skips the CI/CD and Terraform files for a quick start.
  3. 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 local agents-cli playground.
  4. Evaluate. agents-cli eval run generates 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 in tests/eval/datasets/ (for example basic-dataset.json) in the GenAI Eval SDK's EvaluationDataset format, not ADK's evalset format: the eval commands no longer read *.evalset.json files, so a project that has them migrates first. agents-cli scaffold upgrade detects and converts them, leaving the old folder in place; check the result before deleting it.
  5. Deploy and publish. The coding agent shows the developer the result of agents-cli deploy --dry-run, and once the developer approves, runs agents-cli deploy, which reads the target from the manifest. agents-cli publish gemini then registers the deployed agent with so users can reach it.
  6. Observe. Generated projects send traces to Cloud Trace (Google Cloud's tracing service) by default, and --otel-to-cloud exports a local run or playground's traces and logs to Google Cloud. Prompt-response logging needs a logs bucket, which the Terraform behind agents-cli infra single-project --apply creates (a bare agents-cli deploy does not), so run it before the first deploy; BigQuery Agent Analytics is opt-in with create --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 -i enables "interactive prompts for human use".
  • An unattended pipeline must never stop at a prompt, so it passes every choice as a flag. create --yes skips prompts and uses defaults. deploy takes --project explicitly, since without it the deploy reads the project from gcloud and "stops to ask you to confirm it", and -d when there is no manifest to read the target from. The pipeline gates on exit codes: with thresholds set in the eval config, eval run exits 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-project

The 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, run and playground, eval run, deploy and publish 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 -i prompts, 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-run as evidence.

Sources

Show 9 sourcesHide sources
SourcePublisherWhat it supports
Agents CLI README (opens in a new tab)github.com"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)developers.googleblog.comGoogle Developers Blogretrieved 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)google.github.ioAgents CLI documentationsetup 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)google.github.ioAgents CLI documentationphases 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)google.github.ioAgents CLI documentationseven 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)google.github.ioAgents CLI documentationcreate -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)guides, and google.github.io/agents-cli/guide/observability/cloud-trace/ (opens in a new tab)google.github.ioAgents CLI documentationkeyless 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)google.github.ioAgents CLI documentationeval 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)google.github.ioAgents CLI documentationGemini 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

Review

Flashcards1 / 3

What is Agents CLI, and what is it not?

Check yourself

Quick exam1 / 7 · 0 correct

A team already uses Claude Code. What does installing Agents CLI add?

Your notes on this lesson