Skip to content

feat(gemini): enable Google Search and set gemini-3.1-pro-preview as default model#150

Merged
skulidropek merged 9 commits intoProverCoderAI:mainfrom
skulidropek:feat/gemini-default-settings
Mar 17, 2026
Merged

feat(gemini): enable Google Search and set gemini-3.1-pro-preview as default model#150
skulidropek merged 9 commits intoProverCoderAI:mainfrom
skulidropek:feat/gemini-default-settings

Conversation

@skulidropek
Copy link
Copy Markdown
Member

This PR configures Gemini CLI to automatically use Google Search and default to gemini-3.1-pro-preview when setting up authentication.

Changes:

  • Added model: "gemini-3.1-pro-preview" and web_search: true to the generated settings.json for both OAuth and API key authentication methods.
  • Extracted authGeminiStatus and authGeminiLogout into their own files to keep the main auth file compliant with ESLint max-lines limit.

@skulidropek
Copy link
Copy Markdown
Member Author

Официальный **Gemini CLI** (от Google) имеет схожую идеологию агентов с Codex, но использует другие форматы конфигурации и встроенные механизмы безопасности. Вместо `config.toml` настройки задаются через `settings.json`, а системные инструкции выносятся в отдельный файл.

Чтобы добиться от Gemini CLI такой же **бескомпромиссной автономии** с использованием последней модели **Gemini 3.1 Pro**, вам нужно перенести логику в два файла.

### 1. Основной конфиг (`.gemini/settings.json`)
Создайте этот файл в корне вашего проекта (или глобально в `~/.gemini/settings.json`). 

В экосистеме Gemini полная автономия без песочницы называется **YOLO Mode**. Вот точный эквивалент вашего конфига от Codex:

```json
{
  "model": {
    "name": "gemini-3.1-pro",
    "compressionThreshold": 0.90,
    "disableLoopDetection": true
  },
  "general": {
    "defaultApprovalMode": "auto_edit"
  },
  "yolo": true,
  "sandbox": {
    "enabled": false
  },
  "security": {
    "folderTrust": {
      "enabled": false
    }
  },
  "mcpServers": {
    "playwright": {
      "command": "docker-git-playwright-mcp",
      "args": []
    }
  }
}

Разбор соответствия параметров (Codex ➡️ Gemini):

  1. Контекст и память (model_context_window):
    Gemini 3.1 Pro имеет нативное контекстное окно от 1 до 2 миллионов токенов. Жесткие лимиты указывать не нужно. Ваш model_auto_compact_token_limit переводится как "compressionThreshold": 0.90 (агент сожмет историю чата, когда контекст заполнится на 90%).
  2. Логика и рассуждения (model_reasoning_effort = "xhigh"):
    Gemini 3.1 Pro использует глубокие цепочки рассуждений на уровне самой модели. Добавление параметра "disableLoopDetection": true заставляет агента не "сдаваться" при возникновении зацикленных ошибок в bash/playwright и пытаться решить их до победного конца (аналог максимального effort).
  3. Автономность (approval_policy = "never" и danger-full-access):
    • "yolo": true — отключает запросы [y/N] на выполнение shell-команд и модификацию файлов.
    • "sandbox": { "enabled": false } — отключает локальную изоляцию, давая полный доступ.
    • "folderTrust... false" — отключает стартовый диалог безопасности "Доверяете ли вы этой папке?", позволяя CI/CD скриптам стартовать мгновенно.
  4. Инструменты и Features (web_search = "live", shell_tool и т.д.):
    В Gemini CLI эти инструменты (Google Search Grounding, run_shell_command) встроены в ядро и работают по умолчанию, поэтому их не нужно явно перечислять.
  5. MCP Servers:
    Синтаксис полностью идентичен, просто переведен в формат JSON.

2. Настройка личности (GEMINI.md)

В Gemini CLI параметр personality = "pragmatic" не прописывается в конфиге. Вместо этого агент автоматически ищет файл GEMINI.md в корне вашего репозитория.

Создайте GEMINI.md и поместите туда вашу прагматичную установку. Это работает даже лучше, чем короткий тег в Codex:

# Role & Instructions
You are a highly pragmatic, autonomous AI software engineer. 
Focus strictly on implementation, executing terminal commands, and deploying tests via the Playwright MCP.
Do not ask for permission, do not write long explanations or greetings. 
Analyze the state, execute the plan directly, and output the result.

Как запускать

Поскольку вы прописали "yolo": true в настройках, вы можете запускать Gemini для docker-git как обычно:

gemini "напиши тесты и прогони их через playwright"

Альтернативный (серверный) вариант: если вы не хотите хардкодить yolo и отключение sandbox в файле проекта, вы можете передавать их через переменные окружения прямо в вашем Docker-контейнере:

export GEMINI_YOLO_MODE=true
export GEMINI_MODEL="gemini-3.1-pro"

@skulidropek
Copy link
Copy Markdown
Member Author

МОдель должна быть: gemini-3.1-pro-preview

@skulidropek
Copy link
Copy Markdown
Member Author

Значит надо попробовать ещё сделать алиас, который будет аавтоматически врубать yolo:

Судя по тексту документации, который вы предоставили, у меня для вас есть две новости: одна объясняет, почему ваш конфиг не работал, а вторая — как это всё-таки «починить».

### 1. Почему `"yolo": true` в JSON не работает
В разделе **`general.defaultApprovalMode`** прямо указано ограничение:

> «**YOLO mode** (auto-approve all actions) **can only be enabled via command line** (`--yolo` or `--approval-mode=yolo`).»

Это значит, что разработчики намеренно запретили включать полный YOLO-режим через файл настроек в целях безопасности. Параметра `"yolo": true` в корне или внутри `general` просто не существует в схеме `settings.json`.

---

### 2. Как сделать доступ «автоматическим» (3 способа)

Несмотря на ограничение выше, вы можете максимально приблизиться к автоматизации, используя другие параметры из этого же документа.

#### Способ А: Доверие к конкретным MCP-серверам (Ваш случай)
Так как у вас подключен MCP-сервер `playwright`, вам не обязательно включать глобальный YOLO. Вы можете разрешить всё именно для этого сервера. В документации к разделу `mcpServers` указан параметр **`trust`**:

* **`trust`** (boolean): «Trust this server and bypass all tool call confirmations.»

Обновите ваш конфиг так:
```json
"mcpServers": {
  "playwright": {
    "command": "docker-git-playwright-mcp",
    "args": [],
    "trust": true  // Это уберет запросы для инструментов Playwright
  }
}

Способ Б: Белый список команд (tools.allowed)

Если Gemini часто просит подтверждение на стандартные команды (git, npm, ls), добавьте их в массив tools.allowed. Согласно документу, они будут игнорировать диалоги подтверждения:

"tools": {
  "allowed": [
    "run_shell_command(git status)",
    "run_shell_command(ls)",
    "write_file"
  ]
}

Способ В: Shell Alias (Самый эффективный для YOLO)

Раз документация говорит, что YOLO включается только через аргументы командной строки, проще всего создать алиас в вашем .bashrc или .zshrc:

alias gemini='gemini --approval-mode yolo'

Теперь каждый раз, когда вы пишете gemini, режим будет включаться автоматически.


Важное про иерархию настроек

Обратите внимание на то, как CLI обрабатывает конфиги. Аргументы командной строки имеют самый высокий приоритет и перекрывают всё, что написано в файлах.

Что проверить в settings.json:

Убедитесь, что у вас НЕ стоят эти флаги, которые могут блокировать автоматизацию:

  • security.disableYoloMode: должен быть false (по умолчанию).
  • admin.secureModeEnabled: должен быть false.

Хотите, я помогу составить идеальный settings.json с учетом всех этих «скрытых» флагов доверия?


И на скок я понимаю yolo включается через --yolo 

https://raw.githubusercontent.com/google-gemini/gemini-cli/refs/heads/main/docs/reference/configuration.md

Gemini CLI configuration

Gemini CLI offers several ways to configure its behavior, including environment
variables, command-line arguments, and settings files. This document outlines
the different configuration methods and available settings.

Configuration layers

Configuration is applied in the following order of precedence (lower numbers are
overridden by higher numbers):

  1. Default values: Hardcoded defaults within the application.
  2. System defaults file: System-wide default settings that can be
    overridden by other settings files.
  3. User settings file: Global settings for the current user.
  4. Project settings file: Project-specific settings.
  5. System settings file: System-wide settings that override all other
    settings files.
  6. Environment variables: System-wide or session-specific variables,
    potentially loaded from .env files.
  7. Command-line arguments: Values passed when launching the CLI.

Settings files

Gemini CLI uses JSON settings files for persistent configuration. There are four
locations for these files:

Tip: JSON-aware editors can use autocomplete and validation by pointing to
the generated schema at schemas/settings.schema.json in this repository.
When working outside the repo, reference the hosted schema at
https://raw.githubusercontent.com/google-gemini/gemini-cli/main/schemas/settings.schema.json.

  • System defaults file:
    • Location: /etc/gemini-cli/system-defaults.json (Linux),
      C:\ProgramData\gemini-cli\system-defaults.json (Windows) or
      /Library/Application Support/GeminiCli/system-defaults.json (macOS). The
      path can be overridden using the GEMINI_CLI_SYSTEM_DEFAULTS_PATH
      environment variable.
    • Scope: Provides a base layer of system-wide default settings. These
      settings have the lowest precedence and are intended to be overridden by
      user, project, or system override settings.
  • User settings file:
    • Location: ~/.gemini/settings.json (where ~ is your home directory).
    • Scope: Applies to all Gemini CLI sessions for the current user. User
      settings override system defaults.
  • Project settings file:
    • Location: .gemini/settings.json within your project's root directory.
    • Scope: Applies only when running Gemini CLI from that specific project.
      Project settings override user settings and system defaults.
  • System settings file:
    • Location: /etc/gemini-cli/settings.json (Linux),
      C:\ProgramData\gemini-cli\settings.json (Windows) or
      /Library/Application Support/GeminiCli/settings.json (macOS). The path can
      be overridden using the GEMINI_CLI_SYSTEM_SETTINGS_PATH environment
      variable.
    • Scope: Applies to all Gemini CLI sessions on the system, for all users.
      System settings act as overrides, taking precedence over all other settings
      files. May be useful for system administrators at enterprises to have
      controls over users' Gemini CLI setups.

Note on environment variables in settings: String values within your
settings.json and gemini-extension.json files can reference environment
variables using either $VAR_NAME or ${VAR_NAME} syntax. These variables will
be automatically resolved when the settings are loaded. For example, if you have
an environment variable MY_API_TOKEN, you could use it in settings.json like
this: "apiKey": "$MY_API_TOKEN". Additionally, each extension can have its own
.env file in its directory, which will be loaded automatically.

Note for Enterprise Users: For guidance on deploying and managing Gemini
CLI in a corporate environment, please see the
Enterprise Configuration documentation.

The .gemini directory in your project

In addition to a project settings file, a project's .gemini directory can
contain other project-specific files related to Gemini CLI's operation, such as:

Available settings in settings.json

Settings are organized into categories. All settings should be placed within
their corresponding top-level category object in your settings.json file.

policyPaths

  • policyPaths (array):
    • Description: Additional policy files or directories to load.
    • Default: []
    • Requires restart: Yes

adminPolicyPaths

  • adminPolicyPaths (array):
    • Description: Additional admin policy files or directories to load.
    • Default: []
    • Requires restart: Yes

general

  • general.preferredEditor (string):

    • Description: The preferred editor to open files in.
    • Default: undefined
  • general.vimMode (boolean):

    • Description: Enable Vim keybindings
    • Default: false
  • general.defaultApprovalMode (enum):

    • Description: The default approval mode for tool execution. 'default'
      prompts for approval, 'auto_edit' auto-approves edit tools, and 'plan' is
      read-only mode. YOLO mode (auto-approve all actions) can only be enabled via
      command line (--yolo or --approval-mode=yolo).
    • Default: "default"
    • Values: "default", "auto_edit", "plan"
  • general.devtools (boolean):

    • Description: Enable DevTools inspector on launch.
    • Default: false
  • general.enableAutoUpdate (boolean):

    • Description: Enable automatic updates.
    • Default: true
  • general.enableAutoUpdateNotification (boolean):

    • Description: Enable update notification prompts.
    • Default: true
  • general.enableNotifications (boolean):

    • Description: Enable run-event notifications for action-required prompts
      and session completion. Currently macOS only.
    • Default: false
  • general.checkpointing.enabled (boolean):

    • Description: Enable session checkpointing for recovery
    • Default: false
    • Requires restart: Yes
  • general.plan.directory (string):

    • Description: The directory where planning artifacts are stored. If not
      specified, defaults to the system temporary directory.
    • Default: undefined
    • Requires restart: Yes
  • general.plan.modelRouting (boolean):

    • Description: Automatically switch between Pro and Flash models based on
      Plan Mode status. Uses Pro for the planning phase and Flash for the
      implementation phase.
    • Default: true
  • general.retryFetchErrors (boolean):

    • Description: Retry on "exception TypeError: fetch failed sending
      request" errors.
    • Default: true
  • general.maxAttempts (number):

    • Description: Maximum number of attempts for requests to the main chat
      model. Cannot exceed 10.
    • Default: 10
  • general.debugKeystrokeLogging (boolean):

    • Description: Enable debug logging of keystrokes to the console.
    • Default: false
  • general.sessionRetention.enabled (boolean):

    • Description: Enable automatic session cleanup
    • Default: true
  • general.sessionRetention.maxAge (string):

    • Description: Automatically delete chats older than this time period
      (e.g., "30d", "7d", "24h", "1w")
    • Default: "30d"
  • general.sessionRetention.maxCount (number):

    • Description: Alternative: Maximum number of sessions to keep (most
      recent)
    • Default: undefined
  • general.sessionRetention.minRetention (string):

    • Description: Minimum retention period (safety limit, defaults to "1d")
    • Default: "1d"

output

  • output.format (enum):
    • Description: The format of the CLI output. Can be text or json.
    • Default: "text"
    • Values: "text", "json"

ui

  • ui.theme (string):

    • Description: The color theme for the UI. See the CLI themes guide for
      available options.
    • Default: undefined
  • ui.autoThemeSwitching (boolean):

    • Description: Automatically switch between default light and dark themes
      based on terminal background color.
    • Default: true
  • ui.terminalBackgroundPollingInterval (number):

    • Description: Interval in seconds to poll the terminal background color.
    • Default: 60
  • ui.customThemes (object):

    • Description: Custom theme definitions.
    • Default: {}
  • ui.hideWindowTitle (boolean):

    • Description: Hide the window title bar
    • Default: false
    • Requires restart: Yes
  • ui.inlineThinkingMode (enum):

    • Description: Display model thinking inline: off or full.
    • Default: "off"
    • Values: "off", "full"
  • ui.showStatusInTitle (boolean):

    • Description: Show Gemini CLI model thoughts in the terminal window title
      during the working phase
    • Default: false
  • ui.dynamicWindowTitle (boolean):

    • Description: Update the terminal window title with current status icons
      (Ready: ◇, Action Required: ✋, Working: ✦)
    • Default: true
  • ui.showHomeDirectoryWarning (boolean):

    • Description: Show a warning when running Gemini CLI in the home
      directory.
    • Default: true
    • Requires restart: Yes
  • ui.showCompatibilityWarnings (boolean):

    • Description: Show warnings about terminal or OS compatibility issues.
    • Default: true
    • Requires restart: Yes
  • ui.hideTips (boolean):

    • Description: Hide helpful tips in the UI
    • Default: false
  • ui.escapePastedAtSymbols (boolean):

    • Description: When enabled, @ symbols in pasted text are escaped to
      prevent unintended @path expansion.
    • Default: false
  • ui.showShortcutsHint (boolean):

    • Description: Show the "? for shortcuts" hint above the input.
    • Default: true
  • ui.hideBanner (boolean):

    • Description: Hide the application banner
    • Default: false
  • ui.hideContextSummary (boolean):

    • Description: Hide the context summary (GEMINI.md, MCP servers) above the
      input.
    • Default: false
  • ui.footer.items (array):

    • Description: List of item IDs to display in the footer. Rendered in
      order
    • Default: undefined
  • ui.footer.showLabels (boolean):

    • Description: Display a second line above the footer items with
      descriptive headers (e.g., /model).
    • Default: true
  • ui.footer.hideCWD (boolean):

    • Description: Hide the current working directory in the footer.
    • Default: false
  • ui.footer.hideSandboxStatus (boolean):

    • Description: Hide the sandbox status indicator in the footer.
    • Default: false
  • ui.footer.hideModelInfo (boolean):

    • Description: Hide the model name and context usage in the footer.
    • Default: false
  • ui.footer.hideContextPercentage (boolean):

    • Description: Hides the context window usage percentage.
    • Default: true
  • ui.hideFooter (boolean):

    • Description: Hide the footer from the UI
    • Default: false
  • ui.showMemoryUsage (boolean):

    • Description: Display memory usage information in the UI
    • Default: false
  • ui.showLineNumbers (boolean):

    • Description: Show line numbers in the chat.
    • Default: true
  • ui.showCitations (boolean):

    • Description: Show citations for generated text in the chat.
    • Default: false
  • ui.showModelInfoInChat (boolean):

    • Description: Show the model name in the chat for each model turn.
    • Default: false
  • ui.showUserIdentity (boolean):

    • Description: Show the signed-in user's identity (e.g. email) in the UI.
    • Default: true
  • ui.useAlternateBuffer (boolean):

    • Description: Use an alternate screen buffer for the UI, preserving shell
      history.
    • Default: false
    • Requires restart: Yes
  • ui.useBackgroundColor (boolean):

    • Description: Whether to use background colors in the UI.
    • Default: true
  • ui.incrementalRendering (boolean):

    • Description: Enable incremental rendering for the UI. This option will
      reduce flickering but may cause rendering artifacts. Only supported when
      useAlternateBuffer is enabled.
    • Default: true
    • Requires restart: Yes
  • ui.showSpinner (boolean):

    • Description: Show the spinner during operations.
    • Default: true
  • ui.loadingPhrases (enum):

    • Description: What to show while the model is working: tips, witty
      comments, both, or nothing.
    • Default: "tips"
    • Values: "tips", "witty", "all", "off"
  • ui.errorVerbosity (enum):

    • Description: Controls whether recoverable errors are hidden (low) or
      fully shown (full).
    • Default: "low"
    • Values: "low", "full"
  • ui.customWittyPhrases (array):

    • Description: Custom witty phrases to display during loading. When
      provided, the CLI cycles through these instead of the defaults.
    • Default: []
  • ui.accessibility.enableLoadingPhrases (boolean):

    • Description: @deprecated Use ui.loadingPhrases instead. Enable loading
      phrases during operations.
    • Default: true
    • Requires restart: Yes
  • ui.accessibility.screenReader (boolean):

    • Description: Render output in plain-text to be more screen reader
      accessible
    • Default: false
    • Requires restart: Yes

ide

  • ide.enabled (boolean):

    • Description: Enable IDE integration mode.
    • Default: false
    • Requires restart: Yes
  • ide.hasSeenNudge (boolean):

    • Description: Whether the user has seen the IDE integration nudge.
    • Default: false

privacy

  • privacy.usageStatisticsEnabled (boolean):
    • Description: Enable collection of usage statistics
    • Default: true
    • Requires restart: Yes

billing

  • billing.overageStrategy (enum):
    • Description: How to handle quota exhaustion when AI credits are
      available. 'ask' prompts each time, 'always' automatically uses credits,
      'never' disables credit usage.
    • Default: "ask"
    • Values: "ask", "always", "never"

model

  • model.name (string):

    • Description: The Gemini model to use for conversations.
    • Default: undefined
  • model.maxSessionTurns (number):

    • Description: Maximum number of user/model/tool turns to keep in a
      session. -1 means unlimited.
    • Default: -1
  • model.summarizeToolOutput (object):

    • Description: Enables or disables summarization of tool output. Configure
      per-tool token budgets (for example {"run_shell_command": {"tokenBudget":
      2000}}). Currently only the run_shell_command tool supports summarization.
    • Default: undefined
  • model.compressionThreshold (number):

    • Description: The fraction of context usage at which to trigger context
      compression (e.g. 0.2, 0.3).
    • Default: 0.5
    • Requires restart: Yes
  • model.disableLoopDetection (boolean):

    • Description: Disable automatic detection and prevention of infinite
      loops.
    • Default: false
    • Requires restart: Yes
  • model.skipNextSpeakerCheck (boolean):

    • Description: Skip the next speaker check.
    • Default: true

