Sitemap
Google Cloud - Community

A collection of technical articles and blogs published or curated by Google Cloud Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Gemini CLI Tutorial Series : Part 12 : Gemini CLI GitHub Actions

11 min readSep 12, 2025

--

Thank you for reading! If you found this series helpful, please consider taking this 2-minute survey. Your feedback directly helps me create more tutorials for the developer community.

Gemini CLI Tutorial Series:

Part 1 : Installation and Getting Started
Part 2 : Gemini CLI Command line options
Part 3 : Configuration settings via settings.json and .env files
Part 4 : Built-in Tools
Part 5: Using Github MCP Server
Part 6: More MCP Servers : Firebase, Google Workspace, Google Gen AI Media Services and MCP Toolbox for Databases
Part 7: Custom slash commands
Part 8: Building your own MCP Server
Part 9: Understanding Context, Memory and Conversational Branching
Part 10: Gemini CLI and VS Code Integration
Part 11: Gemini CLI Extensions
Part 12: Gemini CLI GitHub Actions (this post)
Part 13 : Gemini CLI Observability
Part 14: Gemini CLI extensions for Google Data Cloud

➡️ Codelab : Hands-on Gemini CLI

Welcome back to the Gemini CLI Tutorial Series! So far, our focus has been on making Gemini CLI an personal pair programmer in your terminal. But what if we could elevate it from a solo assistant to a collaborative, autonomous teammate that lives right inside your project’s repository?

That’s exactly what we’re going to do today. We are taking Gemini CLI out of the local terminal and into the cloud with Gemini CLI GitHub Actions. This integration transforms the CLI from a tool you command into an AI agent that works alongside your entire team, automating the routine tasks that consume valuable development time.

Think about having an assistant that can triage your GitHub Issues or may review your Pull Request (PR)? That’s where we are going today.

Before we start: Update your Gemini CLI version

If it’s been a while that you used Gemini CLI, make sure that you are running the latest version of the tool. Here’s a handy command to upgrade your Gemini CLI to the latest version (stable).

npm install -g @google/gemini-cli@latest

Do a gemini -v command and ensure that you are seeing atleast 0.4.0 or above.

What we will cover?

To really see the power of this, we’re going to build a project from scratch, put it on GitHub, and then onboard Gemini CLI into our repository via the Gemini CLI GitHub Actions installation, which will help us manage and improve it.

We have do the following:

  • Code a simple project: ASCII Art Generator and push that into GitHub.
  • Understand how to setup Gemini CLI GitHub Actions for your this project.
  • Look at key Gemini CLI GitHub Actions features: Automating Issue Triage and Pull Request Reviews, along with on-demand request to the @gemini-cli Assistant.

Let’s go !

Vibe Coding Our Project: An ASCII Art Generator

First, we need a project to work on. Let’s use the local Gemini CLI to quickly “vibe code” a fun web application. We’ll create a simple Flask app that generates ASCII art from text using different fonts.

Open your terminal, create a new project directory, and launch Gemini CLI.

mkdir ascii-art-generator && cd ascii-art-generator
gemini

Now, let’s ask Gemini to build the application piece by piece.

Prompt 1: Create the Flask application.

Create a simple Python Flask web application in a file named app.py. It should have a single route / that renders an HTML template named index.html.

Prompt 2: Create the HTML template.

Now, create the templates/index.html file. It should contain a simple form with a text input for the user's text, a dropdown select menu for the font, and a submit button.

Prompt 3: Add the application logic.

Update app.py to handle the form submission. It should take the text and selected font, use an external library to generate ASCII art, and pass the result back to the index.html template to be displayed.

Prompt 4: Create the requirements file.

Finally, create a requirements.txt file for this application. It will need Flask and pyfiglet, which is a library for generating ASCII art.

After these steps, you’ll have a complete, working Flask application. Your project directory should look like this:

ascii-art-generator/
├── app.py
├── requirements.txt
└── templates/
└── index.html

Feel free to test it locally if you’d like! Now, let’s get this project onto GitHub.

A sample run on my local machine is shown below:

Press enter or click to view image in full size

Setting Up the GitHub Repository

In an earlier part of the series, we saw GitHub MCP Server support in Gemini CLI. I have the GitHub MCP Server setup in my Gemini CLI installation:

Press enter or click to view image in full size

So I can directly take advantage of that to create a local Git repository, add/commit the files there and then push the changes to a new repository created on GitHub.

I took the help of Gemini CLI to first created a .gitignore file for the project and then asked Gemini CLI to push the files into a new repository on GitHub. The entire conversation is shown below:

