gemini-adk-cli-rs
Command-line interface for ADK agent development. Mirrors the upstream adk CLI — scaffold, run, serve, evaluate, and deploy agents.
Prerequisites
- Rust toolchain (stable, 1.75+)
- Google API key or GCP credentials for agent execution
- Docker (for
deploy cloud_runanddeploy gke) - gcloud CLI (for
deploy cloud_runanddeploy agent_engine) - kubectl (for
deploy gke)
Installation
# From workspace root
# Or run directly
The binary is named adk.
Commands
adk create — Scaffold a new agent
Creates a new agent project directory with boilerplate files.
Generated files:
my_agent/
├── agent.toml # Agent configuration
├── Cargo.toml # Rust project manifest
├── src/main.rs # Entry point
├── .env # API key
└── .gitignore
agent.toml format (TOML):
= "my_agent"
= "A new ADK agent"
= "gemini-2.0-flash"
= "You are a helpful assistant."
= []
= []
adk run — Interactive terminal REPL
Run an agent interactively in the terminal.
# Basic usage — point at agent directory
# Resume a session
# Save transcript on exit
# Replay a saved session (non-interactive)
REPL commands:
- Type messages normally to chat with the agent
/quitor/exit— exit the REPLCtrl+D(EOF) — exit the REPL
Saved session format:
adk web — Development web server with UI
Start the web UI for interactive agent development.
Flags:
| Flag | Default | Description |
|---|---|---|
--host |
127.0.0.1 |
Bind address |
--port |
8000 |
Port |
--allow-origins |
all | Comma-separated CORS origins |
--log-level |
info |
Log level (trace/debug/info/warn/error) |
--reload |
off | Auto-reload on file changes |
--a2a |
off | Enable A2A protocol endpoint |
--trace-to-cloud |
off | Export traces to Cloud Trace |
--session-service-uri |
in-memory | External session service URI |
--artifact-storage-uri |
in-memory | External artifact storage URI |
adk api — Headless API server
Start a REST API server without the web UI. Same flags as adk web.
Endpoints served:
GET /list-apps — List discovered agents
POST /run — Execute agent (JSON)
POST /run_sse — Execute agent (SSE stream)
GET /apps/:app/users/:user/sessions/:session — Get session
POST /apps/:app/users/:user/sessions — Create session
DELETE /apps/:app/users/:user/sessions/:session — Delete session
GET /debug/trace/:event_id — Get trace spans
GET /debug/trace/session/:session_id — Get session traces
adk eval — Run evaluations
Evaluate an agent against a test set.
# Basic eval
# With scoring config and detailed output
.evalset.json format:
test_config.json format:
Available evaluation criteria:
| Criterion | Description |
|---|---|
response_match_score |
Fuzzy match against expected outputs |
final_response_match_v2 |
Improved response matching with semantic similarity |
tool_trajectory_avg_score |
Tool call sequence accuracy |
rubric_based_final_response_quality_v1 |
LLM-as-judge response quality scoring |
rubric_based_tool_use_quality_v1 |
LLM-as-judge tool use scoring |
hallucinations_v1 |
Hallucination detection (PII, prompt injection, data leakage) |
safety_v1 |
Safety policy compliance |
per_turn_user_simulator_quality_v1 |
Multi-turn conversation quality |
adk deploy — Deploy to cloud
Deploy an agent to a cloud target.
# Cloud Run
# With web UI bundled
# GKE
# Vertex AI Agent Engine
Cloud Run generates a Dockerfile and prints the gcloud run deploy command.
GKE generates a Dockerfile + k8s.yaml (Deployment + Service) and prints docker build / kubectl apply commands.
Agent Engine deploys to Vertex AI Agent Engine (API integration pending).
Flags:
| Flag | Default | Description |
|---|---|---|
--project |
required | GCP project ID |
--region |
us-central1 |
GCP region |
--service-name |
agent name | Override service name |
--with-ui |
off | Bundle the web UI |
--trace-to-cloud |
off | Enable Cloud Trace export |
Agent Discovery
The CLI discovers agents by looking for manifest files:
agent.toml— TOML format (used byadk create,adk run,adk eval,adk deploy)agent.json/root_agent.json— JSON format (used bygemini-adk-api-rs, matches upstream ADK)
Both formats support the same fields. The CLI scans:
<agent_dir>/agent.toml(single agent)<agent_dir>/<subdir>/agent.toml(multi-agent project with sub-agents in subdirectories)
Project Structure
tools/gemini-adk-cli-rs/
├── src/
│ ├── main.rs — CLI entry point (clap derive)
│ ├── manifest.rs — Agent manifest loading and discovery
│ └── commands/
│ ├── mod.rs — Command module re-exports
│ ├── create.rs — Project scaffolding
│ ├── run.rs — Interactive REPL
│ ├── web.rs — Web server with UI
│ ├── api.rs — Headless API server
│ ├── eval.rs — Evaluation runner
│ └── deploy.rs — Cloud deployment
└── Cargo.toml