Skip to content

Latest commit

 

History

History
119 lines (86 loc) · 3.85 KB

File metadata and controls

119 lines (86 loc) · 3.85 KB

Configuring Gemini CLI Workflows

This guide covers how to customize and configure Gemini CLI workflows to meet your specific needs.

How to Configure Gemini CLI

Gemini CLI workflows are highly configurable. You can adjust their behavior by editing the corresponding .yml files in your repository.

Gemini CLI supports many settings that control how it operates. For a complete list, see the Gemini CLI documentation.

Key Settings

Conversation Length (maxSessionTurns)

This setting controls the maximum number of conversational turns (messages exchanged) allowed during a workflow run.

Default values by workflow:

Workflow Default maxSessionTurns
Issue Triage 25
Pull Request Review 20
Gemini CLI Assistant 50

How to override:

Add the following to your workflow YAML file to set a custom value:

with:
  settings: |-
    {
      "maxSessionTurns": 10
    }

Allowlist Tools (coreTools)

Allows you to specify a list of built-in tools that should be made available to the model. You can also use this to allowlist commands for shell tool.

Default: All tools available for use by Gemini CLI.

How to configure:

Add the following to your workflow YAML file to specify core tools:

with:
  settings: |-
    {
      "coreTools": [
        "read_file"
        "run_shell_command(echo)",
        "run_shell_command(gh label list)"
      ]
    }

MCP Servers (mcpServers)

Configures connections to one or more Model Context Protocol (MCP) servers for discovering and using custom tools. This allows you to extend Gemini CLI GitHub Action with additional capabilities.

Default: Empty

Example:

with:
  settings: |-
    {
      "mcpServers": {
        "github": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "-e",
            "GITHUB_PERSONAL_ACCESS_TOKEN",
            "ghcr.io/github/github-mcp-server"
          ],
          "env": {
            "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
          }
        }
      }
    }

Custom Context and Guidance (GEMINI.md)

To provide Gemini CLI with custom instructions—such as coding conventions, architectural patterns, or other guidance—add a GEMINI.md file to the root of your repository. Gemini CLI will use the content of this file to inform its responses.

GitHub Actions Workflow Settings

Setting Timeouts

You can control how long Gemini CLI runs by using either the timeout-minutes field in your workflow YAML, or by specifying a timeout in the settings input.

Required Permissions

Only users with the following roles can trigger the workflow:

  • Repository Owner (OWNER)
  • Repository Member (MEMBER)
  • Repository Collaborator (COLLABORATOR)