──────────────────────────────────────────────╮
│ > create a .gitignore file for this project │
╰───────────────────────────────────────────────╯

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ WriteFile Writing to .gitignore │
│ │
│ 1 # Virtual Environment │
│ 2 venv/ │
│ 3 __pycache__/ │
│ 4 │
│ 5 # Byte-compiled / optimized / DLL files │
│ 6 *.pyc │
│ 7 *.pyo │
│ 8 *.pyd │
│ 9 │
│ 10 # Distribution / packaging │
│ 11 .Python │
│ 12 build/ │
│ 13 develop-eggs/ │
│ 14 dist/ │
│ 15 downloads/ │
│ 16 eggs/ │
│ 17 .eggs/ │
│ 18 lib/ │
│ 19 lib64/ │
│ 20 parts/ │
│ 21 sdist/ │
│ 22 var/ │
│ 23 wheels/ │
│ 24 pip-wheel-metadata/ │
│ 25 share/python-wheels/ │
│ 26 *.egg-info/ │
│ 27 .installed.cfg │
│ 28 *.egg │
│ 29 MANIFEST │
│ 30 │
│ 31 # Flask stuff │
│ 32 instance/ │
│ 33 .webassets-cache │
│ 34 │
│ 35 # Environment variables │
│ 36 .env │
│ 37 .venv │
│ 38 env/ │
│ 39 venv/ │
│ 40 ENV/ │
│ 41 env.bak/ │
│ 42 venv.bak/ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I've created a .gitignore file for the project.

