Authentication
Clanker CLI uses thegcloud CLI for all GCP operations. You must be authenticated with gcloud before using Clanker.
Project configuration
Configure your GCP project ID in one of the following ways:.clanker.yaml
Clanker resolves the project ID in this order:
- Configuration file (
infra.gcp.project_id) GCP_PROJECTenvironment variableGOOGLE_CLOUD_PROJECTenvironment variableGCLOUD_PROJECTenvironment variable
Backend credentials
When using Clanker with backend-provided credentials, you can authenticate using a service account:GOOGLE_APPLICATION_CREDENTIALS is automatically set for the session.
Querying infrastructure
Natural language queries
Ask questions about your GCP infrastructure using natural language:Context gathering
Clanker automatically gathers relevant GCP context based on your query. When you ask about specific services, it fetches only the data needed to answer your question.Supported resource types
Clanker can query these GCP resources:Compute & Containers
Compute & Containers
- Compute Engine instances
- Instance groups
- GKE clusters
- Cloud Run services
- Cloud Run jobs
Storage & Databases
Storage & Databases
- Cloud Storage buckets
- Firestore databases
- Cloud SQL instances
- BigQuery datasets
- Spanner instances
- Bigtable instances
- Memorystore (Redis)
- Memorystore (Memcached)
Networking & Security
Networking & Security
- VPC networks
- Subnets
- Firewall rules
- Load balancers
- Cloud Armor policies
- Cloud DNS zones
Serverless & Messaging
Serverless & Messaging
- Cloud Functions
- Cloud Functions Gen2
- Pub/Sub topics
- Pub/Sub subscriptions
- Cloud Tasks queues
- Cloud Scheduler jobs
- Eventarc triggers
DevOps & Identity
DevOps & Identity
- IAM service accounts
- IAM roles
- Artifact Registry repositories
- Cloud Build triggers
- Cloud Deploy pipelines
- Secret Manager secrets
- Cloud KMS keyrings
Monitoring & API
Monitoring & API
- Cloud Logging sinks
- Cloud Monitoring alert policies
- API Gateway APIs
- Firebase apps
Direct commands
Use theclanker gcp list command to query resources directly without AI interpretation:
Available list commands
IAM
iam- Service accountsiam-roles- IAM roles
Compute
compute- VM instancesinstance-groups- Instance groupsgke- GKE clusters
Serverless
cloudrun- Cloud Run servicesrun-jobs- Cloud Run jobsfunctions- Cloud Functionsfunctions-gen2- Functions Gen2
Storage
gcs- Cloud Storage bucketscloudsql- Cloud SQLfirestore- Firestorebigquery- BigQuery datasetsspanner- Spannerbigtable- Bigtable
Networking
networks- VPC networkssubnets- Subnetsfirewall- Firewall rulesload-balancers- Load balancersdns- Cloud DNS zones
Messaging
pubsub- Pub/Sub topicssubscriptions- Subscriptionstasks- Cloud Tasks queuesscheduler- Scheduler jobs
Advanced list options
Some list commands support additional options:Error handling
Clanker provides intelligent error hints when operations fail:Retry mechanism
Clanker automatically retries failedgcloud commands with exponential backoff for transient errors:
- Rate limiting errors
- Timeout errors
- Temporarily unavailable services
- Resource exhausted errors
Implementation details
Client initialization
Frominternal/gcp/client.go:36:
Command execution
All GCP operations use theexecGcloud method which:
- Verifies
gcloudis installed - Appends the project ID to all commands
- Implements retry logic for transient failures
- Provides helpful error hints
internal/gcp/client.go:99:
Best practices
Use specific queries
Ask about specific resources to get faster, more focused results instead of broad queries.
Configure project ID
Set your project ID in
.clanker.yaml to avoid specifying it on every command.Enable required APIs
Ensure the GCP APIs you need are enabled in your project before querying resources.
Use service accounts
For automation, use service accounts with minimal required permissions.
Examples
Query Cloud Run services
List Firestore databases
Check compute instances
GCP integration requires the
gcloud CLI to be installed and authenticated. Make sure you’ve run gcloud auth login before using Clanker.