Skip to main content
Like AOF? Give us a star!
If you find AOF useful, please star us on GitHub. It helps us reach more developers and grow the community.

GCP Tools

AOF provides 8 GCP tools covering compute, storage, Kubernetes, IAM, and more.

Prerequisites

  • Google Cloud SDK installed
  • Authenticated via gcloud auth login
# Install Google Cloud SDK
curl https://sdk.cloud.google.com | bash
exec -l $SHELL

# Initialize and authenticate
gcloud init
gcloud auth login

# Set default project
gcloud config set project your-project-id

Available Tools

ToolServiceDescription
gcp_computeCompute EngineVM instance management
gcp_storageCloud StorageBucket and object operations
gcp_gkeGKEKubernetes cluster management
gcp_iamIAMIdentity and access management
gcp_loggingCloud LoggingLog querying and management
gcp_pubsubPub/SubMessaging operations
gcp_sqlCloud SQLDatabase management
gcp_functionsCloud FunctionsServerless function operations

Tool Reference

gcp_compute

Compute Engine instance operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYesinstances-list, instances-describe, instances-start, instances-stop, instances-reset, instances-delete, disks-list, machine-types-list
instance_namestringNoInstance name
zonestringNoZone (e.g., us-central1-a)
projectstringNoProject ID
filterstringNoFilter expression
formatstringNoOutput format: json, text, yaml

Example:

tools:
- gcp_compute

# "List all instances in project my-project"
# "Stop instance web-server in zone us-central1-a"
# "List available machine types in us-central1-a"

gcp_storage

Cloud Storage bucket and object operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYesls, cp, rm, mb, rb, mv, rsync
sourcestringNoSource path (local or gs://)
destinationstringNoDestination path
recursivebooleanNoRecursive operation
projectstringNoProject ID

Example:

tools:
- gcp_storage

# "List all buckets"
# "Copy backup.tar.gz to gs://my-bucket/backups/"
# "Sync local ./dist to gs://my-bucket/static/"

gcp_gke

Google Kubernetes Engine operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYesclusters-list, clusters-describe, clusters-get-credentials, clusters-create, clusters-delete, clusters-upgrade, node-pools-list, node-pools-describe
cluster_namestringNoCluster name
zonestringNoZone (for zonal clusters)
regionstringNoRegion (for regional clusters)
projectstringNoProject ID
formatstringNoOutput format

Example:

tools:
- gcp_gke

# "List all GKE clusters"
# "Get credentials for cluster prod-cluster in us-central1"
# "Describe node pools for cluster staging-cluster"

gcp_iam

IAM and service account operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYesroles-list, roles-describe, service-accounts-list, service-accounts-describe, service-accounts-keys-list, service-accounts-keys-create
role_namestringNoRole name
service_accountstringNoService account email
projectstringNoProject ID
formatstringNoOutput format

Example:

tools:
- gcp_iam

# "List all service accounts"
# "List keys for service account deploy@my-project.iam.gserviceaccount.com"
# "Describe role roles/compute.admin"

gcp_logging

Cloud Logging operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYesread, logs-list, logs-delete, sinks-list
filterstringNoLog filter expression
log_namestringNoLog name
limitintegerNoMax entries (default: 100)
projectstringNoProject ID
formatstringNoOutput format

Example:

tools:
- gcp_logging

# "Read logs from the last hour with severity ERROR"
# "List all log names in project"
# "Read logs for resource.type=\"gke_cluster\""

gcp_pubsub

Pub/Sub messaging operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYestopics-list, topics-describe, topics-create, topics-delete, topics-publish, subscriptions-list, subscriptions-describe, subscriptions-create, subscriptions-delete
topic_namestringNoTopic name
subscription_namestringNoSubscription name
messagestringNoMessage to publish
projectstringNoProject ID
formatstringNoOutput format

Example:

tools:
- gcp_pubsub

# "List all topics"
# "Publish message to topic events"
# "List subscriptions for topic notifications"

gcp_sql

Cloud SQL database operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYesinstances-list, instances-describe, instances-create, instances-delete, instances-restart, instances-patch, backups-list, backups-describe, backups-create
instance_namestringNoInstance name
backup_idstringNoBackup ID
projectstringNoProject ID
formatstringNoOutput format

Example:

tools:
- gcp_sql

# "List all Cloud SQL instances"
# "Create backup of instance production-db"
# "Describe instance staging-mysql"

gcp_functions

Cloud Functions operations.

Parameters:

ParameterTypeRequiredDescription
commandstringYeslist, describe, deploy, delete, call, logs-read
function_namestringNoFunction name
datastringNoJSON data for function call
regionstringNoRegion
projectstringNoProject ID
formatstringNoOutput format

Example:

tools:
- gcp_functions

# "List all Cloud Functions"
# "Call function process-order with data {\"orderId\": \"123\"}"
# "Read logs for function email-sender"

Example Agent

apiVersion: aof.sh/v1alpha1
kind: Agent
metadata:
name: gcp-ops
spec:
model: google:gemini-2.5-flash
tools:
- gcp_compute
- gcp_gke
- gcp_storage
- gcp_logging

environment:
GOOGLE_CLOUD_PROJECT: "${GOOGLE_CLOUD_PROJECT}"
CLOUDSDK_COMPUTE_ZONE: "us-central1-a"

system_prompt: |
You are a GCP cloud operations specialist.
Help manage Compute Engine, GKE, Storage, and Logging.

## Guidelines
- Always specify project and zone/region when required
- Use JSON format for data analysis
- Confirm destructive operations before proceeding

Common Patterns

Working with Projects

environment:
GOOGLE_CLOUD_PROJECT: "my-project"

# Or specify per operation
"List instances in project dev-project"

Zone vs Region

# Zonal resources (VMs, zonal GKE)
"List instances in zone us-central1-a"

# Regional resources (regional GKE, Cloud SQL)
"Describe cluster prod-cluster in region us-central1"

Log Filtering

# Filter by severity
"Read logs with severity >= ERROR"

# Filter by resource
"Read logs for resource.type=\"gke_cluster\" AND resource.labels.cluster_name=\"prod\""

# Filter by time
"Read logs from the last 2 hours"

Service Account Management

# List and audit service accounts
"List all service accounts"
"List keys for service account"
# Identify keys older than 90 days for rotation