modelConfigs

  • modelConfigs.aliases (object):

    • Description: Named presets for model configs. Can be used in place of a
      model name and can inherit from other aliases using an extends property.

    • Default:

      {
        "base": {
          "modelConfig": {
            "generateContentConfig": {
              "temperature": 0,
              "topP": 1
            }
          }
        },
        "chat-base": {
          "extends": "base",
          "modelConfig": {
            "generateContentConfig": {
              "thinkingConfig": {
                "includeThoughts": true
              },
              "temperature": 1,
              "topP": 0.95,
              "topK": 64
            }
          }
        },
        "chat-base-2.5": {
          "extends": "chat-base",
          "modelConfig": {
            "generateContentConfig": {
              "thinkingConfig": {
                "thinkingBudget": 8192
              }
            }
          }
        },
        "chat-base-3": {
          "extends": "chat-base",
          "modelConfig": {
            "generateContentConfig": {
              "thinkingConfig": {
                "thinkingLevel": "HIGH"
              }
            }
          }
        },
        "gemini-3-pro-preview": {
          "extends": "chat-base-3",
          "modelConfig": {
            "model": "gemini-3-pro-preview"
          }
        },
        "gemini-3-flash-preview": {
          "extends": "chat-base-3",
          "modelConfig": {
            "model": "gemini-3-flash-preview"
          }
        },
        "gemini-2.5-pro": {
          "extends": "chat-base-2.5",
          "modelConfig": {
            "model": "gemini-2.5-pro"
          }
        },
        "gemini-2.5-flash": {
          "extends": "chat-base-2.5",
          "modelConfig": {
            "model": "gemini-2.5-flash"
          }
        },
        "gemini-2.5-flash-lite": {
          "extends": "chat-base-2.5",
          "modelConfig": {
            "model": "gemini-2.5-flash-lite"
          }
        },
        "gemini-2.5-flash-base": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-2.5-flash"
          }
        },
        "gemini-3-flash-base": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-3-flash-preview"
          }
        },
        "classifier": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-2.5-flash-lite",
            "generateContentConfig": {
              "maxOutputTokens": 1024,
              "thinkingConfig": {
                "thinkingBudget": 512
              }
            }
          }
        },
        "prompt-completion": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-2.5-flash-lite",
            "generateContentConfig": {
              "temperature": 0.3,
              "maxOutputTokens": 16000,
              "thinkingConfig": {
                "thinkingBudget": 0
              }
            }
          }
        },
        "fast-ack-helper": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-2.5-flash-lite",
            "generateContentConfig": {
              "temperature": 0.2,
              "maxOutputTokens": 120,
              "thinkingConfig": {
                "thinkingBudget": 0
              }
            }
          }
        },
        "edit-corrector": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-2.5-flash-lite",
            "generateContentConfig": {
              "thinkingConfig": {
                "thinkingBudget": 0
              }
            }
          }
        },
        "summarizer-default": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-2.5-flash-lite",
            "generateContentConfig": {
              "maxOutputTokens": 2000
            }
          }
        },
        "summarizer-shell": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-2.5-flash-lite",
            "generateContentConfig": {
              "maxOutputTokens": 2000
            }
          }
        },
        "web-search": {
          "extends": "gemini-3-flash-base",
          "modelConfig": {
            "generateContentConfig": {
              "tools": [
                {
                  "googleSearch": {}
                }
              ]
            }
          }
        },
        "web-fetch": {
          "extends": "gemini-3-flash-base",
          "modelConfig": {
            "generateContentConfig": {
              "tools": [
                {
                  "urlContext": {}
                }
              ]
            }
          }
        },
        "web-fetch-fallback": {
          "extends": "gemini-3-flash-base",
          "modelConfig": {}
        },
        "loop-detection": {
          "extends": "gemini-3-flash-base",
          "modelConfig": {}
        },
        "loop-detection-double-check": {
          "extends": "base",
          "modelConfig": {
            "model": "gemini-3-pro-preview"
          }
        },
        "llm-edit-fixer": {
          "extends": "gemini-3-flash-base",
          "modelConfig": {}
        },
        "next-speaker-checker": {
          "extends": "gemini-3-flash-base",
          "modelConfig": {}
        },
        "chat-compression-3-pro": {
          "modelConfig": {
            "model": "gemini-3-pro-preview"
          }
        },
        "chat-compression-3-flash": {
          "modelConfig": {
            "model": "gemini-3-flash-preview"
          }
        },
        "chat-compression-2.5-pro": {
          "modelConfig": {
            "model": "gemini-2.5-pro"
          }
        },
        "chat-compression-2.5-flash": {
          "modelConfig": {
            "model": "gemini-2.5-flash"
          }
        },
        "chat-compression-2.5-flash-lite": {
          "modelConfig": {
            "model": "gemini-2.5-flash-lite"
          }
        },
        "chat-compression-default": {
          "modelConfig": {
            "model": "gemini-3-pro-preview"
          }
        }
      }
  • modelConfigs.customAliases (object):

    • Description: Custom named presets for model configs. These are merged
      with (and override) the built-in aliases.
    • Default: {}
  • modelConfigs.customOverrides (array):

    • Description: Custom model config overrides. These are merged with (and
      added to) the built-in overrides.
    • Default: []
  • modelConfigs.overrides (array):

    • Description: Apply specific configuration overrides based on matches,
      with a primary key of model (or alias). The most specific match will be
      used.
    • Default: []
  • modelConfigs.modelDefinitions (object):

    • Description: Registry of model metadata, including tier, family, and
      features.

    • Default:

      {
        "gemini-3.1-pro-preview": {
          "tier": "pro",
          "family": "gemini-3",
          "isPreview": true,
          "dialogLocation": "manual",
          "features": {
            "thinking": true,
            "multimodalToolUse": true
          }
        },
        "gemini-3.1-pro-preview-customtools": {
          "tier": "pro",
          "family": "gemini-3",
          "isPreview": true,
          "features": {
            "thinking": true,
            "multimodalToolUse": true
          }
        },
        "gemini-3-pro-preview": {
          "tier": "pro",
          "family": "gemini-3",
          "isPreview": true,
          "dialogLocation": "manual",
          "features": {
            "thinking": true,
            "multimodalToolUse": true
          }
        },
        "gemini-3-flash-preview": {
          "tier": "flash",
          "family": "gemini-3",
          "isPreview": true,
          "dialogLocation": "manual",
          "features": {
            "thinking": false,
            "multimodalToolUse": true
          }
        },
        "gemini-2.5-pro": {
          "tier": "pro",
          "family": "gemini-2.5",
          "isPreview": false,
          "dialogLocation": "manual",
          "features": {
            "thinking": false,
            "multimodalToolUse": false
          }
        },
        "gemini-2.5-flash": {
          "tier": "flash",
          "family": "gemini-2.5",
          "isPreview": false,
          "dialogLocation": "manual",
          "features": {
            "thinking": false,
            "multimodalToolUse": false
          }
        },
        "gemini-2.5-flash-lite": {
          "tier": "flash-lite",
          "family": "gemini-2.5",
          "isPreview": false,
          "dialogLocation": "manual",
          "features": {
            "thinking": false,
            "multimodalToolUse": false
          }
        },
        "auto": {
          "tier": "auto",
          "isPreview": true,
          "features": {
            "thinking": true,
            "multimodalToolUse": false
          }
        },
        "pro": {
          "tier": "pro",
          "isPreview": false,
          "features": {
            "thinking": true,
            "multimodalToolUse": false
          }
        },
        "flash": {
          "tier": "flash",
          "isPreview": false,
          "features": {
            "thinking": false,
            "multimodalToolUse": false
          }
        },
        "flash-lite": {
          "tier": "flash-lite",
          "isPreview": false,
          "features": {
            "thinking": false,
            "multimodalToolUse": false
          }
        },
        "auto-gemini-3": {
          "displayName": "Auto (Gemini 3)",
          "tier": "auto",
          "isPreview": true,
          "dialogLocation": "main",
          "dialogDescription": "Let Gemini CLI decide the best model for the task: gemini-3.1-pro, gemini-3-flash",
          "features": {
            "thinking": true,
            "multimodalToolUse": false
          }
        },
        "auto-gemini-2.5": {
          "displayName": "Auto (Gemini 2.5)",
          "tier": "auto",
          "isPreview": false,
          "dialogLocation": "main",
          "dialogDescription": "Let Gemini CLI decide the best model for the task: gemini-2.5-pro, gemini-2.5-flash",
          "features": {
            "thinking": false,
            "multimodalToolUse": false
          }
        }
      }
    • Requires restart: Yes

agents

  • agents.overrides (object):

    • Description: Override settings for specific agents, e.g. to disable the
      agent, set a custom model config, or run config.
    • Default: {}
    • Requires restart: Yes
  • agents.browser.sessionMode (enum):

    • Description: Session mode: 'persistent', 'isolated', or 'existing'.
    • Default: "persistent"
    • Values: "persistent", "isolated", "existing"
    • Requires restart: Yes
  • agents.browser.headless (boolean):

    • Description: Run browser in headless mode.
    • Default: false
    • Requires restart: Yes
  • agents.browser.profilePath (string):

    • Description: Path to browser profile directory for session persistence.
    • Default: undefined
    • Requires restart: Yes
  • agents.browser.visualModel (string):

    • Description: Model override for the visual agent.
    • Default: undefined
    • Requires restart: Yes
  • agents.browser.allowedDomains (array):

    • Description: A list of allowed domains for the browser agent (e.g.,
      ["github.com", "*.google.com"]).

    • Default:

      ["github.com", "*.google.com", "localhost"]
    • Requires restart: Yes

  • agents.browser.disableUserInput (boolean):

    • Description: Disable user input on browser window during automation.
    • Default: true

context

  • context.fileName (string | string[]):

    • Description: The name of the context file or files to load into memory.
      Accepts either a single string or an array of strings.
    • Default: undefined
  • context.importFormat (string):

    • Description: The format to use when importing memory.
    • Default: undefined
  • context.includeDirectoryTree (boolean):

    • Description: Whether to include the directory tree of the current
      working directory in the initial request to the model.
    • Default: true
  • context.discoveryMaxDirs (number):

    • Description: Maximum number of directories to search for memory.
    • Default: 200
  • context.includeDirectories (array):

    • Description: Additional directories to include in the workspace context.
      Missing directories will be skipped with a warning.
    • Default: []
  • context.loadMemoryFromIncludeDirectories (boolean):

    • Description: Controls how /memory reload loads GEMINI.md files. When
      true, include directories are scanned; when false, only the current
      directory is used.
    • Default: false
  • context.fileFiltering.respectGitIgnore (boolean):

    • Description: Respect .gitignore files when searching.
    • Default: true
    • Requires restart: Yes
  • context.fileFiltering.respectGeminiIgnore (boolean):

    • Description: Respect .geminiignore files when searching.
    • Default: true
    • Requires restart: Yes
  • context.fileFiltering.enableRecursiveFileSearch (boolean):

    • Description: Enable recursive file search functionality when completing
      @ references in the prompt.
    • Default: true
    • Requires restart: Yes
  • context.fileFiltering.enableFuzzySearch (boolean):

    • Description: Enable fuzzy search when searching for files.
    • Default: true
    • Requires restart: Yes
  • context.fileFiltering.customIgnoreFilePaths (array):

    • Description: Additional ignore file paths to respect. These files take
      precedence over .geminiignore and .gitignore. Files earlier in the array
      take precedence over files later in the array, e.g. the first file takes
      precedence over the second one.
    • Default: []
    • Requires restart: Yes

