config

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config provides configuration loading for g. This file was modified from the original Gemini CLI. Copyright 2025 Google LLC Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeminiDir

func GeminiDir() (string, error)

GeminiDir returns the path to ~/.gemini

func SaveCachedState

func SaveCachedState(state *CachedState) error

SaveCachedState saves the cached state to gmn_state.json

Types

type AuthConfig

type AuthConfig struct {
	SelectedType string `json:"selectedType"`
}

AuthConfig holds authentication settings

type CachedState

type CachedState struct {
	ProjectID string `json:"projectId,omitempty"`
	UserTier  string `json:"userTier,omitempty"`
}

CachedState represents cached state for geminimini

func LoadCachedState

func LoadCachedState() (*CachedState, error)

LoadCachedState loads the cached state from gmn_state.json

type Config

type Config struct {
	Security   SecurityConfig             `json:"security"`
	MCPServers map[string]MCPServerConfig `json:"mcpServers"`
	General    GeneralConfig              `json:"general"`
	Output     OutputConfig               `json:"output"`
}

Config is the main configuration structure

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration

func Load

func Load() (*Config, error)

Load loads the configuration from ~/.gemini/settings.json

type GeneralConfig

type GeneralConfig struct {
	PreviewFeatures bool `json:"previewFeatures"`
}

GeneralConfig holds general settings

type MCPServerConfig

type MCPServerConfig struct {
	// Stdio transport
	Command string            `json:"command,omitempty"`
	Args    []string          `json:"args,omitempty"`
	Env     map[string]string `json:"env,omitempty"`
	CWD     string            `json:"cwd,omitempty"`

	// HTTP/SSE transport
	URL     string            `json:"url,omitempty"`
	Type    string            `json:"type,omitempty"` // "sse" | "http"
	Headers map[string]string `json:"headers,omitempty"`

	// Common
	Timeout      int      `json:"timeout,omitempty"`
	Trust        bool     `json:"trust,omitempty"`
	IncludeTools []string `json:"includeTools,omitempty"`
	ExcludeTools []string `json:"excludeTools,omitempty"`
}

MCPServerConfig holds MCP server configuration

type OutputConfig

type OutputConfig struct {
	Format string `json:"format"`
}

OutputConfig holds output settings

type SecurityConfig

type SecurityConfig struct {
	Auth AuthConfig `json:"auth"`
}

SecurityConfig holds security-related settings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL