Configuration

GG uses a flexible configuration system that adapts to both project-specific and global needs. This allows teams to maintain consistent standards across projects while enabling customization when needed. The configuration is managed through a YAML file named .gg.yaml.

Configuration file location

GG implements a cascading configuration system that searches for settings in multiple locations, following a predictable precedence order.

1. Project-level configuration ./.gg.yaml

  • Located in the current working directory
  • Provides project-specific settings
  • Ideal for repository-specific commit conventions or team standards
  • Can be version-controlled with the project

2. Global configuration ~/.gg.yaml

  • Located in the user's home directory
  • Serves as a fallback when no project configuration exists
  • Perfect for personal preferences and default settings
  • Applies across all projects without their own configuration

Required fields

There are only two required fields in the config file: provider and model.

  • Name
    provider
    Description

    The AI provider to use. Must be "openai", "anthropic" or "ollama".
    Default: none

  • Name
    model
    Description

    The model to use. For example, "gpt-4o" or "claude-3-5-sonnet-20240620".
    Default: none

Optional fields

  • Name
    auto_commit
    Description

    When enabled, generates and applies a commit message immediately without user interaction or confirmation.
    Ideal for automated workflows, CI/CD pipelines, and AI agents where manual intervention is not desired or possible.
    Default: false

  • Name
    number_of_suggestions
    Description

    The number of suggestions to return.
    Default: 3

  • Name
    git
    Description

    Configuration for the git context.

  • Name
    prompt_templates
    Description

    Configuration for the prompt templates.

Git context

  • Name
    excluded_files
    Description

    The files to exclude from the git context. Default: ["package-lock.json", "yarn.lock", "go.sum", "Pipfile.lock", "Gemfile.lock", "pom.xml", "build.gradle", "composer.lock", "Cargo.lock", "Package.resolved", "stack.yaml.lock"]

  • Name
    excluded_directories
    Description

    The directories to exclude from the git context. Default: ["node_modules", "vendor", "dist", "build"]

  • Name
    excluded_file_extensions
    Description

    The file extensions to exclude from the git context. Default: ["png", "jpg", "jpeg", "gif", "ico", "svg", "pdf", "zip", "tar", "gz", "rar", "mp3", "wav", "ogg", "m4a", "mp4", "avi", "mov", "wmv", "exe", "dll", "so", "dylib", "bin", "jar", "war", "ear", "class", "pyc", "o", "a", "min.js", "min.css", "map", "pb.go", "sqlite", "db"]

Prompt templates

  • Name
    system
    Description

    The system prompt.

    system: |
      You are a commit message assistant.
      Generate only the commit message with no additional text or explanations.
    
  • Name
    context
    Description

    The context prompt. This is the prompt that will be used to generate the commit message.

    context: |
      Files changed:
      {status_short}
    
      Detailed changes:
      {diff_staged}
    
      Requirements for the commit message:
        - Commit message MUST be a single line
        - Commit message MUST be under 72 characters
        - Commit message MUST be in present tense
        - Commit message MUST NOT have a trailing period
        - Commit message MUST complete: "If applied, this commit will ..."
        - Commit message MUST be prefixed with a TYPE and REQUIRE terminal colon and space.
    
      Possible types:
        - feat (new feature for the user, not a new feature for build script)
        - fix (bug fix for the user, not a fix to a build script)
        - docs (changes to the documentation)
        - style (formatting, missing semi colons, etc; no production code change)
        - refactor (refactoring production code, eg. renaming a variable)
        - test (adding missing tests, refactoring tests; no production code change)
        - chore (updating grunt tasks etc; no production code change)
    
      Here are some examples of correct commit messages:
        - feat: add Polish language
        - feat: allow provided config object to extend other configs
        - feat: send an email to the customer when a product is shipped
        - docs: correct spelling of CHANGELOG
        - chore: drop support for Node 6
    

All configuration options with defaults values

All configuration options with defaults values

    provider: 
    model: 
    auto_commit: false
    number_of_suggestions: 3
    providers:
      openai:
        endpoint: https://api.openai.com/v1/chat/completions
      anthropic:
        endpoint: https://api.anthropic.com/v1/messages
      ollama:
        endpoint: http://localhost:11434/api/generate
    git:
      excluded_files:
        - "package-lock.json"
        - "yarn.lock"
        - "go.sum"
        - "Pipfile.lock"
        - "Gemfile.lock"
        - "pom.xml"
        - "build.gradle"
        - "composer.lock"
        - "Cargo.lock"
        - "Package.resolved"
        - "stack.yaml.lock"
      excluded_directories:
        - "node_modules"
        - "vendor"
        - "dist"
        - "build"
      excluded_file_extensions:
        - "png"
        - "jpg"
        - "jpeg"
        - "gif"
        - "ico"
        - "svg"
        - "pdf"
        - "zip"
        - "tar"
        - "gz"
        - "rar"
        - "mp3"
        - "wav"
        - "ogg"
        - "m4a"
        - "mp4"
        - "avi"
        - "mov"
        - "wmv"
        - "exe"
        - "dll"
        - "so"
        - "dylib"
        - "bin"
        - "jar"
        - "war"
        - "ear"
        - "class"
        - "pyc"
        - "o"
        - "a"
        - "min.js"
        - "min.css"
        - "map"
        - "pb.go"
        - "sqlite"
        - "db"
    prompt_templates:
      system: |
        You are a commit message assistant.
        Generate only the commit message with no additional text or explanations.
      context: |
        Files changed:
        {status_short}

        Detailed changes:
        {diff_staged}

        Requirements for the commit message:
          - Commit message MUST be a single line
          - Commit message MUST be under 72 characters
          - Commit message MUST be in present tense
          - Commit message MUST NOT have a trailing period
          - Commit message MUST complete: "If applied, this commit will ..."
          - Commit message MUST be prefixed with a TYPE and REQUIRE terminal colon and space.

        Possible types:
          - feat (new feature for the user, not a new feature for build script)
          - fix (bug fix for the user, not a fix to a build script)
          - docs (changes to the documentation)
          - style (formatting, missing semi colons, etc; no production code change)
          - refactor (refactoring production code, eg. renaming a variable)
          - test (adding missing tests, refactoring tests; no production code change)
          - chore (updating grunt tasks etc; no production code change)

        Here are some examples of correct commit messages:
          - feat: add Polish language
          - feat: allow provided config object to extend other configs
          - feat: send an email to the customer when a product is shipped
          - docs: correct spelling of CHANGELOG
          - chore: drop support for Node 6

Was this page helpful?