2025-08-10 09:04:52 +09:00
/ * *
* @license
* Copyright 2025 Google LLC
* SPDX - License - Identifier : Apache - 2.0
* /
2025-10-13 12:57:23 -07:00
// --------------------------------------------------------------------------
// IMPORTANT: When adding a new setting, especially one with `showInDialog: true`,
// please ensure it is also documented in `docs/get-started/configuration.md`.
// --------------------------------------------------------------------------
2025-08-26 00:04:53 +02:00
import type {
2025-08-10 09:04:52 +09:00
MCPServerConfig ,
BugCommandSettings ,
TelemetrySettings ,
AuthType ,
ChatCompressionSettings ,
} from '@google/gemini-cli-core' ;
2025-09-05 15:37:29 -07:00
import {
DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES ,
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD ,
2025-10-13 22:30:32 -04:00
DEFAULT_GEMINI_MODEL ,
2025-09-05 15:37:29 -07:00
} from '@google/gemini-cli-core' ;
2025-08-26 00:04:53 +02:00
import type { CustomTheme } from '../ui/themes/theme.js' ;
2025-10-06 13:34:00 -06:00
import type { SessionRetentionSettings } from './settings.js' ;
import { DEFAULT_MIN_RETENTION } from '../utils/sessionCleanup.js' ;
2025-08-10 09:04:52 +09:00
2025-09-08 10:01:18 -04:00
export type SettingsType =
| 'boolean'
| 'string'
| 'number'
| 'array'
| 'object'
| 'enum' ;
export type SettingsValue =
| boolean
| string
| number
| string [ ]
| object
| undefined ;
/ * *
* Setting datatypes that "toggle" through a fixed list of options
* ( e . g . an enum or true / false ) rather than allowing for free form input
* ( like a number or string ) .
* /
export const TOGGLE_TYPES : ReadonlySet < SettingsType | undefined > = new Set ( [
'boolean' ,
'enum' ,
] ) ;
2025-09-10 05:45:12 +08:00
export interface SettingEnumOption {
2025-09-08 10:01:18 -04:00
value : string | number ;
label : string ;
}
2025-09-03 19:23:25 -07:00
export enum MergeStrategy {
// Replace the old value with the new value. This is the default.
REPLACE = 'replace' ,
// Concatenate arrays.
CONCAT = 'concat' ,
// Merge arrays, ensuring unique values.
UNION = 'union' ,
// Shallow merge objects.
SHALLOW_MERGE = 'shallow_merge' ,
}
2025-08-10 09:04:52 +09:00
export interface SettingDefinition {
2025-09-08 10:01:18 -04:00
type : SettingsType ;
2025-08-10 09:04:52 +09:00
label : string ;
category : string ;
requiresRestart : boolean ;
2025-09-08 10:01:18 -04:00
default : SettingsValue ;
2025-08-10 09:04:52 +09:00
description? : string ;
parentKey? : string ;
childKey? : string ;
key? : string ;
properties? : SettingsSchema ;
showInDialog? : boolean ;
2025-09-03 19:23:25 -07:00
mergeStrategy? : MergeStrategy ;
2025-09-08 10:01:18 -04:00
/** Enum type options */
options? : readonly SettingEnumOption [ ] ;
2025-08-10 09:04:52 +09:00
}
export interface SettingsSchema {
[ key : string ] : SettingDefinition ;
}
export type MemoryImportFormat = 'tree' | 'flat' ;
export type DnsResolutionOrder = 'ipv4first' | 'verbatim' ;
/ * *
* The canonical schema for all settings .
* The structure of this object defines the structure of the ` Settings ` type .
* ` as const ` is crucial for TypeScript to infer the most specific types possible .
* /
2025-09-08 10:01:18 -04:00
const SETTINGS_SCHEMA = {
2025-08-27 18:39:45 -07:00
// Maintained for compatibility/criticality
mcpServers : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'MCP Servers' ,
category : 'Advanced' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } as Record < string , MCPServerConfig > ,
description : 'Configuration for MCP servers.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-09-03 19:23:25 -07:00
mergeStrategy : MergeStrategy.SHALLOW_MERGE ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
general : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'General' ,
2025-08-10 09:04:52 +09:00
category : 'General' ,
requiresRestart : false ,
default : { } ,
2025-08-27 18:39:45 -07:00
description : 'General application settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
properties : {
2025-08-27 18:39:45 -07:00
preferredEditor : {
type : 'string' ,
label : 'Preferred Editor' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description : 'The preferred editor to open files in.' ,
showInDialog : false ,
} ,
vimMode : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Vim Mode' ,
category : 'General' ,
requiresRestart : false ,
2025-08-10 09:04:52 +09:00
default : false ,
2025-08-27 18:39:45 -07:00
description : 'Enable Vim keybindings' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
disableAutoUpdate : {
2025-08-21 22:29:15 +00:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Disable Auto Update' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Disable automatic updates' ,
showInDialog : true ,
} ,
disableUpdateNag : {
type : 'boolean' ,
label : 'Disable Update Nag' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Disable update notification prompts.' ,
showInDialog : false ,
} ,
checkpointing : {
type : 'object' ,
label : 'Checkpointing' ,
category : 'General' ,
requiresRestart : true ,
default : { } ,
description : 'Session checkpointing settings.' ,
showInDialog : false ,
properties : {
enabled : {
type : 'boolean' ,
label : 'Enable Checkpointing' ,
category : 'General' ,
requiresRestart : true ,
default : false ,
description : 'Enable session checkpointing for recovery' ,
showInDialog : false ,
} ,
} ,
} ,
enablePromptCompletion : {
type : 'boolean' ,
label : 'Enable Prompt Completion' ,
category : 'General' ,
2025-08-21 22:29:15 +00:00
requiresRestart : true ,
default : false ,
description :
2025-08-27 18:39:45 -07:00
'Enable AI-powered prompt completion suggestions while typing.' ,
2025-08-21 22:29:15 +00:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
debugKeystrokeLogging : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Debug Keystroke Logging' ,
category : 'General' ,
requiresRestart : false ,
2025-08-10 09:04:52 +09:00
default : false ,
2025-08-27 18:39:45 -07:00
description : 'Enable debug logging of keystrokes to the console.' ,
showInDialog : true ,
2025-08-10 09:04:52 +09:00
} ,
2025-10-06 13:34:00 -06:00
sessionRetention : {
type : 'object' ,
label : 'Session Retention' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as SessionRetentionSettings | undefined ,
properties : {
enabled : {
type : 'boolean' ,
label : 'Enable Session Cleanup' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Enable automatic session cleanup' ,
showInDialog : true ,
} ,
maxAge : {
type : 'string' ,
label : 'Max Session Age' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description :
'Maximum age of sessions to keep (e.g., "30d", "7d", "24h", "1w")' ,
showInDialog : false ,
} ,
maxCount : {
type : 'number' ,
label : 'Max Session Count' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as number | undefined ,
description :
'Alternative: Maximum number of sessions to keep (most recent)' ,
showInDialog : false ,
} ,
minRetention : {
type : 'string' ,
label : 'Min Retention Period' ,
category : 'General' ,
requiresRestart : false ,
default : DEFAULT_MIN_RETENTION ,
description : ` Minimum retention period (safety limit, defaults to " ${ DEFAULT_MIN_RETENTION } ") ` ,
showInDialog : false ,
} ,
} ,
description : 'Settings for automatic session cleanup.' ,
} ,
2025-08-10 09:04:52 +09:00
} ,
} ,
2025-09-11 05:19:47 +09:00
output : {
type : 'object' ,
label : 'Output' ,
category : 'General' ,
requiresRestart : false ,
default : { } ,
description : 'Settings for the CLI output.' ,
showInDialog : false ,
properties : {
format : {
type : 'enum' ,
label : 'Output Format' ,
category : 'General' ,
requiresRestart : false ,
default : 'text' ,
description : 'The format of the CLI output.' ,
showInDialog : true ,
options : [
{ value : 'text' , label : 'Text' } ,
{ value : 'json' , label : 'JSON' } ,
] ,
} ,
} ,
} ,
2025-08-27 18:39:45 -07:00
ui : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'UI' ,
category : 'UI' ,
requiresRestart : false ,
2025-08-10 09:04:52 +09:00
default : { } ,
2025-08-27 18:39:45 -07:00
description : 'User interface settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
properties : {
2025-08-27 18:39:45 -07:00
theme : {
type : 'string' ,
label : 'Theme' ,
category : 'UI' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description : 'The color theme for the UI.' ,
showInDialog : false ,
} ,
customThemes : {
type : 'object' ,
label : 'Custom Themes' ,
category : 'UI' ,
requiresRestart : false ,
default : { } as Record < string , CustomTheme > ,
description : 'Custom theme definitions.' ,
showInDialog : false ,
} ,
hideWindowTitle : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Window Title' ,
category : 'UI' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : false ,
description : 'Hide the window title bar' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-09-28 03:48:24 +08:00
showStatusInTitle : {
type : 'boolean' ,
label : 'Show Status in Title' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description :
'Show Gemini CLI status and thoughts in the terminal window title' ,
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
hideTips : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Tips' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Hide helpful tips in the UI' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
hideBanner : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Banner' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Hide the application banner' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-09-02 10:35:43 -07:00
hideContextSummary : {
type : 'boolean' ,
label : 'Hide Context Summary' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description :
'Hide the context summary (GEMINI.md, MCP servers) above the input.' ,
showInDialog : true ,
} ,
footer : {
type : 'object' ,
label : 'Footer' ,
category : 'UI' ,
requiresRestart : false ,
default : { } ,
description : 'Settings for the footer.' ,
showInDialog : false ,
properties : {
hideCWD : {
type : 'boolean' ,
label : 'Hide CWD' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description :
'Hide the current working directory path in the footer.' ,
showInDialog : true ,
} ,
hideSandboxStatus : {
type : 'boolean' ,
label : 'Hide Sandbox Status' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Hide the sandbox status indicator in the footer.' ,
showInDialog : true ,
} ,
hideModelInfo : {
type : 'boolean' ,
label : 'Hide Model Info' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Hide the model name and context usage in the footer.' ,
showInDialog : true ,
} ,
} ,
} ,
2025-08-27 18:39:45 -07:00
hideFooter : {
2025-08-21 23:31:39 -07:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Footer' ,
category : 'UI' ,
requiresRestart : false ,
2025-08-21 23:31:39 -07:00
default : false ,
2025-08-27 18:39:45 -07:00
description : 'Hide the footer from the UI' ,
2025-08-21 23:31:39 -07:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
showMemoryUsage : {
type : 'boolean' ,
label : 'Show Memory Usage' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Display memory usage information in the UI' ,
showInDialog : true ,
} ,
showLineNumbers : {
type : 'boolean' ,
label : 'Show Line Numbers' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Show line numbers in the chat.' ,
showInDialog : true ,
} ,
2025-08-28 16:42:54 -07:00
showCitations : {
type : 'boolean' ,
label : 'Show Citations' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Show citations for generated text in the chat.' ,
showInDialog : true ,
} ,
2025-10-09 19:27:20 -07:00
useFullWidth : {
type : 'boolean' ,
label : 'Use Full Width' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Use the entire width of the terminal for output.' ,
showInDialog : true ,
} ,
2025-09-03 22:09:04 +05:30
customWittyPhrases : {
type : 'array' ,
label : 'Custom Witty Phrases' ,
category : 'UI' ,
requiresRestart : false ,
default : [ ] as string [ ] ,
description : 'Custom witty phrases to display during loading.' ,
showInDialog : false ,
} ,
2025-08-27 18:39:45 -07:00
accessibility : {
type : 'object' ,
label : 'Accessibility' ,
category : 'UI' ,
requiresRestart : true ,
default : { } ,
description : 'Accessibility settings.' ,
showInDialog : false ,
properties : {
disableLoadingPhrases : {
type : 'boolean' ,
label : 'Disable Loading Phrases' ,
category : 'UI' ,
requiresRestart : true ,
default : false ,
description : 'Disable loading phrases for accessibility' ,
showInDialog : true ,
} ,
screenReader : {
type : 'boolean' ,
label : 'Screen Reader Mode' ,
category : 'UI' ,
requiresRestart : true ,
2025-10-10 15:34:44 -04:00
default : false ,
2025-08-27 18:39:45 -07:00
description :
'Render output in plain-text to be more screen reader accessible' ,
showInDialog : true ,
} ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
} ,
2025-08-27 18:39:45 -07:00
ide : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'IDE' ,
category : 'IDE' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'IDE integration settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
enabled : {
type : 'boolean' ,
label : 'IDE Mode' ,
category : 'IDE' ,
requiresRestart : true ,
default : false ,
description : 'Enable IDE integration mode' ,
showInDialog : true ,
} ,
hasSeenNudge : {
type : 'boolean' ,
label : 'Has Seen IDE Integration Nudge' ,
category : 'IDE' ,
requiresRestart : false ,
default : false ,
description : 'Whether the user has seen the IDE integration nudge.' ,
showInDialog : false ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
privacy : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Privacy' ,
category : 'Privacy' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Privacy-related settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
usageStatisticsEnabled : {
type : 'boolean' ,
label : 'Enable Usage Statistics' ,
category : 'Privacy' ,
requiresRestart : true ,
default : true ,
description : 'Enable collection of usage statistics' ,
showInDialog : false ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
2025-08-10 09:04:52 +09:00
telemetry : {
type : 'object' ,
label : 'Telemetry' ,
category : 'Advanced' ,
requiresRestart : true ,
default : undefined as TelemetrySettings | undefined ,
description : 'Telemetry configuration.' ,
showInDialog : false ,
} ,
2025-08-27 18:39:45 -07:00
model : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Model' ,
category : 'Model' ,
2025-08-10 09:04:52 +09:00
requiresRestart : false ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Settings related to the generative model.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
name : {
type : 'string' ,
label : 'Model' ,
category : 'Model' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description : 'The Gemini model to use for conversations.' ,
showInDialog : false ,
} ,
maxSessionTurns : {
type : 'number' ,
label : 'Max Session Turns' ,
category : 'Model' ,
requiresRestart : false ,
default : - 1 ,
description :
'Maximum number of user/model/tool turns to keep in a session. -1 means unlimited.' ,
showInDialog : true ,
} ,
summarizeToolOutput : {
type : 'object' ,
label : 'Summarize Tool Output' ,
category : 'Model' ,
requiresRestart : false ,
default : undefined as
| Record < string , { tokenBudget ? : number } >
| undefined ,
description : 'Settings for summarizing tool output.' ,
showInDialog : false ,
} ,
chatCompression : {
type : 'object' ,
label : 'Chat Compression' ,
category : 'Model' ,
requiresRestart : false ,
default : undefined as ChatCompressionSettings | undefined ,
description : 'Chat compression settings.' ,
showInDialog : false ,
} ,
skipNextSpeakerCheck : {
type : 'boolean' ,
label : 'Skip Next Speaker Check' ,
category : 'Model' ,
requiresRestart : false ,
2025-09-02 13:37:44 -07:00
default : true ,
2025-08-27 18:39:45 -07:00
description : 'Skip the next speaker check.' ,
showInDialog : true ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
context : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Context' ,
category : 'Context' ,
2025-08-10 09:04:52 +09:00
requiresRestart : false ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Settings for managing context provided to the model.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
fileName : {
type : 'object' ,
label : 'Context File Name' ,
category : 'Context' ,
requiresRestart : false ,
default : undefined as string | string [ ] | undefined ,
description : 'The name of the context file.' ,
showInDialog : false ,
} ,
importFormat : {
type : 'string' ,
label : 'Memory Import Format' ,
category : 'Context' ,
requiresRestart : false ,
default : undefined as MemoryImportFormat | undefined ,
description : 'The format to use when importing memory.' ,
showInDialog : false ,
} ,
discoveryMaxDirs : {
type : 'number' ,
label : 'Memory Discovery Max Dirs' ,
category : 'Context' ,
requiresRestart : false ,
default : 200 ,
description : 'Maximum number of directories to search for memory.' ,
showInDialog : true ,
} ,
includeDirectories : {
type : 'array' ,
label : 'Include Directories' ,
category : 'Context' ,
requiresRestart : false ,
default : [ ] as string [ ] ,
description :
'Additional directories to include in the workspace context. Missing directories will be skipped with a warning.' ,
showInDialog : false ,
2025-09-03 19:23:25 -07:00
mergeStrategy : MergeStrategy.CONCAT ,
2025-08-27 18:39:45 -07:00
} ,
loadMemoryFromIncludeDirectories : {
type : 'boolean' ,
label : 'Load Memory From Include Directories' ,
category : 'Context' ,
requiresRestart : false ,
default : false ,
description : 'Whether to load memory files from include directories.' ,
showInDialog : true ,
} ,
fileFiltering : {
type : 'object' ,
label : 'File Filtering' ,
category : 'Context' ,
requiresRestart : true ,
default : { } ,
description : 'Settings for git-aware file filtering.' ,
showInDialog : false ,
properties : {
respectGitIgnore : {
type : 'boolean' ,
label : 'Respect .gitignore' ,
category : 'Context' ,
requiresRestart : true ,
default : true ,
description : 'Respect .gitignore files when searching' ,
showInDialog : true ,
} ,
respectGeminiIgnore : {
type : 'boolean' ,
label : 'Respect .geminiignore' ,
category : 'Context' ,
requiresRestart : true ,
default : true ,
description : 'Respect .geminiignore files when searching' ,
showInDialog : true ,
} ,
enableRecursiveFileSearch : {
type : 'boolean' ,
label : 'Enable Recursive File Search' ,
category : 'Context' ,
requiresRestart : true ,
default : true ,
description : 'Enable recursive file search functionality' ,
showInDialog : true ,
} ,
disableFuzzySearch : {
type : 'boolean' ,
label : 'Disable Fuzzy Search' ,
category : 'Context' ,
requiresRestart : true ,
default : false ,
description : 'Disable fuzzy search when searching for files.' ,
showInDialog : true ,
} ,
} ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-12 17:08:07 -04:00
2025-08-27 18:39:45 -07:00
tools : {
type : 'object' ,
label : 'Tools' ,
category : 'Tools' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Settings for built-in and custom tools.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
sandbox : {
type : 'object' ,
label : 'Sandbox' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as boolean | string | undefined ,
description :
'Sandbox execution environment (can be a boolean or a path string).' ,
showInDialog : false ,
} ,
2025-09-11 13:27:27 -07:00
shell : {
type : 'object' ,
label : 'Shell' ,
category : 'Tools' ,
requiresRestart : false ,
default : { } ,
description : 'Settings for shell execution.' ,
showInDialog : false ,
properties : {
2025-09-18 13:05:01 -07:00
enableInteractiveShell : {
type : 'boolean' ,
label : 'Enable Interactive Shell' ,
category : 'Tools' ,
requiresRestart : true ,
2025-10-08 13:28:19 -07:00
default : true ,
2025-09-18 13:05:01 -07:00
description :
'Use node-pty for an interactive shell experience. Fallback to child_process still applies.' ,
showInDialog : true ,
} ,
2025-09-11 13:27:27 -07:00
pager : {
type : 'string' ,
label : 'Pager' ,
category : 'Tools' ,
requiresRestart : false ,
default : 'cat' as string | undefined ,
description :
'The pager command to use for shell output. Defaults to `cat`.' ,
showInDialog : false ,
} ,
showColor : {
type : 'boolean' ,
label : 'Show Color' ,
category : 'Tools' ,
requiresRestart : false ,
default : false ,
description : 'Show color in shell output.' ,
showInDialog : true ,
} ,
} ,
} ,
2025-09-03 14:45:52 -07:00
autoAccept : {
type : 'boolean' ,
label : 'Auto Accept' ,
category : 'Tools' ,
requiresRestart : false ,
default : false ,
description :
'Automatically accept and execute tool calls that are considered safe (e.g., read-only operations).' ,
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
core : {
type : 'array' ,
label : 'Core Tools' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description : 'Paths to core tool definitions.' ,
showInDialog : false ,
} ,
allowed : {
type : 'array' ,
label : 'Allowed Tools' ,
category : 'Advanced' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description :
'A list of tool names that will bypass the confirmation dialog.' ,
showInDialog : false ,
} ,
exclude : {
type : 'array' ,
label : 'Exclude Tools' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description : 'Tool names to exclude from discovery.' ,
showInDialog : false ,
2025-09-10 12:28:29 -06:00
mergeStrategy : MergeStrategy.UNION ,
2025-08-27 18:39:45 -07:00
} ,
discoveryCommand : {
type : 'string' ,
label : 'Tool Discovery Command' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string | undefined ,
description : 'Command to run for tool discovery.' ,
showInDialog : false ,
} ,
callCommand : {
type : 'string' ,
label : 'Tool Call Command' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string | undefined ,
description : 'Command to run for tool calls.' ,
showInDialog : false ,
} ,
useRipgrep : {
type : 'boolean' ,
label : 'Use Ripgrep' ,
category : 'Tools' ,
requiresRestart : false ,
2025-09-11 16:46:07 -07:00
default : true ,
2025-08-27 18:39:45 -07:00
description :
'Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance.' ,
showInDialog : true ,
} ,
2025-09-09 13:01:25 -07:00
enableToolOutputTruncation : {
type : 'boolean' ,
label : 'Enable Tool Output Truncation' ,
category : 'General' ,
requiresRestart : true ,
2025-09-29 09:30:37 -07:00
default : true ,
2025-09-09 13:01:25 -07:00
description : 'Enable truncation of large tool outputs.' ,
showInDialog : true ,
} ,
2025-09-05 15:37:29 -07:00
truncateToolOutputThreshold : {
type : 'number' ,
label : 'Tool Output Truncation Threshold' ,
category : 'General' ,
2025-09-09 13:01:25 -07:00
requiresRestart : true ,
2025-09-05 15:37:29 -07:00
default : DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD ,
description :
'Truncate tool output if it is larger than this many characters. Set to -1 to disable.' ,
showInDialog : true ,
} ,
truncateToolOutputLines : {
type : 'number' ,
label : 'Tool Output Truncation Lines' ,
category : 'General' ,
2025-09-09 13:01:25 -07:00
requiresRestart : true ,
2025-09-05 15:37:29 -07:00
default : DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES ,
description : 'The number of lines to keep when truncating tool output.' ,
showInDialog : true ,
} ,
2025-09-22 12:03:20 -07:00
enableMessageBusIntegration : {
type : 'boolean' ,
label : 'Enable Message Bus Integration' ,
category : 'Tools' ,
requiresRestart : true ,
default : false ,
description :
'Enable policy-based tool confirmation via message bus integration. When enabled, tools will automatically respect policy engine decisions (ALLOW/DENY/ASK_USER) without requiring individual tool implementations.' ,
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
mcp : {
type : 'object' ,
label : 'MCP' ,
category : 'MCP' ,
requiresRestart : true ,
default : { } ,
description : 'Settings for Model Context Protocol (MCP) servers.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
serverCommand : {
type : 'string' ,
label : 'MCP Server Command' ,
category : 'MCP' ,
requiresRestart : true ,
default : undefined as string | undefined ,
description : 'Command to start an MCP server.' ,
showInDialog : false ,
} ,
allowed : {
type : 'array' ,
label : 'Allow MCP Servers' ,
category : 'MCP' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
2025-09-02 18:09:28 -06:00
description : 'A list of MCP servers to allow.' ,
2025-08-27 18:39:45 -07:00
showInDialog : false ,
} ,
excluded : {
type : 'array' ,
label : 'Exclude MCP Servers' ,
category : 'MCP' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
2025-09-02 18:09:28 -06:00
description : 'A list of MCP servers to exclude.' ,
2025-08-27 18:39:45 -07:00
showInDialog : false ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-29 15:45:39 -04:00
useSmartEdit : {
type : 'boolean' ,
label : 'Use Smart Edit' ,
category : 'Advanced' ,
requiresRestart : false ,
2025-10-13 15:05:08 -04:00
default : true ,
2025-08-29 15:45:39 -04:00
description : 'Enable the smart-edit tool instead of the replace tool.' ,
2025-09-20 06:01:02 -07:00
showInDialog : false ,
} ,
useWriteTodos : {
type : 'boolean' ,
label : 'Use Write Todos' ,
category : 'Advanced' ,
requiresRestart : false ,
default : false ,
description : 'Enable the write_todos_list tool.' ,
2025-08-29 15:45:39 -04:00
showInDialog : false ,
} ,
2025-08-27 18:39:45 -07:00
security : {
type : 'object' ,
label : 'Security' ,
category : 'Security' ,
requiresRestart : true ,
default : { } ,
description : 'Security-related settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
folderTrust : {
type : 'object' ,
label : 'Folder Trust' ,
category : 'Security' ,
requiresRestart : false ,
default : { } ,
description : 'Settings for folder trust.' ,
showInDialog : false ,
properties : {
enabled : {
type : 'boolean' ,
label : 'Folder Trust' ,
category : 'Security' ,
2025-08-29 16:31:04 -04:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : false ,
description : 'Setting to track whether Folder trust is enabled.' ,
showInDialog : true ,
} ,
} ,
} ,
auth : {
type : 'object' ,
label : 'Authentication' ,
category : 'Security' ,
requiresRestart : true ,
default : { } ,
description : 'Authentication settings.' ,
showInDialog : false ,
properties : {
selectedType : {
type : 'string' ,
label : 'Selected Auth Type' ,
category : 'Security' ,
requiresRestart : true ,
default : undefined as AuthType | undefined ,
description : 'The currently selected authentication type.' ,
showInDialog : false ,
} ,
2025-09-03 15:33:37 -07:00
enforcedType : {
type : 'string' ,
label : 'Enforced Auth Type' ,
category : 'Advanced' ,
requiresRestart : true ,
default : undefined as AuthType | undefined ,
description :
'The required auth type. If this does not match the selected auth type, the user will be prompted to re-authenticate.' ,
showInDialog : false ,
} ,
2025-08-27 18:39:45 -07:00
useExternal : {
type : 'boolean' ,
label : 'Use External Auth' ,
category : 'Security' ,
requiresRestart : true ,
default : undefined as boolean | undefined ,
description : 'Whether to use an external authentication flow.' ,
showInDialog : false ,
} ,
} ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
advanced : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Advanced' ,
category : 'Advanced' ,
requiresRestart : true ,
default : { } ,
description : 'Advanced settings for power users.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
autoConfigureMemory : {
type : 'boolean' ,
label : 'Auto Configure Max Old Space Size' ,
category : 'Advanced' ,
requiresRestart : true ,
default : false ,
description : 'Automatically configure Node.js memory limits' ,
showInDialog : false ,
} ,
dnsResolutionOrder : {
type : 'string' ,
label : 'DNS Resolution Order' ,
category : 'Advanced' ,
requiresRestart : true ,
default : undefined as DnsResolutionOrder | undefined ,
description : 'The DNS resolution order.' ,
showInDialog : false ,
} ,
excludedEnvVars : {
type : 'array' ,
label : 'Excluded Project Environment Variables' ,
category : 'Advanced' ,
requiresRestart : false ,
default : [ 'DEBUG' , 'DEBUG_MODE' ] as string [ ] ,
description : 'Environment variables to exclude from project context.' ,
showInDialog : false ,
2025-09-03 19:23:25 -07:00
mergeStrategy : MergeStrategy.UNION ,
2025-08-27 18:39:45 -07:00
} ,
bugCommand : {
type : 'object' ,
label : 'Bug Command' ,
category : 'Advanced' ,
requiresRestart : false ,
default : undefined as BugCommandSettings | undefined ,
description : 'Configuration for the bug report command.' ,
showInDialog : false ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
experimental : {
type : 'object' ,
label : 'Experimental' ,
category : 'Experimental' ,
2025-08-25 17:02:10 +00:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Setting to enable experimental features' ,
2025-08-25 17:02:10 +00:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
extensionManagement : {
type : 'boolean' ,
label : 'Extension Management' ,
category : 'Experimental' ,
requiresRestart : true ,
2025-09-05 11:44:41 -07:00
default : true ,
2025-08-27 18:39:45 -07:00
description : 'Enable extension management features.' ,
showInDialog : false ,
} ,
2025-09-12 15:57:07 -04:00
useModelRouter : {
type : 'boolean' ,
label : 'Use Model Router' ,
category : 'Experimental' ,
requiresRestart : true ,
2025-09-30 23:10:10 -04:00
default : false ,
2025-09-12 15:57:07 -04:00
description :
'Enable model routing to route requests to the best model based on complexity.' ,
2025-09-24 17:33:14 -04:00
showInDialog : true ,
2025-09-12 15:57:07 -04:00
} ,
2025-10-13 22:30:32 -04:00
codebaseInvestigatorSettings : {
type : 'object' ,
label : 'Codebase Investigator Settings' ,
2025-10-01 16:54:00 -04:00
category : 'Experimental' ,
requiresRestart : true ,
2025-10-13 22:30:32 -04:00
default : { } ,
description : 'Configuration for Codebase Investigator.' ,
2025-10-01 16:54:00 -04:00
showInDialog : false ,
2025-10-13 22:30:32 -04:00
properties : {
enabled : {
type : 'boolean' ,
label : 'Enable Codebase Investigator' ,
category : 'Experimental' ,
requiresRestart : true ,
default : false ,
description : 'Enable the Codebase Investigator agent.' ,
showInDialog : true ,
} ,
maxNumTurns : {
type : 'number' ,
label : 'Codebase Investigator Max Num Turns' ,
category : 'Experimental' ,
requiresRestart : true ,
default : 15 ,
description :
'Maximum number of turns for the Codebase Investigator agent.' ,
showInDialog : true ,
} ,
maxTimeMinutes : {
type : 'number' ,
label : 'Max Time (Minutes)' ,
category : 'Experimental' ,
requiresRestart : true ,
default : 5 ,
description :
'Maximum time for the Codebase Investigator agent (in minutes).' ,
showInDialog : false ,
} ,
thinkingBudget : {
type : 'number' ,
label : 'Thinking Budget' ,
category : 'Experimental' ,
requiresRestart : true ,
default : - 1 ,
description :
'The thinking budget for the Codebase Investigator agent.' ,
showInDialog : false ,
} ,
model : {
type : 'string' ,
label : 'Model' ,
category : 'Experimental' ,
requiresRestart : true ,
default : DEFAULT_GEMINI_MODEL ,
description :
'The model to use for the Codebase Investigator agent.' ,
showInDialog : false ,
} ,
} ,
2025-10-01 16:54:00 -04:00
} ,
2025-08-27 18:39:45 -07:00
} ,
2025-08-25 17:02:10 +00:00
} ,
2025-08-27 18:39:45 -07:00
2025-08-26 14:36:55 +00:00
extensions : {
type : 'object' ,
label : 'Extensions' ,
category : 'Extensions' ,
requiresRestart : true ,
default : { } ,
description : 'Settings for extensions.' ,
showInDialog : false ,
properties : {
disabled : {
type : 'array' ,
label : 'Disabled Extensions' ,
category : 'Extensions' ,
requiresRestart : true ,
default : [ ] as string [ ] ,
description : 'List of disabled extensions.' ,
showInDialog : false ,
2025-09-03 19:23:25 -07:00
mergeStrategy : MergeStrategy.UNION ,
2025-08-26 14:36:55 +00:00
} ,
2025-08-27 00:43:02 +00:00
workspacesWithMigrationNudge : {
type : 'array' ,
label : 'Workspaces with Migration Nudge' ,
category : 'Extensions' ,
requiresRestart : false ,
default : [ ] as string [ ] ,
description :
'List of workspaces for which the migration nudge has been shown.' ,
showInDialog : false ,
2025-09-03 19:23:25 -07:00
mergeStrategy : MergeStrategy.UNION ,
2025-08-27 00:43:02 +00:00
} ,
2025-08-26 14:36:55 +00:00
} ,
} ,
2025-09-08 10:01:18 -04:00
} as const satisfies SettingsSchema ;
export type SettingsSchemaType = typeof SETTINGS_SCHEMA ;
export function getSettingsSchema ( ) : SettingsSchemaType {
return SETTINGS_SCHEMA ;
}
2025-08-10 09:04:52 +09:00
type InferSettings < T extends SettingsSchema > = {
- readonly [ K in keyof T ] ? : T [ K ] extends { properties : SettingsSchema }
? InferSettings < T [ K ] [ 'properties' ] >
2025-10-01 11:32:18 -04:00
: T [ K ] [ 'type' ] extends 'enum'
? T [ K ] [ 'options' ] extends readonly SettingEnumOption [ ]
? T [ K ] [ 'options' ] [ number ] [ 'value' ]
: T [ K ] [ 'default' ]
: T [ K ] [ 'default' ] extends boolean
? boolean
: T [ K ] [ 'default' ] ;
2025-08-10 09:04:52 +09:00
} ;
2025-09-08 10:01:18 -04:00
export type Settings = InferSettings < SettingsSchemaType > ;
2025-09-02 10:35:43 -07:00
export interface FooterSettings {
hideCWD? : boolean ;
hideSandboxStatus? : boolean ;
hideModelInfo? : boolean ;
}