8.3 KiB
Feature Lifecycle
Gemini CLI uses a Feature Lifecycle management system to handle the introduction, maturation, and deprecation of new and optional features.
Feature Stages
Features progress through the following stages:
| Stage | Default | UI Badge | Description |
|---|---|---|---|
| ALPHA | Disabled | [ALPHA] |
Early-access features. May be unstable, change significantly, or be removed without notice. |
| BETA | Enabled | [BETA] |
Features that are well-tested and considered stable. Can be disabled if issues arise. |
| GA | Enabled | - | Stable features that are part of the core product. Cannot be disabled. |
| DEPRECATED | Disabled | [DEPRECATED] |
Features scheduled for removal. Using them triggers a warning. |
Configuration
The feature lifecycle can be configured in several ways:
settings.json: Use thefeaturesobject to toggle specific features or entire stages.features.allAlpha: Enable/disable all Alpha features.features.allBeta: Enable/disable all Beta features.features.<featureName>: Toggle an individual feature.
- CLI Flag: Use
--feature-gates="feat1=true,feat2=false"for runtime overrides. - Environment Variable: Set
GEMINI_FEATURE_GATES="feat1=true,feat2=false".
The stability of each feature is visually indicated in the
/settings UI with colored badges. GA features are
considerd stable and look identical to standard settings.
Precedence and Reconciliation
When determining if a feature is enabled, the system follows this order of precedence (highest priority first):
- Global Lock: Features in the GA stage are locked to
trueand cannot be disabled. - CLI Flags & Environment Variables: Runtime overrides (
--feature-gatesorGEMINI_FEATURE_GATES) override persistent settings. - Individual Toggle: Specific feature toggles in
settings.json(e.g.,"features": { "plan": true }). - Meta Toggles: Stage-wide toggles in
settings.json(allAlphaorallBeta). For example, ifallAlphaistrue, all Alpha features are enabled unless specifically disabled by an individual toggle. - Stage Default: The inherent default for the feature's current stage (Alpha: Disabled, Beta/GA: Enabled).
For more details on persistent configuration, see the Configuration guide.
Available Features
| Feature | Stage | Default | Since | Description |
|---|---|---|---|---|
enableAgents |
ALPHA | Disabled | 0.30.0 | Enable local and remote subagents. |
extensionConfig |
BETA | Enabled | 0.30.0 | Enable requesting and fetching of extension settings. |
extensionManagement |
BETA | Enabled | 0.30.0 | Enable extension management features. |
extensionRegistry |
ALPHA | Disabled | 0.30.0 | Enable extension registry explore UI. |
extensionReloading |
ALPHA | Disabled | 0.30.0 | Enables extension loading/unloading within the CLI session. |
jitContext |
ALPHA | Disabled | 0.30.0 | Enable Just-In-Time (JIT) context loading. |
plan |
ALPHA | Disabled | 0.30.0 | Enable planning features (Plan Mode and tools). |
toolOutputMasking |
BETA | Enabled | 0.30.0 | Enables tool output masking to save tokens. |
useOSC52Paste |
ALPHA | Disabled | 0.30.0 | Use OSC 52 sequence for pasting. |
zedIntegration |
ALPHA | Disabled | 0.30.0 | Enable Zed integration. |
Managing Feature Lifecycle
Maintaining a feature involves promoting it through stages or eventually deprecating and removing it.
Adding a Feature
To add a new feature under lifecycle management:
-
Define the Feature: Add a new entry to
FeatureDefinitionsinfeatures.ts.export const FeatureDefinitions: Record<string, FeatureSpec[]> = { // ... existing features myNewFeature: [ { lockToDefault: false, preRelease: FeatureStage.Alpha, since: '0.31.0', description: 'Description of my new feature.', }, ], };Note: The
defaultfield is optional. If omitted, it defaults tofalsefor Alpha/Deprecated andtruefor Beta/GA. -
Expose in Settings: Add the feature to the
featuresobject insettingsSchema.ts. This ensures it appears in the/settingsUI and is validated.features: { // ... properties: { // ... myNewFeature: { type: 'boolean', label: 'My New Feature', category: 'Features', requiresRestart: true, // or false description: 'Description of my new feature.', showInDialog: true, }, }, }, -
Use the Feature: In your code, check if the feature is enabled using the
Configobject.if (this.config.isFeatureEnabled('myNewFeature')) { // Feature logic }
Promoting a Feature
When a feature is ready for the next stage:
- Update
features.ts: Add a newFeatureSpecto the feature's array.- To BETA: Set
preRelease: FeatureStage.Beta(Defaults totrue). - To GA: Set
preRelease: FeatureStage.GA(Defaults totrueand locked). - Update the
sinceversion.
- To BETA: Set
- Update
settingsSchema.ts: Update thelabelanddescriptionif necessary. - GA Cleanup: Once a feature is GA and no longer optional, remove the feature gate check from the code and make it a core part of the logic.
Deprecating a Feature
This stage is for Beta and GA features scheduled for removal.
- Update
features.ts: Add a newFeatureSpecwithpreRelease: FeatureStage.Deprecated.- Optionally set
default: trueif it should remain enabled during deprecation (it defaults tofalse). - Optionally set an
untilversion to indicate when it will be removed.
- Optionally set
- Update
settingsSchema.ts: Update the description to notify users of the deprecation and suggest alternatives.
Removing a Feature
Alpha features can be removed without formal deprecation. Beta and GA features should typically go through a deprecation period first.
To completely remove a feature:
- Cleanup Code: Remove all logic and tests associated with the feature.
- Update
features.ts: Remove the feature fromFeatureDefinitions. - Update
settingsSchema.ts: Remove the feature from thefeaturesobject. - Legacy Settings: If the feature had a legacy
experimentalflag, ensure its migration logic is cleaned up inconfig.ts.