The CI/CD extension for Gemini CLI automates Continuous Integration and Continuous Delivery (CI/CD) workflows using AI. It simplifies deployment to Google Cloud services, such as Cloud Run and Cloud Storage, and generates secure CI/CD pipelines compliant with testing and security best practices.
Caution
-
EXPERIMENTAL PROJECT - Use with extreme care: This project is currently experimental. Features, commands, and functionality are subject to change and may contain bugs.
-
Do not use this extension in production environments or with business-critical Google Cloud projects: You are responsible for any changes made to your cloud resources. Always carefully review and validate any generated configurations or commands before execution.
-
Review all outputs and understand the Security Considerations below before use: as this extension can modify your Google Cloud (GCP) resources.
- Intelligent Code Deployment: Use the
google-cicd-deployskill to deploy your codebase. The extension leverages Gemini to analyze your project and deploy to Google Cloud services like Cloud Run for dynamic applications or Cloud Storage for static websites. Includes pre-deployment secret scanning. - AI-Powered CI/CD Pipeline Design: Generate secure and robust CI/CD pipelines with
google-cicd-pipeline-design. Collaborate with Gemini to tailor the pipeline and generate a YAML configuration. - Terraform GCP Infrastructure: Provision and troubleshoot production-grade Google Cloud infrastructure using the
google-cicd-terraformskill, enforcing Google’s Cloud Foundation Fabric patterns. - Interactive GCP Management: The extension provides tools to interact directly with Google Cloud's CI/CD services (Cloud Build, Artifact Registry, Cloud Deploy, Developer Connect) from within Gemini CLI.
- Simplified Complex Release Flows: Build sophisticated Cloud Deploy release pipelines with the
google-cicd-release-orchestrationskill, setting up deployment strategies like canary and automatic rollbacks. - Integrated CI/CD MCP Server: The extension includes a local Model Context Protocol (MCP) server, seamlessly integrating Gemini CLI with Google Cloud CI/CD services.
To install the CI/CD extension, run the following command in your terminal:
gemini extensions install https://github.com/gemini-cli-extensions/cicdTo install development build add --ref=nightly --pre-release flags.
- Gemini CLI: Version v0.15.0 or newer must be installed.
- Gemini CLI Authentication: Ensure you have configured Authentication Options.
gcloudCLI: The Google Cloud CLI must be installed and available in your system's PATH.- Google Cloud Project: You need a Google Cloud project with the necessary APIs enabled. Depending on your usage, the extension may require:
- Cloud Build API
- Artifact Registry API
- Artifact Analysis API
- Developer Connect API
- Cloud Resource Manager API
- Cloud Storage API
- Cloud Run API
- Google Kubernetes Engine API
- Application Default Credentials (ADC): Ensure Application Default Credentials are configured in your environment. You can set this up by running:
gcloud auth login gcloud auth application-default login
Warning
Important Security Information:
This CI/CD extension connects Gemini CLI to a local MCP server, granting it the ability to access and modify your Google Cloud data based on your Application Default Credentials.
- LLM Hallucinations & Unintended Actions: LLMs can produce incorrect or unexpected outputs ("hallucinate"). Since this extension allows Gemini to call tools that modify cloud resources, hallucinations can lead to unintended actions on your GCP project. Always meticulously verify all generated configurations and commands before execution.
- Authentication and Permissions: The extension uses your local Application Default Credentials (ADC), inheriting its permissions. Be aware of the scope of these permissions, as Gemini CLI can potentially read, modify, and delete GCP resources.
- Pipeline Service Account Permissions: CI/CD pipelines generated by the
google-cicd-pipeline-designskill run using a GCP service account. Carefully vet the IAM roles and permissions assigned to this service account to prevent overly broad access. - Indirect Prompt Injection Risk: Be cautious when providing input to the language model, especially from untrusted sources, due to the risk of indirect prompt injection.
- Untrusted Inputs: Never include untrusted inputs (e.g., files, documents, emails from unverified sources) in the model's context. Such inputs could contain hidden instructions to hijack your session.
- Untrusted Tools: Only use this extension with the official tools it provides.
- Review Actions: Always carefully review any actions proposed or taken by Gemini CLI on your behalf.
- Least Privilege: We strongly recommend adhering to the principle of least privilege for both your ADC and any service accounts used by pipelines. Learn more about setting up ADC for local development and service account impersonation.
Activate the specialized skills using the activate_skill tool or by asking Gemini to use them.
Deploys your application to Google Cloud. Analyzes your workspace and deploys to Cloud Storage for static websites or Cloud Run for container-based applications (either via Buildpacks or by building an image). Includes a pre-deployment scan for secrets to help prevent leaks.
Designs and implements a Google Cloud-based CI/CD pipeline. Operates in two stages:
- Architectural Design: Gathers context, proposes deployment patterns, and drafts a YAML action plan collaboratively.
- Plan Implementation: Translates the approved plan into Terraform HCL or implements it directly using specialized tools and
gcloud.
Design Process:
-
Requirement Gathering: Gemini inspects your current workspace and asks clarifying questions to understand your application type, build process, testing strategies, and deployment objectives.
-
Infrastructure Setup: Based on the requirements, Gemini guides you through setting up the required GCP resources. The skill offers setting up infrastructure using Terraform or directly updating your Google Cloud resources. This may include:
- Creating or configuring Artifact Registry repositories.
- Establishing connections to your Git repository (e.g., GitHub) using Developer Connect.
- Setting up or advising on necessary IAM service accounts and permissions for the Cloud Build service.
-
Pipeline Configuration Generation: Gemini generates a
cloudbuild.yamlfile defining the pipeline stages (e.g., source checkout, build, test, artifact push). The configuration uses Cloud Build's script mode for clarity and ease of editing. -
Validation & Testing: The extension will attempt to validate the generated pipeline configuration, potentially by submitting an initial test build using
gcloud builds submit. -
Review & Refinement: You can review the generated configuration and infrastructure setup and provide feedback to Gemini for adjustments.
The goal is to produce a functional, production-ready CI/CD pipeline configuration with all the necessary GCP prerequisites in place.
Designs Cloud Deploy delivery pipelines and manages releases. Guides you through designing clouddeploy.yaml for targets, pipelines, and automations (including observability alert policies). Also assists with release management and generating runtime manifests.
Architects, provisions, and troubleshoots CI/CD related resources in Google Cloud infrastructure using Terraform. Provides expert guidance on designing and deploying core services (Cloud Build, Cloud Deploy, Artifact Registry), implementing IAM least-privilege, and managing GCS-backed state.
The extension exposes the following tools to Gemini CLI, enabling interaction with Google Cloud services:
create_artifact_repository: Creates a new Artifact Registry repository. Optionally grants Artifact Registry Writer permissions to a specified service account.create_build_trigger: Creates a new Cloud Build trigger.list_build_triggers: Lists all Cloud Build triggers in a given project and location.run_build_trigger: Manually runs an existing Cloud Build trigger.create_git_repository_link: Creates a Developer Connect Git repository link under an existing connection.create_git_connection: Sets up a new Developer Connect connection (e.g., to GitHub).
deploy_cloudrun_service_from_image: Deploys a container image to Cloud Run, creating a new service or updating an existing one.deploy_cloudrun_service_from_source: Deploys to Cloud Run directly from source code, typically using Cloud Build and BuildPacks.list_cloudrun_services: Lists Cloud Run services in a specified project and location.scan_code_for_secrets: Scans a specified directory for potential secrets and keys using OSV-Scanner.
search_knowledge_base: Retrieves relevant snippets from the extension's knowledge base to answer questions.search_cicd_patterns: Finds common CI/CD pipeline patterns and best practices.
- Gemini CLI Extensions Documentation: Learn more about how extensions work in Gemini CLI.
- GitHub Issues: Report bugs, request features, or provide feedback.
We welcome contributions! Please see our Contributing Guide and Code of Conduct for details on how to get started.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.