Changing Gemini CLI Directories: Workspace, Project Settings, and Global Config
Описание и применение
Управление каталогами Gemini CLI: запуск из любого репозитория, включение дополнительных репозиториев в рабочее пространство, хранение настроек проекта в .gemini/ и перенос глобальной конфигурации через переменные окружения, символические ссылки или соединения.
Задача
Managing Gemini CLI directory scopes—user, project, and global—while ensuring correct configuration, credentials, and workspace inclusion.
Результат
Gemini CLI can be run from any repository, include multiple repositories in its workspace, maintain per‑project settings, and relocate global configuration without losing state or credentials.
Рабочий процесс
- Start Gemini in desired repo:
cd /path/to/project && gemini - Add another repo to workspace:
gemini --include-directories /path/to/other_repoor/directory add /path/to/other_repo - Create a project .gemini/ directory with settings.json and GEMINI.md and run
geminifrom that folder - Relocate global config: set
GEMINI_CONFIG_DIRenv var or create a symlink/junction to a new location - Verify settings.json and context discovery after relocation
- Diagnose failures by checking include‑directories, project settings, and read permissions
Доказательства
The default user configuration directory is .gemini under your home directory
If your installed version documents the directory override, the shell configuration looks like this: export GEMINI_CONFIG_DIR="$HOME/custom_gemini_dir" gemini
- Дата записи: 2026-09-22T15:45:49.035Z