tools

  • tools.sandbox (string):

    • Description: Legacy full-process sandbox execution environment. Set to a
      boolean to enable or disable the sandbox, provide a string path to a sandbox
      profile, or specify an explicit sandbox command (e.g., "docker", "podman",
      "lxc").
    • Default: undefined
    • Requires restart: Yes
  • tools.shell.enableInteractiveShell (boolean):

    • Description: Use node-pty for an interactive shell experience. Fallback
      to child_process still applies.
    • Default: true
    • Requires restart: Yes
  • tools.shell.pager (string):

    • Description: The pager command to use for shell output. Defaults to
      cat.
    • Default: "cat"
  • tools.shell.showColor (boolean):

    • Description: Show color in shell output.
    • Default: false
  • tools.shell.inactivityTimeout (number):

    • Description: The maximum time in seconds allowed without output from the
      shell command. Defaults to 5 minutes.
    • Default: 300
  • tools.shell.enableShellOutputEfficiency (boolean):

    • Description: Enable shell output efficiency optimizations for better
      performance.
    • Default: true
  • tools.core (array):

    • Description: Restrict the set of built-in tools with an allowlist. Match
      semantics mirror tools.allowed; see the built-in tools documentation for
      available names.
    • Default: undefined
    • Requires restart: Yes
  • tools.allowed (array):

    • Description: Tool names that bypass the confirmation dialog. Useful for
      trusted commands (for example ["run_shell_command(git)",
      "run_shell_command(npm test)"]). See shell tool command restrictions for
      matching details.
    • Default: undefined
    • Requires restart: Yes
  • tools.exclude (array):

    • Description: Tool names to exclude from discovery.
    • Default: undefined
    • Requires restart: Yes
  • tools.discoveryCommand (string):

    • Description: Command to run for tool discovery.
    • Default: undefined
    • Requires restart: Yes
  • tools.callCommand (string):

    • Description: Defines a custom shell command for invoking discovered
      tools. The command must take the tool name as the first argument, read JSON
      arguments from stdin, and emit JSON results on stdout.
    • Default: undefined
    • Requires restart: Yes
  • tools.useRipgrep (boolean):

    • Description: Use ripgrep for file content search instead of the fallback
      implementation. Provides faster search performance.
    • Default: true
  • tools.truncateToolOutputThreshold (number):

    • Description: Maximum characters to show when truncating large tool
      outputs. Set to 0 or negative to disable truncation.
    • Default: 40000
    • Requires restart: Yes
  • tools.disableLLMCorrection (boolean):

    • Description: Disable LLM-based error correction for edit tools. When
      enabled, tools will fail immediately if exact string matches are not found,
      instead of attempting to self-correct.
    • Default: true
    • Requires restart: Yes

mcp

  • mcp.serverCommand (string):

    • Description: Command to start an MCP server.
    • Default: undefined
    • Requires restart: Yes
  • mcp.allowed (array):

    • Description: A list of MCP servers to allow.
    • Default: undefined
    • Requires restart: Yes
  • mcp.excluded (array):

    • Description: A list of MCP servers to exclude.
    • Default: undefined
    • Requires restart: Yes

useWriteTodos

  • useWriteTodos (boolean):
    • Description: Enable the write_todos tool.
    • Default: true

security

  • security.toolSandboxing (boolean):

    • Description: Experimental tool-level sandboxing (implementation in
      progress).
    • Default: false
  • security.disableYoloMode (boolean):

    • Description: Disable YOLO mode, even if enabled by a flag.
    • Default: false
    • Requires restart: Yes
  • security.disableAlwaysAllow (boolean):

    • Description: Disable "Always allow" options in tool confirmation
      dialogs.
    • Default: false
    • Requires restart: Yes
  • security.enablePermanentToolApproval (boolean):

    • Description: Enable the "Allow for all future sessions" option in tool
      confirmation dialogs.
    • Default: false
  • security.autoAddToPolicyByDefault (boolean):

    • Description: When enabled, the "Allow for all future sessions" option
      becomes the default choice for low-risk tools in trusted workspaces.
    • Default: false
  • security.blockGitExtensions (boolean):

    • Description: Blocks installing and loading extensions from Git.
    • Default: false
    • Requires restart: Yes
  • security.allowedExtensions (array):

    • Description: List of Regex patterns for allowed extensions. If nonempty,
      only extensions that match the patterns in this list are allowed. Overrides
      the blockGitExtensions setting.
    • Default: []
    • Requires restart: Yes
  • security.folderTrust.enabled (boolean):

    • Description: Setting to track whether Folder trust is enabled.
    • Default: true
    • Requires restart: Yes
  • security.environmentVariableRedaction.allowed (array):

    • Description: Environment variables to always allow (bypass redaction).
    • Default: []
    • Requires restart: Yes
  • security.environmentVariableRedaction.blocked (array):

    • Description: Environment variables to always redact.
    • Default: []
    • Requires restart: Yes
  • security.environmentVariableRedaction.enabled (boolean):

    • Description: Enable redaction of environment variables that may contain
      secrets.
    • Default: false
    • Requires restart: Yes
  • security.auth.selectedType (string):

    • Description: The currently selected authentication type.
    • Default: undefined
    • Requires restart: Yes
  • security.auth.enforcedType (string):

    • Description: The required auth type. If this does not match the selected
      auth type, the user will be prompted to re-authenticate.
    • Default: undefined
    • Requires restart: Yes
  • security.auth.useExternal (boolean):

    • Description: Whether to use an external authentication flow.
    • Default: undefined
    • Requires restart: Yes
  • security.enableConseca (boolean):

    • Description: Enable the context-aware security checker. This feature
      uses an LLM to dynamically generate and enforce security policies for tool
      use based on your prompt, providing an additional layer of protection
      against unintended actions.
    • Default: false
    • Requires restart: Yes

advanced

  • advanced.autoConfigureMemory (boolean):

    • Description: Automatically configure Node.js memory limits
    • Default: false
    • Requires restart: Yes
  • advanced.dnsResolutionOrder (string):

    • Description: The DNS resolution order.
    • Default: undefined
    • Requires restart: Yes
  • advanced.excludedEnvVars (array):

    • Description: Environment variables to exclude from project context.

    • Default:

      ["DEBUG", "DEBUG_MODE"]
  • advanced.bugCommand (object):

    • Description: Configuration for the bug report command.
    • Default: undefined

experimental

  • experimental.toolOutputMasking.enabled (boolean):

    • Description: Enables tool output masking to save tokens.
    • Default: true
    • Requires restart: Yes
  • experimental.toolOutputMasking.toolProtectionThreshold (number):

    • Description: Minimum number of tokens to protect from masking (most
      recent tool outputs).
    • Default: 50000
    • Requires restart: Yes
  • experimental.toolOutputMasking.minPrunableTokensThreshold (number):

    • Description: Minimum prunable tokens required to trigger a masking pass.
    • Default: 30000
    • Requires restart: Yes
  • experimental.toolOutputMasking.protectLatestTurn (boolean):

    • Description: Ensures the absolute latest turn is never masked,
      regardless of token count.
    • Default: true
    • Requires restart: Yes
  • experimental.enableAgents (boolean):

    • Description: Enable local and remote subagents.
    • Default: true
    • Requires restart: Yes
  • experimental.extensionManagement (boolean):

    • Description: Enable extension management features.
    • Default: true
    • Requires restart: Yes
  • experimental.extensionConfig (boolean):

    • Description: Enable requesting and fetching of extension settings.
    • Default: true
    • Requires restart: Yes
  • experimental.extensionRegistry (boolean):

    • Description: Enable extension registry explore UI.
    • Default: false
    • Requires restart: Yes
  • experimental.extensionRegistryURI (string):

    • Description: The URI (web URL or local file path) of the extension
      registry.
    • Default: "https://geminicli.com/extensions.json"
    • Requires restart: Yes
  • experimental.extensionReloading (boolean):

    • Description: Enables extension loading/unloading within the CLI session.
    • Default: false
    • Requires restart: Yes
  • experimental.jitContext (boolean):

    • Description: Enable Just-In-Time (JIT) context loading.
    • Default: true
    • Requires restart: Yes
  • experimental.useOSC52Paste (boolean):

    • Description: Use OSC 52 for pasting. This may be more robust than the
      default system when using remote terminal sessions (if your terminal is
      configured to allow it).
    • Default: false
  • experimental.useOSC52Copy (boolean):

    • Description: Use OSC 52 for copying. This may be more robust than the
      default system when using remote terminal sessions (if your terminal is
      configured to allow it).
    • Default: false
  • experimental.plan (boolean):

    • Description: Enable Plan Mode.
    • Default: true
    • Requires restart: Yes
  • experimental.taskTracker (boolean):

    • Description: Enable task tracker tools.
    • Default: false
    • Requires restart: Yes
  • experimental.modelSteering (boolean):

    • Description: Enable model steering (user hints) to guide the model
      during tool execution.
    • Default: false
  • experimental.directWebFetch (boolean):

    • Description: Enable web fetch behavior that bypasses LLM summarization.
    • Default: false
    • Requires restart: Yes
  • experimental.dynamicModelConfiguration (boolean):

    • Description: Enable dynamic model configuration (definitions,
      resolutions, and chains) via settings.
    • Default: false
    • Requires restart: Yes
  • experimental.gemmaModelRouter.enabled (boolean):

    • Description: Enable the Gemma Model Router (experimental). Requires a
      local endpoint serving Gemma via the Gemini API using LiteRT-LM shim.
    • Default: false
    • Requires restart: Yes
  • experimental.gemmaModelRouter.classifier.host (string):

    • Description: The host of the classifier.
    • Default: "http://localhost:9379"
    • Requires restart: Yes
  • experimental.gemmaModelRouter.classifier.model (string):

    • Description: The model to use for the classifier. Only tested on
      gemma3-1b-gpu-custom.
    • Default: "gemma3-1b-gpu-custom"
    • Requires restart: Yes
  • experimental.topicUpdateNarration (boolean):

    • Description: Enable the experimental Topic & Update communication model
      for reduced chattiness and structured progress reporting.
    • Default: false

skills

  • skills.enabled (boolean):

    • Description: Enable Agent Skills.
    • Default: true
    • Requires restart: Yes
  • skills.disabled (array):

    • Description: List of disabled skills.
    • Default: []
    • Requires restart: Yes

hooksConfig

  • hooksConfig.enabled (boolean):

    • Description: Canonical toggle for the hooks system. When disabled, no
      hooks will be executed.
    • Default: true
    • Requires restart: Yes
  • hooksConfig.disabled (array):

    • Description: List of hook names (commands) that should be disabled.
      Hooks in this list will not execute even if configured.
    • Default: []
  • hooksConfig.notifications (boolean):

    • Description: Show visual indicators when hooks are executing.
    • Default: true

