cargo-adk
Scaffolding, build, and deployment CLI for ADK-Rust — generate agent projects from composable templates, verify builds, and deploy to ADK Platform.
Install
Commands
cargo adk new — Scaffold a new agent
# Create a basic Gemini agent
# Create with a specific template
# Compose with addons
# Use an enterprise pattern
# Use a different provider
# List available templates
cargo adk build — Compile without deploying
Verify that your agent project compiles correctly without deploying. Useful for local development and CI pipelines.
# Build in release mode (default)
# Build in debug mode for faster iteration
# Build a project at a specific path
Options
| Flag | Default | Description |
|---|---|---|
--manifest-path <PATH> |
Current directory | Path to the Cargo.toml file |
--debug |
Release mode | Build in debug mode (faster compilation, unoptimized binary) |
Build vs Deploy
| Aspect | cargo adk build |
cargo adk deploy |
|---|---|---|
| Purpose | Compile and verify | Compile, bundle, and push to platform |
| Network required | No | Yes |
| Authentication | None | Token required |
| Output | Local binary in target/ |
Bundle uploaded to platform |
| Use case | Local dev, CI checks | Production deployment |
cargo adk deploy — Deploy to ADK Platform
# Deploy to local platform (default)
# Deploy to a specific environment and server
# Use a specific auth token
# Skip build (use existing binary)
# Validate without pushing (CI-friendly)
Options
| Flag | Default | Description |
|---|---|---|
--environment |
production |
Target deployment environment |
--token |
ADK_DEPLOY_TOKEN env |
Auth token for the platform server |
--server |
http://127.0.0.1:8090 |
Platform server URL |
--skip-build |
false |
Skip cargo build --release |
--dry-run |
false |
Validate everything without pushing |
Authentication
The deploy command authenticates in this order:
--tokenflag (highest priority)ADK_DEPLOY_TOKENenvironment variable- Cached credentials from
~/.config/adk-deploy/config.json - Ephemeral login (requires
ADK_DEPLOY_EMAILenv var)
Secret Upload
If your adk-deploy.toml declares secrets and a .env file exists, the CLI automatically uploads matching secrets before pushing:
# adk-deploy.toml
[[]]
= "google-api-key"
= true
# .env
GOOGLE_API_KEY=your-actual-key
The convention maps UPPER_SNAKE_CASE env var names to lower-kebab-case secret keys:
GOOGLE_API_KEY→google-api-keyOPENAI_API_KEY→openai-api-keyDATABASE_URL→database-url
Deploy Flow
- Load and validate
adk-deploy.toml - Authenticate with the platform
- Upload secrets from
.env(if present) - Build the release binary
- Create a
.tar.gzbundle (manifest + binary) - Compute SHA-256 checksum
- Push to the platform server
Templates
| Template | What you get |
|---|---|
basic |
Gemini agent with interactive console (default) |
tools |
Agent with #[tool] macro custom tools |
rag |
RAG pipeline with Gemini embeddings + in-memory vector store |
api |
REST server with health check, ready for deployment |
openai |
OpenAI GPT-4o agent with console |
a2a |
A2A protocol server with A2aServer::quick_start |
graph |
Graph-based workflow with checkpoints and durable execution |
realtime |
Real-time bidirectional audio/video streaming agent |
Each template generates:
Cargo.tomlwith the right dependencies and feature flagssrc/main.rsthat compiles and runs immediately.env.examplewith the required API key variablesREADME.mdwith setup instructions
Composable Template System
The --addon flag lets you layer cross-cutting capabilities onto any base template:
# Add telemetry and auth to a tools agent
# Add Docker and CI to an API server
# Combine multiple addons
Available Addons (9)
| Addon | What it adds |
|---|---|
telemetry |
OpenTelemetry integration with OTLP exporter |
auth |
Authentication middleware (API keys, JWT, OAuth2) |
eval |
Evaluation framework with trajectory and semantic scoring |
docker |
Multi-stage Dockerfile and docker-compose.yml |
ci |
GitHub Actions CI pipeline (fmt, clippy, test, build) |
monitoring |
Health checks, readiness probes, Prometheus metrics |
tracing |
Structured logging with configurable levels |
logging |
File-based logging with rotation |
testing |
Property-based testing and integration test scaffolding |
Enterprise Patterns (5)
Pre-composed combinations of a base template and curated addons for production scenarios:
| Pattern | Base | Addons | Use case |
|---|---|---|---|
microservices |
api | telemetry, monitoring, docker, ci | Kubernetes-ready agent microservices |
event-driven |
graph | telemetry, monitoring, logging | Event-driven workflows with durable execution |
multi-agent |
basic | telemetry, tracing, monitoring | Multi-agent orchestration with observability |
serverless |
basic | telemetry, logging | AWS Lambda / Cloud Functions deployment |
data-pipeline |
basic | telemetry, eval, logging, testing | ETL and document processing pipelines |
# Use an enterprise pattern
# Extend a pattern with additional addons
For full documentation on all templates, addons, and patterns, see the Composable Templates Guide.
Generated Project
my-agent/
├── Cargo.toml
├── src/
│ └── main.rs
├── .env.example
├── README.md
└── .gitignore
Version
Current version: 0.9.0
[]
= "0.9.0"
Part of ADK-Rust
This tool is part of the ADK-Rust framework for building AI agents in Rust.
License
Apache-2.0