### Install Kubernetes Client Library (Go) Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/client-library-usage.md Install the Go Kubernetes client library using go get. ```bash go get k8s.io/client-go@latest ``` -------------------------------- ### Install BigQuery Client Library (Go) Source: https://github.com/google/skills/blob/main/skills/cloud/bigquery-basics/references/client-library-usage.md Install the BigQuery client library for Go using the go get command. This prepares your Go environment for BigQuery interactions. ```bash go get cloud.google.com/go/bigquery ``` -------------------------------- ### Install AlloyDB Go Client Library Source: https://github.com/google/skills/blob/main/skills/cloud/alloydb-basics/references/client-library-usage.md Install the AlloyDB Go client library using the go get command. ```bash go get cloud.google.com/go/alloydbconn ``` -------------------------------- ### Start Antigravity CLI Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-migrate-from-ai-studio/SKILL.md Run this command to start the Antigravity CLI after installation. ```bash agy ``` -------------------------------- ### Install Go Client Library Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-run-basics/references/client-library-usage.md Install the Cloud Run API v2 client library for Go using the go get command. This command fetches and installs the specified package. ```bash go get cloud.google.com/go/run/apiv2 ``` -------------------------------- ### Example: Firebase CLI Deploy Command Help Source: https://github.com/google/skills/blob/main/skills/cloud/firebase-basics/references/cli-usage.md Shows how to get help for the `deploy` command in the Firebase CLI. Always use `npx` to ensure the latest version. ```bash npx -y firebase-tools@latest deploy --help ``` -------------------------------- ### Enable GKE API, Create and Configure Cluster, Deploy Application Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/SKILL.md This snippet demonstrates the essential steps to get started with GKE: enabling the container API, creating an Autopilot cluster, configuring kubectl credentials, and deploying a sample application. ```bash gcloud services enable container.googleapis.com --quiet gcloud container clusters create-auto my-cluster --region=us-central1 --quiet gcloud container clusters get-credentials my-cluster --region=us-central1 --quiet kubectl create deployment hello-server \ --image=us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0 ``` -------------------------------- ### Query Data with BigQuery Client Library (Go) Source: https://github.com/google/skills/blob/main/skills/cloud/bigquery-basics/references/client-library-usage.md Use the BigQuery client library in Go to create a client, construct a query, and initiate a read operation. This example shows basic setup and query execution. ```go ctx := context.Background() client, _ := bigquery.NewClient(ctx, "project-id") q := client.Query("SELECT * FROM dataset.table") it, _ := q.Read(ctx) ``` -------------------------------- ### Example: Firebase CLI Firestore Indexes Command Help Source: https://github.com/google/skills/blob/main/skills/cloud/firebase-basics/references/cli-usage.md Demonstrates how to get help for the `firestore:indexes` command in the Firebase CLI. Always use `npx` to ensure the latest version. ```bash npx -y firebase-tools@latest firestore:indexes --help ``` -------------------------------- ### Install Cloud SQL Go Connector Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-sql-basics/references/client-library-usage.md Install the Cloud SQL Go connector package using go get. This package provides the necessary functionality for Go applications. ```bash go get cloud.google.com/go/cloudsqlconn ``` -------------------------------- ### Install Python Client Library Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-run-basics/references/client-library-usage.md Install the Google Cloud Run client library for Python using pip. Ensure you have pip installed and are using a virtual environment. ```bash pip install --upgrade google-cloud-run ``` -------------------------------- ### Install Kubernetes Client Library (Python) Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/client-library-usage.md Install the Python Kubernetes client library using pip. ```bash pip install kubernetes ``` -------------------------------- ### Install Kubernetes Client Library (Node.js) Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/client-library-usage.md Install the Node.js Kubernetes client library using npm. ```bash npm install @kubernetes/client-node ``` -------------------------------- ### Install Node.js Client Library Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-run-basics/references/client-library-usage.md Install the Google Cloud Run client library for Node.js using npm. This command installs the package and its dependencies. ```bash npm install @google-cloud/run ``` -------------------------------- ### Install Required Libraries and Authenticate Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-skill-registry/SKILL.md Install the necessary Python libraries and authenticate with Google Cloud using application default login. ```bash # Install required libraries pip install google-auth requests # Authenticate with Google Cloud gcloud auth application-default login ``` -------------------------------- ### Manual ADC Setup Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-migrate-from-ai-studio/SKILL.md Manually set up Application Default Credentials by logging in and configuring them. ```bash gcloud auth login gcloud auth application-default login ``` -------------------------------- ### Install OpenAI and Google Auth Libraries Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md Install the necessary Python libraries for using the OpenAI SDK with Google Cloud authentication. ```bash pip install openai google-auth ``` -------------------------------- ### Verify Environment Setup Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md Runs all sample scripts in the scripts/ directory to verify that the environment is correctly set up and all dependencies are working as expected. ```bash ./scripts/verify_all.sh ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md Installs all required Python SDKs and libraries listed in the requirements.txt file. Ensure the virtual environment is activated before running this command. ```bash pip install -r scripts/requirements.txt ``` -------------------------------- ### Check NPM Installation Source: https://github.com/google/skills/blob/main/skills/cloud/firebase-basics/SKILL.md Verify if Node Package Manager (NPM) is installed on the system. If not, guide the user to install Node.js LTS. ```bash ## Check if NPM is installed npm --version ``` -------------------------------- ### Agent Configuration Response Example Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-agents-api/SKILL.md This JSON shows a typical response when retrieving an agent's configuration. It includes details like name, base agent, description, system instruction, tools, and base environment setup. ```json { "name": "projects/your-project-id/locations/global/agents/my-custom-agent", "base_agent": "antigravity-preview-05-2026", "description": "A professional agent configured with remote tools and mounted Cloud Storage directories.", "system_instruction": "You are a helpful, domain-expert assistant.", "tools": [ {"type": "code_execution"}, {"type": "filesystem"}, {"type": "google_search"}, {"type": "url_context"} ], "base_environment": { "type": "remote", "sources": [ { "type": "gcs", "source": "gs://your-agent-bucket-name/skills", "target": "/.agent/skills" } ], "network": { "allowlist": [ { "domain": "*" } ] } } } ``` -------------------------------- ### Example: Generate Manifest for Gemma 2 9B on L4 GPU Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-inference.md An example of generating a Kubernetes manifest for the Gemma 2 9B model using the vLLM server on an NVIDIA L4 GPU, targeting a specific latency. ```bash gcloud container ai profiles manifests create \ --model=gemma-2-9b-it \ --model-server=vllm \ --accelerator-type=nvidia-l4 \ --target-ntpot-milliseconds=50 --quiet > inference.yaml ``` -------------------------------- ### Deploy Model with Traffic Split (Example) Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-endpoint-management/SKILL.md This is an example command for deploying a model with a specific traffic split, typically done via 'gcloud ai endpoints deploy-model'. Refer to the 'agent-platform-deploy' skill for detailed deployment instructions. ```bash # Example: Deploying a model with a specific traffic split is usually done # via 'gcloud ai endpoints deploy-model'. ``` -------------------------------- ### List Supported Models Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-inference.md Use this command to list all available AI/ML models supported by the GKE Inference Quickstart. ```bash gcloud container ai profiles models list --quiet ``` -------------------------------- ### Install GenAI SDK Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md Installs the Google GenAI SDK, which is the preferred method for interacting with Gemini models on Google Cloud Agent Platform. ```bash pip install google-genai ``` -------------------------------- ### Install Agent Skills Source: https://github.com/google/skills/blob/main/README.md Use this command to install Agent Skills from the Google repository. You can then select specific skills to add to your project. ```bash npx skills add google/skills ``` -------------------------------- ### Verify Workload Identity Federation Setup Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-security.md This command verifies the Workload Identity Federation setup by running a test pod and listing its authentication status. ```bash kubectl run workload-identity-test \ --image=gcr.io/google.com/cloudsdktool/cloud-sdk:slim \ --serviceaccount= --namespace= \ --rm -it -- gcloud auth list --quiet ``` -------------------------------- ### Install Kueue Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-batch-hpc.md Install Kueue using kubectl to manage job scheduling and resource allocation for batch workloads. ```bash kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/latest/download/manifests.yaml ``` -------------------------------- ### Install Helm Chart Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/cli-reference.md Installs a Helm chart for a release in a specified namespace. This is a kubectl-only operation. ```bash helm install -n ``` -------------------------------- ### GPU Configuration Example Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-compute-classes.md Specifies GPU requirements within a PriorityRule, including type, count, and optional driver version. ```yaml gpu: type: "nvidia-l4" # nvidia-l4, nvidia-h100-80gb, etc. count: 1 # GPUs per node driverVersion: "latest" # Optional ``` -------------------------------- ### Install Agent Platform Evaluation SDK Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-eval-flywheel/SKILL.md Install the necessary SDKs for agent platform evaluation. Ensure you have version 1.154.0 or higher for aiplatform and version 1.0.0 or higher for google-genai. ```bash pip install google-cloud-aiplatform[evaluation]>=1.154.0 google-genai>=1.0.0 ``` -------------------------------- ### Automated ADC Setup Script Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-migrate-from-ai-studio/SKILL.md Use this script for automated Application Default Credentials setup for local debugging or script execution. ```bash bash <(curl -sSL https://storage.googleapis.com/cloud-samples-data/adc/setup_adc.sh) ``` -------------------------------- ### Install BigQuery Client Library (Node.js) Source: https://github.com/google/skills/blob/main/skills/cloud/bigquery-basics/references/client-library-usage.md Install the BigQuery client library for Node.js using npm. This is necessary for integrating BigQuery into your JavaScript applications. ```bash npm install @google-cloud/bigquery ``` -------------------------------- ### Install BigQuery Client Library (Python) Source: https://github.com/google/skills/blob/main/skills/cloud/bigquery-basics/references/client-library-usage.md Install the BigQuery client library for Python using pip. This is required before using the library in your Python projects. ```bash pip install --upgrade google-cloud-bigquery ``` -------------------------------- ### Python Example for OpenMaaS Completions API Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md Example of using the OpenAI SDK's Completions API with OpenMaaS models. This is suitable for models like 'zai-org/glm-5-maas' and others listed. ```python response = client.completions.create( model="deepseek-ai/deepseek-v3.2-maas", prompt="Once upon a time", max_tokens=100 ) print(response.choices[0].text) ``` -------------------------------- ### List Artifacts Locations Source: https://github.com/google/skills/blob/main/skills/cloud/gcloud/SKILL.md Example command to list locations for the Artifact Registry service. Ensure to specify the project ID. ```bash gcloud artifacts locations list ``` -------------------------------- ### Location Configuration Example Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-compute-classes.md Specifies zone targeting for nodes within a PriorityRule, either by listing specific zones or allowing GKE to pick any zone. ```yaml location: zones: - "us-central1-a" - "us-central1-b" # OR type: "Any" # Let GKE pick from cluster zones ``` -------------------------------- ### TPU Configuration Example Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-compute-classes.md Defines TPU configuration within a PriorityRule, specifying type, count, and topology. ```yaml tpu: type: "v5p-slice" count: 8 topology: "2x2x1" ``` -------------------------------- ### Get Global Firebase CLI Help Source: https://github.com/google/skills/blob/main/skills/cloud/firebase-basics/references/cli-usage.md Lists all available commands and categories for the Firebase CLI. Always use `npx` to ensure the latest version. ```bash npx -y firebase-tools@latest --help ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-tuning/SKILL.md Creates a Python virtual environment named 'tuning_agent_venv' and installs dependencies from 'requirements.txt'. Remember to activate this environment before running any Python commands. ```bash python3 -m venv ~/tuning_agent_venv source ~/tuning_agent_venv/bin/activate pip install -r references/requirements.txt ``` -------------------------------- ### List KMS Locations Source: https://github.com/google/skills/blob/main/skills/cloud/gcloud/SKILL.md Example command to list locations for the Key Management Service (KMS). Ensure to specify the project ID. ```bash gcloud kms locations list ``` -------------------------------- ### Get Agent Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-agents-api/SKILL.md Retrieve the configuration metadata, tools, and environment setup of an existing custom agent. ```APIDOC ## GET /v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID} ### Description Retrieve the configuration metadata, tools, and environment setup of an existing custom agent. ### Method GET ### Endpoint `https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/{AGENT_ID}` ### Response Example Returns the complete configured state of the custom Agent resource: ```json { "name": "projects/your-project-id/locations/global/agents/my-custom-agent", "base_agent": "antigravity-preview-05-2026", "description": "A professional agent configured with remote tools and mounted Cloud Storage directories.", "system_instruction": "You are a helpful, domain-expert assistant.", "tools": [ {"type": "code_execution"}, {"type": "filesystem"}, {"type": "google_search"}, {"type": "url_context"} ], "base_environment": { "type": "remote", "sources": [ { "type": "gcs", "source": "gs://your-agent-bucket-name/skills", "target": "/.agent/skills" } ], "network": { "allowlist": [ { "domain": "*" } ] } } } ``` ``` -------------------------------- ### List Cloud Run Services in Go Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-run-basics/references/client-library-usage.md Use the Go client library to list Cloud Run services. This example initializes the client, creates a request, and iterates through the services, printing their names. Ensure the necessary packages are imported and the client is properly closed. ```go package main import ( "context" "fmt" "log" run "cloud.google.com/go/run/apiv2" runpb "cloud.google.com/go/run/apiv2/runpb" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() client, err := run.NewServicesClient(ctx) if err != nil { // Log the error and exit if the client can't be created log.Fatalf("Failed to create Cloud Run Services client: %v", err) } defer client.Close() req := &runpb.ListServicesRequest{ Parent: "projects/my-project/locations/us-central1", // Remember to replace my-project } it := client.ListServices(ctx, req) fmt.Println("Cloud Run Services:") for { resp, err := it.Next() if err == iterator.Done { break // Finished iterating successfully } if err != nil { // Log the error and exit if iteration fails log.Fatalf("Error iterating services: %v", err) } fmt.Println(resp.GetName()) } } ``` -------------------------------- ### Python Cloud SQL Connector Usage Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-sql-basics/references/client-library-usage.md Example of using the Python Cloud SQL Connector to establish a database connection. This requires the connector to be installed and configured with your instance details. ```python from google.cloud.sql.connector import Connector connector = Connector() def getconn(): conn = connector.connect( "project:region:instance", "pg8000", user="my-user", password="my-password", db="my-db" ) return conn ``` -------------------------------- ### Storage Configuration Example Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-compute-classes.md Configures boot disk and local SSD storage within a PriorityRule, including disk type, size, CMEK, and local SSD interface. ```yaml storage: bootDisk: type: "pd-balanced" # pd-balanced (golden path), pd-ssd, hyperdisk-balanced sizeGb: 100 kmsKey: "projects/.../cryptoKeys/..." # Optional CMEK localSsd: count: 1 interface: "NVME" ``` -------------------------------- ### Create Vertical Pod Autoscaler (VPA) in Recommendation Mode Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-scaling.md Create a VPA configured to only provide resource recommendations without applying them automatically. This is the safest mode to start with. ```yaml apiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: -vpa spec: targetRef: apiVersion: apps/v1 kind: Deployment name: updatePolicy: updateMode: "Off" ``` -------------------------------- ### Get Agent Configuration Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-agents-api/SKILL.md Use this curl command to retrieve the configuration metadata, tools, and environment setup of an existing custom agent. Replace placeholders with your project, location, and agent IDs. ```bash curl -X GET "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/global/agents/my-custom-agent" \ -H "Authorization: Bearer ${ACCESS_TOKEN}" \ -H "Content-Type: application/json" ``` -------------------------------- ### List Cloud Run Services in Node.js (TypeScript) Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-run-basics/references/client-library-usage.md Use the Node.js client library to list Cloud Run services. This example demonstrates asynchronous fetching of services. Ensure the @google-cloud/run package is installed. ```typescript import {ServicesClient} from '@google-cloud/run'; const client = new ServicesClient(); const [services] = await client.listServices({ parent: 'projects/my-project/locations/us-central1', }); ``` -------------------------------- ### List Pods using Kubernetes Client Library (Go) Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/client-library-usage.md Builds Kubernetes client configuration and lists pods in all namespaces. Requires `kubeconfig` to be set. ```go import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" ) config, _ := clientcmd.BuildConfigFromFlags("", kubeconfig) clientset, _ := kubernetes.NewForConfig(config) pods, _ := clientset.CoreV1().Pods("").List( context.TODO, metav1.ListOptions{}) ``` -------------------------------- ### Install Cloud SQL Python Connector for PostgreSQL Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-sql-basics/references/client-library-usage.md Install the Python connector for PostgreSQL instances using pip. Ensure you have the necessary database driver installed. ```bash pip install "cloud-sql-python-connector[pg8000]" ``` -------------------------------- ### Install Firebase Agent Skills Source: https://github.com/google/skills/blob/main/skills/cloud/firebase-basics/SKILL.md Ensure the full set of Firebase agent skills is installed or updated to avoid using outdated patterns. This command also updates existing installations. ```bash npx -y skills add firebase/agent-skills -y ``` -------------------------------- ### Create Agent with Cloud Storage Mounted Resources Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-agents-api/SKILL.md Use a POST request to create a new agent. This example demonstrates mounting files and skills from a Google Cloud Storage bucket and configuring tools and system instructions. Creating an agent is a Long-Running Operation. ```bash curl -X POST "https://aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents" \ -H "Authorization: Bearer ${ACCESS_TOKEN}" \ -H "Content-Type: application/json; charset=utf-8" \ -d '{ "id": "my-custom-agent", "base_agent": "antigravity-preview-05-2026", "description": "A professional agent configured with remote tools and mounted Cloud Storage directories.", "system_instruction": "You are a helpful, domain-expert assistant.", "tools": [ {"type": "code_execution"}, {"type": "filesystem"}, {"type": "google_search"}, {"type": "url_context"} ], "base_environment": { "type": "remote", "sources": [ { "type": "gcs", "source": "gs://your-agent-bucket-name/skills", "target": "/.agent/skills" } ], "network": { "allowlist": [ { "domain": "*" } ] } } }' ``` -------------------------------- ### Check gcloud CLI Installation Source: https://github.com/google/skills/blob/main/skills/cloud/google-cloud-recipe-onboarding/SKILL.md Verifies if the gcloud CLI binary is installed and accessible on the host system. ```bash which gcloud ``` -------------------------------- ### Install MPI Operator Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-batch-hpc.md Install the MPI Operator using kubectl to manage MPI-based HPC applications on Kubernetes. ```bash kubectl apply -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/v2beta1/mpi-operator.yaml ``` -------------------------------- ### List All Skills Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-skill-registry/references/query-skills.md Execute this command to list all skills available in the registry for the configured project and location. No specific flags are required. ```bash python3 scripts/skill_registry_ops.py list ``` -------------------------------- ### List Pods using Kubernetes Client Library (Python) Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/client-library-usage.md Loads Kubernetes configuration and lists pods with their IPs across all namespaces. Requires `~/.kube/config` to be set up. ```python from kubernetes import client, config config.load_kube_config() # Loads from ~/.kube/config v1 = client.CoreV1Api() print("Listing pods with their IPs:") ret = v1.list_pod_for_all_namespaces(watch=False) for i in ret.items: print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name)) ``` -------------------------------- ### Install AlloyDB Python Connector and SQLAlchemy Source: https://github.com/google/skills/blob/main/skills/cloud/alloydb-basics/references/client-library-usage.md Install the necessary Python packages for the AlloyDB connector and SQLAlchemy for database interaction. ```bash pip install "google-cloud-alloydb-connector[pg8000]" sqlalchemy ``` -------------------------------- ### Install BigQuery DataFrames (Python) Source: https://github.com/google/skills/blob/main/skills/cloud/bigquery-basics/references/client-library-usage.md Install the bigframes library for Python using pip. This library provides a pandas-like API for BigQuery. ```bash pip install --upgrade bigframes ``` -------------------------------- ### Describe VPA Recommendations Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-scaling.md Use this command to view the resource recommendations provided by the Vertical Pod Autoscaler (VPA). This helps in understanding current resource usage and potential optimizations. ```bash kubectl describe vpa ``` -------------------------------- ### Go Usage Example with AlloyDB Driver Source: https://github.com/google/skills/blob/main/skills/cloud/alloydb-basics/references/client-library-usage.md Connect to an AlloyDB instance using the custom AlloyDB Go driver and execute a simple query. Ensure the driver is registered before opening the database connection. ```go package main import ( "database/sql" "fmt" "log" "cloud.google.com/go/alloydbconn/driver/pgxv5" ) func main() { // Register the AlloyDB driver with the name "alloydb" // Uses Private IP by default. See Network Options below for details. cleanup, err := pgxv5.RegisterDriver("alloydb") if err != nil { log.Fatal(err) } defer cleanup() // Instance URI format: // projects/PROJECT/locations/REGION/clusters/CLUSTER/instances/INSTANCE db, err := sql.Open("alloydb", fmt.Sprintf( "host=%s user=%s password=%s dbname=%s sslmode=disable", "projects/my-project/locations/us-central1/clusters/my-cluster/instances/my-instance", "my-user", "my-password", "my-db", )) if err != nil { log.Fatal(err) } defer db.Close() var greeting string if err := db.QueryRow("SELECT 'Hello, AlloyDB!'").Scan(&greeting); err != nil { log.Fatal(err) } fmt.Println(greeting) } ``` -------------------------------- ### Initialize Agent Platform Client Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-eval-flywheel/SKILL.md Initializes the Agent Platform client with project and location. Ensure you replace 'PROJECT_ID' and 'LOCATION' with your actual values. ```python import agentplatform from agentplatform import types from google.genai import types as genai_types import pandas as pd # Initialize client client = agentplatform.Client(project="PROJECT_ID", location="LOCATION") ``` -------------------------------- ### Initialize Client with Environment Variables (Python) Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-interactions-api/SKILL.md Initialize the Gemini API client using environment variables for automatic configuration. Ensure GOOGLE_GENAI_USE_ENTERPRISE is set to true. ```bash export GOOGLE_GENAI_USE_ENTERPRISE=true export GOOGLE_CLOUD_PROJECT="your-project-id" export GOOGLE_CLOUD_LOCATION="global" ``` ```python from google import genai client = genai.Client() ``` -------------------------------- ### Structured Output Generation with AI.GENERATE Source: https://github.com/google/skills/blob/main/skills/cloud/bigquery-basics/references/bigquery_ai_generate.md This example demonstrates how to extract specific information into a structured format using the `output_schema` argument. The output fields will match the defined schema. ```sql SELECT AI.GENERATE( 'Extract the date and amount from this invoice: ' || invoice_text, output_schema => 'date DATE, amount FLOAT64' ) as extracted_data FROM `dataset.invoices`; ``` -------------------------------- ### Upload Skill from Folder Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-skill-registry/references/manage-skills.md Use this command to upload a new skill by providing the path to its local folder. Ensure all required flags like skill ID, display name, description, and folder path are included. ```bash python3 scripts/skill_registry_ops.py upload \ --skill-id "my-sample-skill" \ --display-name "My Sample Skill" \ --description "A test skill uploaded via script." \ --folder "/path/to/skill/folder" ``` -------------------------------- ### Generate Video with Veo Model Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-api/references/media_generation.md Generate video content using the Veo model. This example demonstrates setting up video generation with an optional initial image and polling for the operation's completion. Note that Veo usage can be costly. ```python import time from google import genai from google.genai import types from PIL import Image client = genai.Client() image = Image.open("image.png") # Optional initial image # Video generation is an async operation operation = client.models.generate_videos( model="veo-3.1-fast-generate-001", prompt="a cat reading a book", image=image, config=types.GenerateVideosConfig( person_generation="dont_allow", aspect_ratio="16:9", number_of_videos=1, duration_seconds=5, output_gcs_uri="gs://your-bucket/your-prefix", ), ) # Poll for completion while not operation.done: time.sleep(20) operation = client.operations.get(operation) if operation.response: print(operation.result.generated_videos[0].video.uri) ``` -------------------------------- ### Install Cloud SQL Node.js Connector Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-sql-basics/references/client-library-usage.md Install the Cloud SQL Node.js connector package using npm. This is required for Node.js applications to connect to Cloud SQL. ```bash npm install @google-cloud/cloud-sql-connector ``` -------------------------------- ### Set up Application Default Credentials (ADC) Source: https://github.com/google/skills/blob/main/skills/cloud/gcloud/SKILL.md Authenticate code calls from local applications or SDK libraries. Use `--no-browser` for headless environments. ```bash gcloud auth application-default login --no-browser ``` -------------------------------- ### Start Cloud SQL Auth Proxy Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-sql-basics/SKILL.md Starts the Cloud SQL Auth Proxy in a separate terminal. This proxy facilitates secure connections to your Cloud SQL instance. ```bash ./cloud-sql-proxy INSTANCE_CONNECTION_NAME ``` -------------------------------- ### Single-Turn Interaction Response Example Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-interactions-api/SKILL.md Example JSON response from a single-turn Gemini Interactions API call. It includes the interaction ID, conversation steps, and usage statistics. ```json { "id": "your-interaction-id", "status": "completed", "steps": [ { "role": "model", "content": [ { "type": "text", "text": "Serverless computing is a cloud execution model where the cloud provider dynamically manages the allocation and provisioning of servers, charging customers based on actual usage rather than pre-purchased capacity." } ] } ], "usage": { "total_tokens": 24751, "total_input_tokens": 23894, "total_output_tokens": 857 }, "created": "2026-05-08T10:44:43Z", "updated": "2026-05-08T10:44:43Z", "environment_id": "your-environment-id", "object": "interaction" } ``` -------------------------------- ### Initializing Gemini Client for Agent Platform Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-migrate-from-ai-studio/SKILL.md Initialize the Google GenAI client. The client automatically uses the enterprise environment flag. ```python from google import genai # The client automatically picks up the GOOGLE_GENAI_USE_ENTERPRISE=TRUE environment flag client = genai.Client() response = client.models.generate_content( model='gemini-3-flash-preview', contents='Hello world!', ) print(response.text) ``` -------------------------------- ### Instruction (Prompt/Completion) JSONL Format Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-tuning/references/data_prep.md Suitable for base models or simple completion tasks. Provide a 'prompt' and its corresponding 'completion'. ```json { "prompt": "Summarize the following text: [TEXTКак]", "completion": "[SUMMARY]" } ``` -------------------------------- ### Python Example for OpenMaaS Embeddings Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md Example of using the OpenAI SDK to generate embeddings for text using OpenMaaS embedding models. Ensure the Model ID is verified on Model Garden. ```python # Verify specific Embedding Model ID on Model Garden (e.g., intfloat/multilingual-e5-small) response = client.embeddings.create( model="intfloat/multilingual-e5-large-maas", input="The quick brown fox jumps over the lazy dog", ) print(response.data[0].embedding) ``` -------------------------------- ### Create a Cloud SQL Instance Source: https://github.com/google/skills/blob/main/skills/cloud/cloud-sql-basics/references/cli-usage.md Use this command to provision a new Cloud SQL instance with specified database version, machine tier, and region. The --quiet flag suppresses interactive prompts. ```bash gcloud sql instances create my-instance --database-version=MYSQL_8_0 \ --tier=db-f1-micro --region=us-central1 \ --quiet ``` -------------------------------- ### List Deployment Configuration for a Specific Model Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-deploy/SKILL.md Check the supported machine types and accelerators for a specific model, such as google/gemma3@gemma-3-27b-it. ```bash gcloud ai model-garden models list-deployment-config \ --model="google/gemma3@gemma-3-27b-it" ``` -------------------------------- ### Initialize Gemini Client with Environment Variables (Python) Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-api/SKILL.md Initialize the Gemini client in Python. It automatically picks up environment variables for authentication and configuration. ```python from google import genai client = genai.Client() ``` -------------------------------- ### Initializing ADK Agent with Tools Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-migrate-from-ai-studio/SKILL.md Initialize an Agent Development Kit (ADK) agent, defining its model, name, description, instructions, and available tools. ```python from google.adk.agents.llm_agent import Agent def get_current_time(city: str) -> dict: """Returns the current time in a specified city.""" return {"status": "success", "city": city, "time": "10:30 AM"} root_agent = Agent( model='gemini-3-flash-preview', name='root_agent', description="Tells the current time in a specified city.", instruction="You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.", tools=[get_current_time], ) ``` -------------------------------- ### Initialize Gemini Client with Hard-coded Parameters (Python) Source: https://github.com/google/skills/blob/main/skills/cloud/gemini-api/SKILL.md Initialize the Gemini client in Python by explicitly providing enterprise, project, and location parameters. ```python from google import genai client = genai.Client( enterprise=True, project="your-project-id", location="global", ) ``` -------------------------------- ### Get AlloyDB Cluster Info Source: https://github.com/google/skills/blob/main/skills/cloud/alloydb-basics/references/cli-usage.md Use this command to retrieve detailed information about a specific AlloyDB cluster. ```bash gcloud alloydb clusters describe CLUSTER_ID --region=REGION ``` -------------------------------- ### Update gcloud CLI Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-tuning/SKILL.md Updates the gcloud CLI to the latest version quietly. This command is used during environment setup. ```bash gcloud components update --quiet > /dev/null 2>&1 ``` -------------------------------- ### Get Node Resource Usage with kubectl Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/cli-reference.md Displays the CPU and memory usage of nodes in the cluster. This is a kubectl-only operation. ```bash kubectl top nodes ``` -------------------------------- ### Find Compatible Hardware for a Model Source: https://github.com/google/skills/blob/main/skills/cloud/gke-basics/references/gke-inference.md Find valid accelerator and server combinations for a specific AI/ML model. ```bash # Find valid accelerator/server combinations for a model gcloud container ai profiles list --model= --quiet # Example: what can run Gemma 2 9B? gcloud container ai profiles list --model=gemma-2-9b-it --quiet ``` -------------------------------- ### Python Usage Example with SQLAlchemy Source: https://github.com/google/skills/blob/main/skills/cloud/alloydb-basics/references/client-library-usage.md Connect to an AlloyDB instance using the Python connector and SQLAlchemy, executing a simple query. ```python import sqlalchemy from google.cloud.alloydbconnector import Connector INSTANCE_URI = "projects/MY_PROJECT/locations/MY_REGION/clusters/MY_CLUSTER/instances/MY_INSTANCE" with Connector() as connector: pool = sqlalchemy.create_engine( "postgresql+pg8000://", creator=lambda: connector.connect( INSTANCE_URI, "pg8000", user="my-user", password="my-password", db="my-db", ), ) with pool.connect() as conn: result = conn.execute(sqlalchemy.text("SELECT NOW()")).fetchone() print(result) ``` -------------------------------- ### Upload Skill from Zip File Source: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-skill-registry/references/manage-skills.md This command uploads a new skill using a .zip file. It requires the skill ID, display name, description, and the path to the .zip file. This is an alternative to uploading from a folder. ```bash python3 scripts/skill_registry_ops.py upload \ --skill-id "my-sample-skill" \ --display-name "My Sample Skill" \ --description "A test skill uploaded via script." \ --zip-file "/path/to/skill.zip" ```