hooks

  • hooks.BeforeTool (array):

    • Description: Hooks that execute before tool execution. Can intercept,
      validate, or modify tool calls.
    • Default: []
  • hooks.AfterTool (array):

    • Description: Hooks that execute after tool execution. Can process
      results, log outputs, or trigger follow-up actions.
    • Default: []
  • hooks.BeforeAgent (array):

    • Description: Hooks that execute before agent loop starts. Can set up
      context or initialize resources.
    • Default: []
  • hooks.AfterAgent (array):

    • Description: Hooks that execute after agent loop completes. Can perform
      cleanup or summarize results.
    • Default: []
  • hooks.Notification (array):

    • Description: Hooks that execute on notification events (errors,
      warnings, info). Can log or alert on specific conditions.
    • Default: []
  • hooks.SessionStart (array):

    • Description: Hooks that execute when a session starts. Can initialize
      session-specific resources or state.
    • Default: []
  • hooks.SessionEnd (array):

    • Description: Hooks that execute when a session ends. Can perform cleanup
      or persist session data.
    • Default: []
  • hooks.PreCompress (array):

    • Description: Hooks that execute before chat history compression. Can
      back up or analyze conversation before compression.
    • Default: []
  • hooks.BeforeModel (array):

    • Description: Hooks that execute before LLM requests. Can modify prompts,
      inject context, or control model parameters.
    • Default: []
  • hooks.AfterModel (array):

    • Description: Hooks that execute after LLM responses. Can process
      outputs, extract information, or log interactions.
    • Default: []
  • hooks.BeforeToolSelection (array):

    • Description: Hooks that execute before tool selection. Can filter or
      prioritize available tools dynamically.
    • Default: []

admin

  • admin.secureModeEnabled (boolean):

    • Description: If true, disallows YOLO mode and "Always allow" options
      from being used.
    • Default: false
  • admin.extensions.enabled (boolean):

    • Description: If false, disallows extensions from being installed or
      used.
    • Default: true
  • admin.mcp.enabled (boolean):

    • Description: If false, disallows MCP servers from being used.
    • Default: true
  • admin.mcp.config (object):

    • Description: Admin-configured MCP servers.
    • Default: {}
  • admin.skills.enabled (boolean):

    • Description: If false, disallows agent skills from being used.
    • Default: true

mcpServers

Configures connections to one or more Model-Context Protocol (MCP) servers for
discovering and using custom tools. Gemini CLI attempts to connect to each
configured MCP server to discover available tools. Every discovered tool is
prepended with the mcp_ prefix and its server alias to form a fully qualified
name (FQN) (e.g., mcp_serverAlias_actualToolName) to avoid conflicts. Note
that the system might strip certain schema properties from MCP tool definitions
for compatibility. At least one of command, url, or httpUrl must be
provided. If multiple are specified, the order of precedence is httpUrl, then
url, then command.

Warning: Avoid using underscores (_) in your server aliases (e.g., use
my-server instead of my_server). The underlying policy engine parses Fully
Qualified Names (mcp_server_tool) using the first underscore after the
mcp_ prefix. An underscore in your server alias will cause the parser to
misidentify the server name, which can cause security policies to fail
silently.

  • mcpServers.<SERVER_NAME> (object): The server parameters for the named
    server.
    • command (string, optional): The command to execute to start the MCP server
      via standard I/O.
    • args (array of strings, optional): Arguments to pass to the command.
    • env (object, optional): Environment variables to set for the server
      process.
    • cwd (string, optional): The working directory in which to start the
      server.
    • url (string, optional): The URL of an MCP server that uses Server-Sent
      Events (SSE) for communication.
    • httpUrl (string, optional): The URL of an MCP server that uses streamable
      HTTP for communication.
    • headers (object, optional): A map of HTTP headers to send with requests to
      url or httpUrl.
    • timeout (number, optional): Timeout in milliseconds for requests to this
      MCP server.
    • trust (boolean, optional): Trust this server and bypass all tool call
      confirmations.
    • description (string, optional): A brief description of the server, which
      may be used for display purposes.
    • includeTools (array of strings, optional): List of tool names to include
      from this MCP server. When specified, only the tools listed here will be
      available from this server (allowlist behavior). If not specified, all tools
      from the server are enabled by default.
    • excludeTools (array of strings, optional): List of tool names to exclude
      from this MCP server. Tools listed here will not be available to the model,
      even if they are exposed by the server. Note: excludeTools takes
      precedence over includeTools - if a tool is in both lists, it will be
      excluded.

telemetry

Configures logging and metrics collection for Gemini CLI. For more information,
see Telemetry.

  • Properties:
    • enabled (boolean): Whether or not telemetry is enabled.
    • target (string): The destination for collected telemetry. Supported
      values are local and gcp.
    • otlpEndpoint (string): The endpoint for the OTLP Exporter.
    • otlpProtocol (string): The protocol for the OTLP Exporter (grpc or
      http).
    • logPrompts (boolean): Whether or not to include the content of user
      prompts in the logs.
    • outfile (string): The file to write telemetry to when target is
      local.
    • useCollector (boolean): Whether to use an external OTLP collector.

Example settings.json

Here is an example of a settings.json file with the nested structure, new as
of v0.3.0:

{
  "general": {
    "vimMode": true,
    "preferredEditor": "code",
    "sessionRetention": {
      "enabled": true,
      "maxAge": "30d",
      "maxCount": 100
    }
  },
  "ui": {
    "theme": "GitHub",
    "hideBanner": true,
    "hideTips": false,
    "customWittyPhrases": [
      "You forget a thousand things every day. Make sure this is one of ’em",
      "Connecting to AGI"
    ]
  },
  "tools": {
    "sandbox": "docker",
    "discoveryCommand": "bin/get_tools",
    "callCommand": "bin/call_tool",
    "exclude": ["write_file"]
  },
  "mcpServers": {
    "mainServer": {
      "command": "bin/mcp_server.py"
    },
    "anotherServer": {
      "command": "node",
      "args": ["mcp_server.js", "--verbose"]
    }
  },
  "telemetry": {
    "enabled": true,
    "target": "local",
    "otlpEndpoint": "http://localhost:4317",
    "logPrompts": true
  },
  "privacy": {
    "usageStatisticsEnabled": true
  },
  "model": {
    "name": "gemini-1.5-pro-latest",
    "maxSessionTurns": 10,
    "summarizeToolOutput": {
      "run_shell_command": {
        "tokenBudget": 100
      }
    }
  },
  "context": {
    "fileName": ["CONTEXT.md", "GEMINI.md"],
    "includeDirectories": ["path/to/dir1", "~/path/to/dir2", "../path/to/dir3"],
    "loadFromIncludeDirectories": true,
    "fileFiltering": {
      "respectGitIgnore": false
    }
  },
  "advanced": {
    "excludedEnvVars": ["DEBUG", "DEBUG_MODE", "NODE_ENV"]
  }
}

Shell history

The CLI keeps a history of shell commands you run. To avoid conflicts between
different projects, this history is stored in a project-specific directory
within your user's home folder.

  • Location: ~/.gemini/tmp/<project_hash>/shell_history
    • <project_hash> is a unique identifier generated from your project's root
      path.
    • The history is stored in a file named shell_history.

Environment variables and .env files

Environment variables are a common way to configure applications, especially for
sensitive information like API keys or for settings that might change between
environments. For authentication setup, see the
Authentication documentation which covers
all available authentication methods.

