config

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2026 Teradata

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package config provides configuration types compatible with Crush's interface.

Index

Constants

This section is empty.

Variables

View Source
var Providers = []string{"anthropic", "bedrock", "ollama"}

Providers returns available model providers.

Functions

func HasInitialDataConfig

func HasInitialDataConfig() bool

HasInitialDataConfig returns true if initial data is configured.

func ProjectNeedsInitialization

func ProjectNeedsInitialization() (bool, error)

ProjectNeedsInitialization returns true if the project needs initialization. Returns (needsInit, error).

func Set

func Set(cfg *Config)

Set sets the global configuration.

Types

type Agent

type Agent struct {
	Type AgentType
	Name string
}

Agent represents an agent configuration.

type AgentType

type AgentType string

AgentType represents the type of agent.

const (
	AgentCoder    AgentType = "coder"
	AgentResearch AgentType = "research"
)

type Config

type Config struct {

	// Options
	Options Options
	// contains filtered or unexported fields
}

Config represents application configuration.

func Get

func Get() *Config

Get returns the global configuration.

func (*Config) Agents

func (c *Config) Agents() map[AgentType]Agent

Agents returns configured agents.

func (*Config) GetModel

func (c *Config) GetModel() *Model

GetModel returns the current model configuration.

func (*Config) GetModelByType

func (c *Config) GetModelByType(modelType SelectedModelType) *Model

GetModelByType returns the model for a given type.

func (*Config) GetProviderForModel

func (c *Config) GetProviderForModel(modelID string) string

GetProviderForModel returns the provider for a model.

func (*Config) IsConfigured

func (c *Config) IsConfigured() bool

IsConfigured returns true if the configuration is complete.

func (*Config) LSP

func (c *Config) LSP() *LSPConfig

LSP returns the LSP configuration.

func (*Config) MCP

func (c *Config) MCP() *MCPConfig

MCP returns the MCP configuration.

func (*Config) Models

func (c *Config) Models() []Model

Models returns the model list.

func (*Config) SetCompactMode

func (c *Config) SetCompactMode(compact bool)

SetCompactMode sets the compact mode option.

func (*Config) SetWorkingDir

func (c *Config) SetWorkingDir(dir string)

SetWorkingDir sets the working directory.

func (*Config) UpdatePreferredModel

func (c *Config) UpdatePreferredModel(modelType SelectedModelType, model Model) error

UpdatePreferredModel updates the preferred model.

func (*Config) WorkingDir

func (c *Config) WorkingDir() string

WorkingDir returns the working directory.

type GlobalConfigData

type GlobalConfigData struct {
	ConfigDir string
}

GlobalConfigData holds global config information.

type LSPConfig

type LSPConfig struct {
	Enabled bool
}

LSPConfig represents LSP configuration.

type MCPConfig

type MCPConfig struct {
	Enabled bool
}

MCPConfig represents MCP configuration.

type Model

type Model struct {
	Provider               string
	Model                  string
	Name                   string
	ContextWindow          int
	DefaultReasoningEffort string
	ReasoningLevels        []string
	SupportsReasoning      bool
	SupportsImages         bool
}

Model represents an LLM model configuration.

func (*Model) CanReason

func (m *Model) CanReason() bool

CanReason returns whether the model supports reasoning.

type Options

type Options struct {
	TUI TUIOptions
}

Options represents TUI options.

type SelectedModel

type SelectedModel struct {
	Provider string
	Model    string
	Name     string
}

SelectedModel represents the currently selected model.

type SelectedModelType

type SelectedModelType string

SelectedModelType represents the type of selected model.

const (
	SelectedModelTypeLarge SelectedModelType = "large"
	SelectedModelTypeSmall SelectedModelType = "small"
)

type TUIOptions

type TUIOptions struct {
	DiffMode    string
	CompactMode bool
}

TUIOptions represents TUI-specific options.

Jump to

Keyboard shortcuts

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