╭───────────────────────────────────────────────────────────────────────────────────╮
│ > Push these changes to a new repository named my-ascii-art-generator in Github │
╰───────────────────────────────────────────────────────────────────────────────────╯

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ get_me (github MCP Server) {} │
│ │
│ {"login":"rominirani","id":1614870,"profile_url":"https://github.com/rominirani","avatar_url":"https://avatars.g │
│ ithubusercontent.com/u/1614870?v=4","details":{"name":"Romin │
│ Irani","location":"Mumbai","hireable":true,"bio":"Developer Advocate, Google │
│ Cloud","public_repos":123,"public_gists":112,"followers":252,"following":0,"created_at":"2012-04-05T09:29:32Z"," │
│ updated_at":"2025-07-29T08:49:22Z","private_gists":1,"total_private_repos":5,"owned_private_repos":4}} │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ Great, your GitHub username is rominirani.

Now, I will create a new repository named my-ascii-art-generator under your account.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ create_repository (github MCP Server) {"name":"my-ascii-art-generator","description":"A simple ASCII art generator web ap… │
│ │
│ {"url":"https://github.com/rominirani/my-ascii-art-generator"} │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I've created the repository. Now I will initialize a local git repository and push the files.

I will run the following commands:
1. git init -b main to initialize the repository with main as the default branch.
2. git add . to stage all the files.
3. git commit -m "Initial commit" to commit the files.
4. git remote add origin https://github.com/rominirani/my-ascii-art-generator.git to add the remote origin.
5. git push -u origin main to push the files to GitHub.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell git init -b main && git add . && git commit -m "Initial commit" && git remote add origin https://github.com/rominir… │
│ │
│ Initialized empty Git repository in /Users/romin/gemini-cli-projects/ascii-art-generator/.git/ │
│ [main (root-commit) 03884e1] Initial commit │
│ 4 files changed, 85 insertions(+) │
│ create mode 100644 .gitignore │
│ create mode 100644 app.py │
│ create mode 100644 requirements.txt │
│ create mode 100644 templates/index.html │
│ branch 'main' set up to track 'origin/main'. │
│ To https://github.com/rominirani/my-ascii-art-generator.git │
│ * [new branch] main -> main │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I've successfully pushed the files to the my-ascii-art-generator repository on your GitHub account.

If you are looking to not use Gemini CLI for this task, you would have to do a series of Git command as shown below:

git init
git add.
git commit -m "Initial commit: Create Flask ASCII art generator"
git branch -M main
git remote add origin <YOUR_REPOSITORY_URL>
git push -u origin main

Our project now has a home on GitHub, and we’re ready to hire Gemini CLI to join our team.

Press enter or click to view image in full size

Setting up Gemini CLI GitHub Actions to the Repository

The steps to install the Gemini CLI Github Actions into your repository are straightforward and it is made more easier via a convenient command /setup-github available inside of Gemini CLI itself. Let’s see the steps one by one.

Step 1: Get Your Gemini API Key

The GitHub Action needs a way to authenticate with Google’s services. The simplest method is with a Gemini API key.

  • Navigate to Google AI Studio.
  • Sign in with your Google account.
  • Click on Get API key and then issue one or use an existing API Key that you have.
  • Copy the generated key and keep it somewhere safe for the next step.

Step 2: Add the API Key to Your GitHub Secrets

To use the key securely in our workflow, we’ll add it as an encrypted secret to our GitHub repository.

  • Go to your my-ascii-art-generator repository on GitHub and click on the Settings tab.
  • In the left sidebar, navigate to Secrets and variables > Actions.
  • Click the New repository secret button.
  • Name the secret GEMINI_API_KEY.
  • Paste the API key you generated in the “Value” field.
  • Click Add secret.

Your repository now has secure access to the Gemini API.

Press enter or click to view image in full size

Step 3: The Magic /setup-github Command

This is where you can see the thoughtful folks behind Gemini CLI making the process easier than you can imagine.

The Gemini CLI includes a built-in command that will automatically create and configure the necessary workflow files for you.

/setup-github

This will download the 5 GitHub Actions workflows and ask for your permission as shown below:

Press enter or click to view image in full size

The CLI will now create a .github/workflows directory in your project and populate it with the pre-built YAML workflow files.

Press enter or click to view image in full size
Press enter or click to view image in full size

Step 4: Commit and Push

The setup command has created new files in your project. The final step is to commit them to your repository so GitHub Actions can see them. Either use the git commands given below or you can simply ask Gemini CLI to push the changes to the repository.

git add .github/
git commit -m "feat: Add Gemini CLI GitHub Actions"
git push

And that’s it! Gemini CLI is now fully onboarded and ready to get to work on our ASCII art project.

If you visit the GitHub repository, you should see the .github folder as shown below:

Press enter or click to view image in full size

Automate Issue Triaging

Its time to put Gemini CLI to some use with your repository.

One of the most time-consuming parts of maintaining a repository is managing new issues. Let’s automate it.

The first step here is to create an issue for your project. Go to your my-ascii-art-generator repository on GitHub and create a new issue.

  • Title: App crashes with invalid font name
  • Description: If a user somehow submits a font name that isn’t in the list, the pyfiglet library throws an error and the app crashes with a 500 error. We should add some error handling to catch this and display a friendly message instead. This is a pretty serious bug.
Press enter or click to view image in full size

Create the issue. You should see the following screen:

Press enter or click to view image in full size

You will find that behind the scenes, the issues: [opened] trigger in your new workflow file will fire, as shown below:

Press enter or click to view image in full size

After a minute or two, refresh the page or stay there for a while. You should see that Gemini CLI has automatically added labels to your issue without any human intervention.

Press enter or click to view image in full size

Automate Pull Request Reviews

Next, let’s accelerate our code review process. An AI-powered first pass can catch common mistakes and provide a useful summary, letting human reviewers focus on more complex architectural concerns.

We will be adding a small feature to our existing application and submitting a new pull request for the change.

The steps are given below:

  • In your local repository, create a new branch: git checkout -b add-new-font.
  • Open public/index.html and add a new font to the list of fonts that the use can chose from.
  • Commit the change and push the new branch to GitHub.
  • Open a new pull request for your change.
Press enter or click to view image in full size

Once the pull request is created, the workflow will trigger again. After a few moments, you’ll see a new comment on your PR from the gemini-cli bot. This comment will provide a concise summary of your changes.

Press enter or click to view image in full size

On-Demand Collaboration: Your @gemini-cli Assistant

What we have seen so far are automated workflows, but you can also collaborate with Gemini CLI on demand. Let’s go back to the pull request we just opened.

We can ask for a more detailed review. In the comment box on your pull request, type: @gemini-cli /review

The gemini-dispatch.yml workflow you installed is designed to listen for these mentions. When it sees one, it will spring into action. It might come back with feedback, suggesting a few more changes. For e.g. in my case, it gave me these additional notes:

Press enter or click to view image in full size

The documentation highlights other ways that you can invoke the Gemini CLI assistant on demand and which are listed below:

@gemini-cli explain this code change
@gemini-cli suggest improvements for this function
@gemini-cli help me debug this error
@gemini-cli write unit tests for this component

The Secure Way with Workload Identity Federation

Using a GEMINI_API_KEY is the simplest way to get started, and it's perfect for personal projects or initial experiments. However, in an enterprise or production environment, long-lived API keys can pose a security risk if they are accidentally exposed.

For these scenarios, the recommended and most secure authentication method is Workload Identity Federation (WIF). I would strongly recommend the following article by

.

Summary

You’ve successfully built a new application from scratch and promoted your Gemini CLI from a personal assistant to a full-fledged, autonomous member of your development team.

You are now equipped to build powerful, automated, and intelligent CI/CD pipelines.

Please consider leaving feedback

Thank you for reading! If you found this series helpful, please consider taking this 2-minute survey. Your feedback directly helps me create more tutorials for the developer community.

--

--

Google Cloud - Community
Google Cloud - Community

Published in Google Cloud - Community

A collection of technical articles and blogs published or curated by Google Cloud Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Romin Irani
Romin Irani

Written by Romin Irani

Developer Advocate @ Google. My passion is to help developers succeed. ¯\_(ツ)_/¯

Responses (5)