The CLI automatically loads environment variables from an .env file. The
loading order is:

  1. .env file in the current working directory.
  2. If not found, it searches upwards in parent directories until it finds an
    .env file or reaches the project root (identified by a .git folder) or
    the home directory.
  3. If still not found, it looks for ~/.env (in the user's home directory).

Environment variable exclusion: Some environment variables (like DEBUG and
DEBUG_MODE) are automatically excluded from being loaded from project .env
files to prevent interference with gemini-cli behavior. Variables from
.gemini/.env files are never excluded. You can customize this behavior using
the advanced.excludedEnvVars setting in your settings.json file.

  • GEMINI_API_KEY:
    • Your API key for the Gemini API.
    • One of several available
      authentication methods.
    • Set this in your shell profile (e.g., ~/.bashrc, ~/.zshrc) or an .env
      file.
  • GEMINI_MODEL:
    • Specifies the default Gemini model to use.
    • Overrides the hardcoded default
    • Example: export GEMINI_MODEL="gemini-3-flash-preview" (Windows PowerShell:
      $env:GEMINI_MODEL="gemini-3-flash-preview")
  • GEMINI_CLI_IDE_PID:
    • Manually specifies the PID of the IDE process to use for integration. This
      is useful when running Gemini CLI in a standalone terminal while still
      wanting to associate it with a specific IDE instance.
    • Overrides the automatic IDE detection logic.
  • GEMINI_CLI_HOME:
    • Specifies the root directory for Gemini CLI's user-level configuration and
      storage.
    • By default, this is the user's system home directory. The CLI will create a
      .gemini folder inside this directory.
    • Useful for shared compute environments or keeping CLI state isolated.
    • Example: export GEMINI_CLI_HOME="/path/to/user/config" (Windows
      PowerShell: $env:GEMINI_CLI_HOME="C:\path\to\user\config")
  • GEMINI_CLI_SURFACE:
    • Specifies a custom label to include in the User-Agent header for API
      traffic reporting.
    • This is useful for tracking specific internal tools or distribution
      channels.
    • Example: export GEMINI_CLI_SURFACE="my-custom-tool" (Windows PowerShell:
      $env:GEMINI_CLI_SURFACE="my-custom-tool")
  • GOOGLE_API_KEY:
    • Your Google Cloud API key.
    • Required for using Vertex AI in express mode.
    • Ensure you have the necessary permissions.
    • Example: export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY" (Windows PowerShell:
      $env:GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY").
  • GOOGLE_CLOUD_PROJECT:
    • Your Google Cloud Project ID.
    • Required for using Code Assist or Vertex AI.
    • If using Vertex AI, ensure you have the necessary permissions in this
      project.
    • Cloud Shell note: When running in a Cloud Shell environment, this
      variable defaults to a special project allocated for Cloud Shell users. If
      you have GOOGLE_CLOUD_PROJECT set in your global environment in Cloud
      Shell, it will be overridden by this default. To use a different project in
      Cloud Shell, you must define GOOGLE_CLOUD_PROJECT in a .env file.
    • Example: export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" (Windows
      PowerShell: $env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID").
  • GOOGLE_APPLICATION_CREDENTIALS (string):
    • Description: The path to your Google Application Credentials JSON file.
    • Example:
      export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/credentials.json"
      (Windows PowerShell:
      $env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\your\credentials.json")
  • GOOGLE_GENAI_API_VERSION:
    • Specifies the API version to use for Gemini API requests.
    • When set, overrides the default API version used by the SDK.
    • Example: export GOOGLE_GENAI_API_VERSION="v1" (Windows PowerShell:
      $env:GOOGLE_GENAI_API_VERSION="v1")
  • OTLP_GOOGLE_CLOUD_PROJECT:
    • Your Google Cloud Project ID for Telemetry in Google Cloud
    • Example: export OTLP_GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" (Windows
      PowerShell: $env:OTLP_GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID").
  • GEMINI_TELEMETRY_ENABLED:
    • Set to true or 1 to enable telemetry. Any other value is treated as
      disabling it.
    • Overrides the telemetry.enabled setting.
  • GEMINI_TELEMETRY_TARGET:
    • Sets the telemetry target (local or gcp).
    • Overrides the telemetry.target setting.
  • GEMINI_TELEMETRY_OTLP_ENDPOINT:
    • Sets the OTLP endpoint for telemetry.
    • Overrides the telemetry.otlpEndpoint setting.
  • GEMINI_TELEMETRY_OTLP_PROTOCOL:
    • Sets the OTLP protocol (grpc or http).
    • Overrides the telemetry.otlpProtocol setting.
  • GEMINI_TELEMETRY_LOG_PROMPTS:
    • Set to true or 1 to enable or disable logging of user prompts. Any other
      value is treated as disabling it.
    • Overrides the telemetry.logPrompts setting.
  • GEMINI_TELEMETRY_OUTFILE:
    • Sets the file path to write telemetry to when the target is local.
    • Overrides the telemetry.outfile setting.
  • GEMINI_TELEMETRY_USE_COLLECTOR:
    • Set to true or 1 to enable or disable using an external OTLP collector.
      Any other value is treated as disabling it.
    • Overrides the telemetry.useCollector setting.
  • GOOGLE_CLOUD_LOCATION:
    • Your Google Cloud Project Location (e.g., us-central1).
    • Required for using Vertex AI in non-express mode.
    • Example: export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION" (Windows
      PowerShell: $env:GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION").
  • GEMINI_SANDBOX:
    • Alternative to the sandbox setting in settings.json.
    • Accepts true, false, docker, podman, or a custom command string.
  • GEMINI_SYSTEM_MD:
    • Replaces the built‑in system prompt with content from a Markdown file.
    • true/1: Use project default path ./.gemini/system.md.
    • Any other string: Treat as a path (relative/absolute supported, ~
      expands).
    • false/0 or unset: Use the built‑in prompt. See
      System Prompt Override.
  • GEMINI_WRITE_SYSTEM_MD:
    • Writes the current built‑in system prompt to a file for review.
    • true/1: Write to ./.gemini/system.md. Otherwise treat the value as a
      path.
    • Run the CLI once with this set to generate the file.
  • SEATBELT_PROFILE (macOS specific):
    • Switches the Seatbelt (sandbox-exec) profile on macOS.
    • permissive-open: (Default) Restricts writes to the project folder (and a
      few other folders, see
      packages/cli/src/utils/sandbox-macos-permissive-open.sb) but allows other
      operations.
    • restrictive-open: Declines operations by default, allows network.
    • strict-open: Restricts both reads and writes to the working directory,
      allows network.
    • strict-proxied: Same as strict-open but routes network through proxy.
    • <profile_name>: Uses a custom profile. To define a custom profile, create
      a file named sandbox-macos-<profile_name>.sb in your project's .gemini/
      directory (e.g., my-project/.gemini/sandbox-macos-custom.sb).
  • DEBUG or DEBUG_MODE (often used by underlying libraries or the CLI
    itself):
    • Set to true or 1 to enable verbose debug logging, which can be helpful
      for troubleshooting.
    • Note: These variables are automatically excluded from project .env
      files by default to prevent interference with gemini-cli behavior. Use
      .gemini/.env files if you need to set these for gemini-cli specifically.
  • NO_COLOR:
    • Set to any value to disable all color output in the CLI.
  • CLI_TITLE:
    • Set to a string to customize the title of the CLI.
  • CODE_ASSIST_ENDPOINT:
    • Specifies the endpoint for the code assist server.
    • This is useful for development and testing.

Environment variable redaction

To prevent accidental leakage of sensitive information, Gemini CLI automatically
redacts potential secrets from environment variables when executing tools (such
as shell commands). This "best effort" redaction applies to variables inherited
from the system or loaded from .env files.

Default Redaction Rules:

  • By Name: Variables are redacted if their names contain sensitive terms
    like TOKEN, SECRET, PASSWORD, KEY, AUTH, CREDENTIAL, PRIVATE, or
    CERT.
  • By Value: Variables are redacted if their values match known secret
    patterns, such as:
    • Private keys (RSA, OpenSSH, PGP, etc.)
    • Certificates
    • URLs containing credentials
    • API keys and tokens (GitHub, Google, AWS, Stripe, Slack, etc.)
  • Specific Blocklist: Certain variables like CLIENT_ID, DB_URI,
    DATABASE_URL, and CONNECTION_STRING are always redacted by default.

Allowlist (Never Redacted):

  • Common system variables (e.g., PATH, HOME, USER, SHELL, TERM,
    LANG).
  • Variables starting with GEMINI_CLI_.
  • GitHub Action specific variables.

Configuration:

You can customize this behavior in your settings.json file:

  • security.allowedEnvironmentVariables: A list of variable names to
    never redact, even if they match sensitive patterns.
  • security.blockedEnvironmentVariables: A list of variable names to
    always redact, even if they don't match sensitive patterns.
{
  "security": {
    "allowedEnvironmentVariables": ["MY_PUBLIC_KEY", "NOT_A_SECRET_TOKEN"],
    "blockedEnvironmentVariables": ["INTERNAL_IP_ADDRESS"]
  }
}

Command-line arguments

Arguments passed directly when running the CLI can override other configurations
for that specific session.

  • --model <model_name> (-m <model_name>):

    • Specifies the Gemini model to use for this session.
    • Example: npm start -- --model gemini-3-pro-preview
  • --prompt <your_prompt> (-p <your_prompt>):

    • Deprecated: Use positional arguments instead.
    • Used to pass a prompt directly to the command. This invokes Gemini CLI in a
      non-interactive mode.
  • --prompt-interactive <your_prompt> (-i <your_prompt>):

    • Starts an interactive session with the provided prompt as the initial input.
    • The prompt is processed within the interactive session, not before it.
    • Cannot be used when piping input from stdin.
    • Example: gemini -i "explain this code"
  • --output-format <format>:

    • Description: Specifies the format of the CLI output for non-interactive
      mode.
    • Values:
      • text: (Default) The standard human-readable output.
      • json: A machine-readable JSON output.
      • stream-json: A streaming JSON output that emits real-time events.
    • Note: For structured output and scripting, use the
      --output-format json or --output-format stream-json flag.
  • --sandbox (-s):

    • Enables sandbox mode for this session.
  • --debug (-d):

    • Enables debug mode for this session, providing more verbose output. Open the
      debug console with F12 to see the additional logging.
  • --help (or -h):

    • Displays help information about command-line arguments.
  • --yolo:

    • Enables YOLO mode, which automatically approves all tool calls.
  • --approval-mode <mode>:

    • Sets the approval mode for tool calls. Available modes:
      • default: Prompt for approval on each tool call (default behavior)
      • auto_edit: Automatically approve edit tools (replace, write_file) while
        prompting for others
      • yolo: Automatically approve all tool calls (equivalent to --yolo)
      • plan: Read-only mode for tool calls (requires experimental planning to
        be enabled).

        Note: This mode is currently under development and not yet fully
        functional.

    • Cannot be used together with --yolo. Use --approval-mode=yolo instead of
      --yolo for the new unified approach.
    • Example: gemini --approval-mode auto_edit
  • --allowed-tools <tool1,tool2,...>:

    • A comma-separated list of tool names that will bypass the confirmation
      dialog.
    • Example: gemini --allowed-tools "ShellTool(git status)"
  • --extensions <extension_name ...> (-e <extension_name ...>):

    • Specifies a list of extensions to use for the session. If not provided, all
      available extensions are used.
    • Use the special term gemini -e none to disable all extensions.
    • Example: gemini -e my-extension -e my-other-extension
  • --list-extensions (-l):

    • Lists all available extensions and exits.
  • --resume [session_id] (-r [session_id]):

    • Resume a previous chat session. Use "latest" for the most recent session,
      provide a session index number, or provide a full session UUID.
    • If no session_id is provided, defaults to "latest".
    • Example: gemini --resume 5 or gemini --resume latest or
      gemini --resume a1b2c3d4-e5f6-7890-abcd-ef1234567890 or gemini --resume
    • See Session Management for more details.
  • --list-sessions:

    • List all available chat sessions for the current project and exit.
    • Shows session indices, dates, message counts, and preview of first user
      message.
    • Example: gemini --list-sessions
  • --delete-session <identifier>:

    • Delete a specific chat session by its index number or full session UUID.
    • Use --list-sessions first to see available sessions, their indices, and
      UUIDs.
    • Example: gemini --delete-session 3 or
      gemini --delete-session a1b2c3d4-e5f6-7890-abcd-ef1234567890
  • --include-directories <dir1,dir2,...>:

    • Includes additional directories in the workspace for multi-directory
      support.
    • Can be specified multiple times or as comma-separated values.
    • 5 directories can be added at maximum.
    • Example: --include-directories /path/to/project1,/path/to/project2 or
      --include-directories /path/to/project1 --include-directories /path/to/project2
  • --screen-reader:

    • Enables screen reader mode, which adjusts the TUI for better compatibility
      with screen readers.
  • --version:

    • Displays the version of the CLI.
  • --experimental-acp:

    • Starts the agent in ACP mode.
  • --allowed-mcp-server-names:

    • Allowed MCP server names.
  • --fake-responses:

    • Path to a file with fake model responses for testing.
  • --record-responses:

    • Path to a file to record model responses for testing.

Context files (hierarchical instructional context)

While not strictly configuration for the CLI's behavior, context files
(defaulting to GEMINI.md but configurable via the context.fileName setting)
are crucial for configuring the instructional context (also referred to as
"memory") provided to the Gemini model. This powerful feature allows you to give
project-specific instructions, coding style guides, or any relevant background
information to the AI, making its responses more tailored and accurate to your
needs. The CLI includes UI elements, such as an indicator in the footer showing
the number of loaded context files, to keep you informed about the active
context.

  • Purpose: These Markdown files contain instructions, guidelines, or context
    that you want the Gemini model to be aware of during your interactions. The
    system is designed to manage this instructional context hierarchically.

Example context file content (e.g., GEMINI.md)

Here's a conceptual example of what a context file at the root of a TypeScript
project might contain:

# Project: My Awesome TypeScript Library

## General Instructions:

- When generating new TypeScript code, please follow the existing coding style.
- Ensure all new functions and classes have JSDoc comments.
- Prefer functional programming paradigms where appropriate.
- All code should be compatible with TypeScript 5.0 and Node.js 20+.

## Coding Style:

- Use 2 spaces for indentation.
- Interface names should be prefixed with `I` (e.g., `IUserService`).
- Private class members should be prefixed with an underscore (`_`).
- Always use strict equality (`===` and `!==`).

## Specific Component: `src/api/client.ts`

- This file handles all outbound API requests.
- When adding new API call functions, ensure they include robust error handling
  and logging.
- Use the existing `fetchWithRetry` utility for all GET requests.

## Regarding Dependencies:

- Avoid introducing new external dependencies unless absolutely necessary.
- If a new dependency is required, please state the reason.

This example demonstrates how you can provide general project context, specific
coding conventions, and even notes about particular files or components. The
more relevant and precise your context files are, the better the AI can assist
you. Project-specific context files are highly encouraged to establish
conventions and context.

  • Hierarchical loading and precedence: The CLI implements a sophisticated
    hierarchical memory system by loading context files (e.g., GEMINI.md) from
    several locations. Content from files lower in this list (more specific)
    typically overrides or supplements content from files higher up (more
    general). The exact concatenation order and final context can be inspected
    using the /memory show command. The typical loading order is:
    1. Global context file:
      • Location: ~/.gemini/<configured-context-filename> (e.g.,
        ~/.gemini/GEMINI.md in your user home directory).
      • Scope: Provides default instructions for all your projects.
    2. Project root and ancestors context files:
      • Location: The CLI searches for the configured context file in the
        current working directory and then in each parent directory up to either
        the project root (identified by a .git folder) or your home directory.
      • Scope: Provides context relevant to the entire project or a significant
        portion of it.
    3. Sub-directory context files (contextual/local):
      • Location: The CLI also scans for the configured context file in
        subdirectories below the current working directory (respecting common
        ignore patterns like node_modules, .git, etc.). The breadth of this
        search is limited to 200 directories by default, but can be configured
        with the context.discoveryMaxDirs setting in your settings.json
        file.
      • Scope: Allows for highly specific instructions relevant to a particular
        component, module, or subsection of your project.
  • Concatenation and UI indication: The contents of all found context files
    are concatenated (with separators indicating their origin and path) and
    provided as part of the system prompt to the Gemini model. The CLI footer
    displays the count of loaded context files, giving you a quick visual cue
    about the active instructional context.
  • Importing content: You can modularize your context files by importing
    other Markdown files using the @path/to/file.md syntax. For more details,
    see the Memory Import Processor documentation.
  • Commands for memory management:
    • Use /memory refresh to force a re-scan and reload of all context files
      from all configured locations. This updates the AI's instructional context.
    • Use /memory show to display the combined instructional context currently
      loaded, allowing you to verify the hierarchy and content being used by the
      AI.
    • See the Commands documentation for full details on
      the /memory command and its sub-commands (show and reload).

By understanding and utilizing these configuration layers and the hierarchical
nature of context files, you can effectively manage the AI's memory and tailor
the Gemini CLI's responses to your specific needs and projects.

Sandboxing

The Gemini CLI can execute potentially unsafe operations (like shell commands
and file modifications) within a sandboxed environment to protect your system.

Sandboxing is disabled by default, but you can enable it in a few ways:

  • Using --sandbox or -s flag.
  • Setting GEMINI_SANDBOX environment variable.
  • Sandbox is enabled when using --yolo or --approval-mode=yolo by default.

By default, it uses a pre-built gemini-cli-sandbox Docker image.

For project-specific sandboxing needs, you can create a custom Dockerfile at
.gemini/sandbox.Dockerfile in your project's root directory. This Dockerfile
can be based on the base sandbox image:

FROM gemini-cli-sandbox

# Add your custom dependencies or configurations here
# For example:
# RUN apt-get update && apt-get install -y some-package
# COPY ./my-config /app/my-config

When .gemini/sandbox.Dockerfile exists, you can use BUILD_SANDBOX
environment variable when running Gemini CLI to automatically build the custom
sandbox image:

BUILD_SANDBOX=1 gemini -s

Usage statistics

To help us improve the Gemini CLI, we collect anonymized usage statistics. This
data helps us understand how the CLI is used, identify common issues, and
prioritize new features.

What we collect:

  • Tool calls: We log the names of the tools that are called, whether they
    succeed or fail, and how long they take to execute. We do not collect the
    arguments passed to the tools or any data returned by them.
  • API requests: We log the Gemini model used for each request, the duration
    of the request, and whether it was successful. We do not collect the content
    of the prompts or responses.
  • Session information: We collect information about the configuration of the
    CLI, such as the enabled tools and the approval mode.

What we DON'T collect:

  • Personally identifiable information (PII): We do not collect any personal
    information, such as your name, email address, or API keys.
  • Prompt and response content: We do not log the content of your prompts or
    the responses from the Gemini model.
  • File content: We do not log the content of any files that are read or
    written by the CLI.

How to opt out:

You can opt out of usage statistics collection at any time by setting the
usageStatisticsEnabled property to false under the privacy category in
your settings.json file:

{
  "privacy": {
    "usageStatisticsEnabled": false
  }
}

@skulidropek
Copy link
Copy Markdown
Member Author

Для авторизации gemini можно юзать: NO_BROWSER=true gemini

@skulidropek
Copy link
Copy Markdown
Member Author

Используй просто вот этот конфиг:

{
  "model": {
    "name": "gemini-3.1-pro-preview-yolo",
    "compressionThreshold": 0.9,
    "disableLoopDetection": true
  },
  "modelConfigs": {
    "customAliases": {
      "yolo-ultra": {
        "modelConfig": {
          "model": "gemini-3.1-pro-preview-yolo",
          "generateContentConfig": {
            "tools": [
              {
                "googleSearch": {}
              },
              {
                "urlContext": {}
              }
            ]
          }
        }
      }
    }
  },
  "general": {
    "defaultApprovalMode": "auto_edit"
  },
  "tools": {
    "allowed": [
      "run_shell_command",
      "write_file",
      "googleSearch",
      "urlContext"
    ]
  },
  "sandbox": {
    "enabled": false
  },
  "security": {
    "folderTrust": {
      "enabled": false
    },
    "auth": {
      "selectedType": "oauth-personal"
    },
    "disableYoloMode": false
  },
  "mcpServers": {
    "playwright": {
      "command": "docker-git-playwright-mcp",
      "args": [],
      "trust": true
    }
  }
}

@konard
Copy link
Copy Markdown
Contributor

konard commented Mar 17, 2026

🚨 Solution Draft Failed

The automated solution draft encountered an error:

Branch operation failed

🤖 Models used:

  • Tool: Claude
  • Requested: opus
  • Main model: Claude Opus 4.5 (ID: claude-opus-4-5-20251101, Anthropic, cutoff: 2025-03-31)
Click to expand failure log (12KB)
# Solve.mjs Log - 2026-03-17T10:52:45.143Z

[2026-03-17T10:52:45.144Z] [INFO] 📁 Log file: /home/hive/solve-2026-03-17T10-52-45-143Z.log
[2026-03-17T10:52:45.144Z] [INFO]    (All output will be logged here)
[2026-03-17T10:52:45.612Z] [INFO] 
[2026-03-17T10:52:45.612Z] [INFO] 🚀 solve v1.34.1
[2026-03-17T10:52:45.613Z] [INFO] 🔧 Raw command executed:
[2026-03-17T10:52:45.613Z] [INFO]    /home/hive/.nvm/versions/node/v20.20.1/bin/node /home/hive/.bun/bin/solve https://github.com/ProverCoderAI/docker-git/pull/150 --model=opus --attach-logs --verbose --no-tool-check --auto-accept-invite --tokens-budget-stats
[2026-03-17T10:52:45.613Z] [INFO] 
[2026-03-17T10:52:45.624Z] [INFO] 
[2026-03-17T10:52:45.624Z] [WARNING] ⚠️  SECURITY WARNING: --attach-logs is ENABLED
[2026-03-17T10:52:45.624Z] [INFO] 
[2026-03-17T10:52:45.625Z] [INFO]    This option will upload the complete solution draft log file to the Pull Request.
[2026-03-17T10:52:45.625Z] [INFO]    The log may contain sensitive information such as:
[2026-03-17T10:52:45.625Z] [INFO]    • API keys, tokens, or secrets
[2026-03-17T10:52:45.625Z] [INFO]    • File paths and directory structures
[2026-03-17T10:52:45.625Z] [INFO]    • Command outputs and error messages
[2026-03-17T10:52:45.625Z] [INFO]    • Internal system information
[2026-03-17T10:52:45.625Z] [INFO] 
[2026-03-17T10:52:45.626Z] [INFO]    ⚠️  DO NOT use this option with public repositories or if the log
[2026-03-17T10:52:45.626Z] [INFO]        might contain sensitive data that should not be shared publicly.
[2026-03-17T10:52:45.626Z] [INFO] 
[2026-03-17T10:52:45.626Z] [INFO]    Continuing in 5 seconds... (Press Ctrl+C to abort)
[2026-03-17T10:52:45.626Z] [INFO] 
[2026-03-17T10:52:50.633Z] [INFO] 
[2026-03-17T10:52:50.656Z] [INFO] 💾 Disk space check: 39909MB available (2048MB required) ✅
[2026-03-17T10:52:50.658Z] [INFO] 🧠 Memory check: 11104MB available, swap: none, total: 11104MB (256MB required) ✅
[2026-03-17T10:52:50.675Z] [INFO] ⏩ Skipping tool connection validation (dry-run mode or skip-tool-connection-check enabled)
[2026-03-17T10:52:50.676Z] [INFO] ⏩ Skipping GitHub authentication check (dry-run mode or skip-tool-connection-check enabled)
[2026-03-17T10:52:50.676Z] [INFO] 📋 URL validation:
[2026-03-17T10:52:50.677Z] [INFO]    Input URL: https://github.com/ProverCoderAI/docker-git/pull/150
[2026-03-17T10:52:50.677Z] [INFO]    Is Issue URL: false
[2026-03-17T10:52:50.677Z] [INFO]    Is PR URL: true
[2026-03-17T10:52:50.677Z] [INFO] 🔍 Checking repository access for auto-fork...
[2026-03-17T10:52:51.659Z] [INFO]    Repository visibility: public
[2026-03-17T10:52:51.660Z] [INFO] ✅ Auto-fork: No write access detected, enabling fork mode
[2026-03-17T10:52:51.661Z] [INFO] 🔍 --auto-accept-invite: Checking for pending invitation to ProverCoderAI/docker-git...
[2026-03-17T10:52:51.908Z] [INFO]    Found 0 total pending repo invitation(s)
[2026-03-17T10:52:51.909Z] [INFO]    No pending repository invitation found for ProverCoderAI/docker-git
[2026-03-17T10:52:52.301Z] [INFO]    Found 0 total pending org invitation(s)
[2026-03-17T10:52:52.302Z] [INFO]    No pending organization invitation found for ProverCoderAI
[2026-03-17T10:52:52.302Z] [INFO] ℹ️  --auto-accept-invite: No pending invitation found for ProverCoderAI/docker-git or organization ProverCoderAI
[2026-03-17T10:52:52.303Z] [INFO] ✅ Repository access check: Skipped (fork mode enabled)
[2026-03-17T10:52:52.685Z] [INFO]    Repository visibility: public
[2026-03-17T10:52:52.686Z] [INFO]    Auto-cleanup default: false (repository is public)
[2026-03-17T10:52:52.686Z] [INFO] 🔄 Continue mode: Working with PR #150
[2026-03-17T10:52:52.686Z] [INFO]    Continue mode activated: PR URL provided directly
[2026-03-17T10:52:52.687Z] [INFO]    PR Number set to: 150
[2026-03-17T10:52:52.687Z] [INFO]    Will fetch PR details and linked issue
[2026-03-17T10:52:53.133Z] [INFO] 🍴 Detected fork PR from skulidropek/docker-git
[2026-03-17T10:52:53.133Z] [INFO]    Fork owner: skulidropek
[2026-03-17T10:52:53.134Z] [INFO]    Will clone fork repository for continue mode
[2026-03-17T10:52:53.134Z] [INFO] 📝 PR branch: feat/gemini-default-settings
[2026-03-17T10:52:53.135Z] [WARNING] ⚠️  Warning: No linked issue found in PR body
[2026-03-17T10:52:53.135Z] [WARNING]    The PR should contain "Fixes #123" or similar to link an issue
[2026-03-17T10:52:53.136Z] [INFO] 
Creating temporary directory: /tmp/gh-issue-solver-1773744773136
[2026-03-17T10:52:53.138Z] [INFO] 
🍴 Fork mode:                ENABLED
[2026-03-17T10:52:53.138Z] [INFO]  Checking fork status...   

[2026-03-17T10:52:53.438Z] [INFO] 🔍 Detecting fork conflicts... 
[2026-03-17T10:52:54.565Z] [INFO] ✅ No fork conflict:         Safe to proceed
[2026-03-17T10:52:54.916Z] [INFO] ✅ Fork exists:              konard/ProverCoderAI-docker-git
[2026-03-17T10:52:54.917Z] [INFO] 🔍 Validating fork parent... 
[2026-03-17T10:52:55.316Z] [INFO] ✅ Fork parent validated:    ProverCoderAI/docker-git
[2026-03-17T10:52:55.317Z] [INFO] 
📥 Cloning repository:       konard/ProverCoderAI-docker-git
[2026-03-17T10:53:20.827Z] [INFO] ✅ Cloned to:                /tmp/gh-issue-solver-1773744773136
[2026-03-17T10:53:20.839Z] [INFO] 🔗 Setting upstream:         ProverCoderAI/docker-git
[2026-03-17T10:53:20.849Z] [INFO] ℹ️ Upstream exists:          Using existing upstream remote
[2026-03-17T10:53:20.849Z] [INFO] 🔄 Fetching upstream...      
[2026-03-17T10:53:21.729Z] [INFO] ✅ Upstream fetched:         Successfully
[2026-03-17T10:53:21.730Z] [INFO] 🔄 Syncing default branch... 
[2026-03-17T10:53:22.199Z] [INFO] ℹ️ Default branch:           main
[2026-03-17T10:53:22.220Z] [INFO] ✅ Default branch synced:    with upstream/main
[2026-03-17T10:53:22.220Z] [INFO] 🔄 Pushing to fork:          main branch
[2026-03-17T10:53:23.061Z] [INFO] ✅ Fork updated:             Default branch pushed to fork
[2026-03-17T10:53:23.062Z] [INFO] 
🔍 Checking PR fork:         Determining if branch is in another fork...
[2026-03-17T10:53:23.428Z] [INFO] 🔗 Setting up pr-fork:       Branch exists in another user's fork
[2026-03-17T10:53:23.429Z] [INFO]  PR fork owner:            skulidropek
[2026-03-17T10:53:23.429Z] [INFO]  Current user:             konard
[2026-03-17T10:53:23.430Z] [INFO] 🔍 Discovering fork name:    Searching ProverCoderAI/docker-git/forks for skulidropek's fork...
[2026-03-17T10:53:23.766Z] [INFO] ✅ Found fork:               skulidropek/docker-git
[2026-03-17T10:53:23.767Z] [INFO]  Action:                   Adding skulidropek/docker-git as pr-fork remote
[2026-03-17T10:53:23.776Z] [INFO] ✅ Remote added:             pr-fork
[2026-03-17T10:53:23.776Z] [INFO] 📥 Fetching branches:        From pr-fork remote...
[2026-03-17T10:53:25.271Z] [INFO] ✅ Fetched:                  pr-fork branches
[2026-03-17T10:53:25.272Z] [INFO] ℹ️ Next step:                Will checkout branch from pr-fork remote
[2026-03-17T10:53:25.355Z] [INFO] 
📌 Default branch:           main
[2026-03-17T10:53:25.373Z] [INFO] 
🔄 Checking out PR branch:   feat/gemini-default-settings
[2026-03-17T10:53:25.374Z] [INFO] 📥 Fetching branches:        From remote...
[2026-03-17T10:53:25.742Z] [INFO] 🔄 Branch not in origin:     Checking upstream remote...
[2026-03-17T10:53:25.751Z] [INFO] 📥 Fetching from upstream:   Looking for PR branch...
[2026-03-17T10:53:26.110Z] [WARNING] ⚠️ Branch not found:         Not in origin or upstream remotes
[2026-03-17T10:53:26.111Z] [INFO] 🔄 Trying PR refs fallback:  Fetching refs/pull/150/head...
[2026-03-17T10:53:26.474Z] [INFO] ⚠️ PR refs fallback failed:  Could not fetch PR head
[2026-03-17T10:53:26.475Z] [INFO]  Details:                  fatal: couldn't find remote ref pull/150/head
[2026-03-17T10:53:26.475Z] [INFO] 
[2026-03-17T10:53:27.866Z] [ERROR] ❌ BRANCH CHECKOUT FAILED    
[2026-03-17T10:53:27.866Z] [INFO] 
[2026-03-17T10:53:27.867Z] [INFO]   🔍 What happened:
[2026-03-17T10:53:27.867Z] [INFO]      Failed to checkout the branch 'feat/gemini-default-settings' for PR #150.
[2026-03-17T10:53:27.867Z] [INFO]      Repository: https://github.com/ProverCoderAI/docker-git
[2026-03-17T10:53:27.867Z] [INFO]      Pull Request: https://github.com/ProverCoderAI/docker-git/pull/150
[2026-03-17T10:53:27.867Z] [INFO]      The branch doesn't exist in the main repository (https://github.com/ProverCoderAI/docker-git).
[2026-03-17T10:53:27.867Z] [INFO] 
[2026-03-17T10:53:27.868Z] [INFO]   📦 Git error details:
[2026-03-17T10:53:27.868Z] [INFO]      fatal: 'origin/feat/gemini-default-settings' is not a commit and a branch 'feat/gemini-default-settings' cannot be created from it
[2026-03-17T10:53:27.868Z] [INFO] 
[2026-03-17T10:53:27.868Z] [INFO]   💡 Why this happened:
[2026-03-17T10:53:27.868Z] [INFO]      The PR branch 'feat/gemini-default-settings' exists in the fork repository:
[2026-03-17T10:53:27.868Z] [INFO]        https://github.com/skulidropek/docker-git
[2026-03-17T10:53:27.868Z] [INFO]      but you're trying to access it from the main repository:
[2026-03-17T10:53:27.869Z] [INFO]        https://github.com/ProverCoderAI/docker-git
[2026-03-17T10:53:27.869Z] [INFO]      This branch does NOT exist in the main repository.
[2026-03-17T10:53:27.869Z] [INFO]      This is a common issue with pull requests from forks.
[2026-03-17T10:53:27.869Z] [INFO] 
[2026-03-17T10:53:27.869Z] [INFO]   🔧 How to fix this:
[2026-03-17T10:53:27.869Z] [INFO] 
[2026-03-17T10:53:27.869Z] [INFO]   ┌──────────────────────────────────────────────────────────┐
[2026-03-17T10:53:27.869Z] [INFO]   │  RECOMMENDED: Use the --fork option                     │
[2026-03-17T10:53:27.870Z] [INFO]   └──────────────────────────────────────────────────────────┘
[2026-03-17T10:53:27.870Z] [INFO] 
[2026-03-17T10:53:27.870Z] [INFO]   Run this command:
[2026-03-17T10:53:27.870Z] [INFO]     ./solve.mjs "https://github.com/ProverCoderAI/docker-git/pull/150" --fork
[2026-03-17T10:53:27.870Z] [INFO] 
[2026-03-17T10:53:27.870Z] [INFO]   This will automatically:
[2026-03-17T10:53:27.871Z] [INFO]     ✓ Use your existing fork (skulidropek/docker-git)
[2026-03-17T10:53:27.871Z] [INFO]     ✓ Set up the correct remotes and branches
[2026-03-17T10:53:27.871Z] [INFO]     ✓ Allow you to work on the PR without permission issues
[2026-03-17T10:53:27.871Z] [INFO] 
[2026-03-17T10:53:27.871Z] [INFO]   ─────────────────────────────────────────────────────────
[2026-03-17T10:53:27.871Z] [INFO] 
[2026-03-17T10:53:27.872Z] [INFO]   Alternative options:
[2026-03-17T10:53:27.872Z] [INFO]     • Verify PR details: gh pr view 150 --repo ProverCoderAI/docker-git
[2026-03-17T10:53:27.872Z] [INFO]     • Check your local setup: cd /tmp/gh-issue-solver-1773744773136 && git remote -v
[2026-03-17T10:53:27.872Z] [INFO] 
[2026-03-17T10:53:27.872Z] [INFO]   📂 Working directory: /tmp/gh-issue-solver-1773744773136
[2026-03-17T10:53:27.873Z] [INFO] Error executing command:
[2026-03-17T10:53:27.873Z] [INFO] Stack trace: Error: Branch operation failed
    at createOrCheckoutBranch (file:///home/hive/.bun/install/global/node_modules/@link-assistant/hive-mind/src/solve.branch.lib.mjs:167:11)
    at async file:///home/hive/.bun/install/global/node_modules/@link-assistant/hive-mind/src/solve.mjs:538:22
[2026-03-17T10:53:27.873Z] [ERROR]    📁 Full log file: /home/hive/solve-2026-03-17T10-52-45-143Z.log
[2026-03-17T10:53:28.214Z] [WARNING] ⚠️  Could not determine GitHub user. Cannot create error report issue.
[2026-03-17T10:53:28.214Z] [INFO] 
📄 Attempting to attach failure logs...
[2026-03-17T10:53:28.326Z] [INFO]   🤖 Model info fetched for comment


Now working session is ended, feel free to review and add any feedback on the solution draft.

@skulidropek skulidropek merged commit fc08d39 into ProverCoderAI:main Mar 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants