From da50a1eefbd0751aaf137882595d500e6b6b4179 Mon Sep 17 00:00:00 2001 From: christine betts Date: Wed, 9 Jul 2025 21:16:42 +0000 Subject: Add system-wide settings config for administrators (#3498) Co-authored-by: Jack Wotherspoon --- docs/cli/configuration.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index 83678f2e..2be016c6 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -9,12 +9,13 @@ Configuration is applied in the following order of precedence (lower numbers are 1. **Default values:** Hardcoded defaults within the application. 2. **User settings file:** Global settings for the current user. 3. **Project settings file:** Project-specific settings. -4. **Environment variables:** System-wide or session-specific variables, potentially loaded from `.env` files. -5. **Command-line arguments:** Values passed when launching the CLI. +4. **System settings file:** System-wide settings. +5. **Environment variables:** System-wide or session-specific variables, potentially loaded from `.env` files. +6. **Command-line arguments:** Values passed when launching the CLI. -## The user settings file and project settings file +## Settings files -Gemini CLI uses `settings.json` files for persistent configuration. There are two locations for these files: +Gemini CLI uses `settings.json` files for persistent configuration. There are three locations for these files: - **User settings file:** - **Location:** `~/.gemini/settings.json` (where `~` is your home directory). @@ -22,6 +23,9 @@ Gemini CLI uses `settings.json` files for persistent configuration. There are tw - **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. +- **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). + - **Scope:** Applies to all Gemini CLI sessions on the system, for all users. System settings override user and project settings. 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` 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"`. -- cgit v1.2.3