config

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BashToolConfig added in v0.14.1

type BashToolConfig struct {
	Enabled         bool                `yaml:"enabled"`
	Whitelist       ToolWhitelistConfig `yaml:"whitelist"`
	RequireApproval *bool               `yaml:"require_approval,omitempty"`
}

BashToolConfig contains bash-specific tool settings

type ChatConfig added in v0.8.0

type ChatConfig struct {
	DefaultModel string `yaml:"default_model"`
	SystemPrompt string `yaml:"system_prompt"`
}

ChatConfig contains chat-related settings

type CompactConfig added in v0.2.0

type CompactConfig struct {
	OutputDir string `yaml:"output_dir"`
}

CompactConfig contains settings for compact command

type Config

type Config struct {
	Gateway GatewayConfig `yaml:"gateway"`
	Output  OutputConfig  `yaml:"output"`
	Tools   ToolsConfig   `yaml:"tools"`
	Compact CompactConfig `yaml:"compact"`
	Chat    ChatConfig    `yaml:"chat"`
}

Config represents the CLI configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig loads configuration from file

func (*Config) IsApprovalRequired added in v0.14.1

func (c *Config) IsApprovalRequired(toolName string) bool

IsApprovalRequired checks if approval is required for a specific tool It returns true if tool-specific approval is set to true, or if global approval is true and tool-specific is not set to false

func (*Config) SaveConfig

func (c *Config) SaveConfig(configPath string) error

SaveConfig saves configuration to file

type DeleteToolConfig added in v0.18.0

type DeleteToolConfig struct {
	Enabled           bool     `yaml:"enabled"`
	RequireApproval   *bool    `yaml:"require_approval,omitempty"`
	ProtectedPaths    []string `yaml:"protected_paths"`
	AllowWildcards    bool     `yaml:"allow_wildcards"`
	RestrictToWorkDir bool     `yaml:"restrict_to_workdir"`
}

DeleteToolConfig contains delete-specific tool settings

type EditToolConfig added in v0.21.0

type EditToolConfig struct {
	Enabled         bool  `yaml:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty"`
}

EditToolConfig contains edit-specific tool settings

type FetchCacheConfig added in v0.11.0

type FetchCacheConfig struct {
	Enabled bool  `yaml:"enabled"`
	TTL     int   `yaml:"ttl"`
	MaxSize int64 `yaml:"max_size"`
}

FetchCacheConfig contains cache settings for fetch operations

type FetchSafetyConfig added in v0.11.0

type FetchSafetyConfig struct {
	MaxSize       int64 `yaml:"max_size"`
	Timeout       int   `yaml:"timeout"`
	AllowRedirect bool  `yaml:"allow_redirect"`
}

FetchSafetyConfig contains safety settings for fetch operations

type FetchToolConfig added in v0.14.1

type FetchToolConfig struct {
	Enabled            bool              `yaml:"enabled"`
	WhitelistedDomains []string          `yaml:"whitelisted_domains"`
	GitHub             GitHubFetchConfig `yaml:"github"`
	Safety             FetchSafetyConfig `yaml:"safety"`
	Cache              FetchCacheConfig  `yaml:"cache"`
	RequireApproval    *bool             `yaml:"require_approval,omitempty"`
}

FetchToolConfig contains fetch-specific tool settings

type GatewayConfig

type GatewayConfig struct {
	URL     string `yaml:"url"`
	APIKey  string `yaml:"api_key"`
	Timeout int    `yaml:"timeout"`
}

GatewayConfig contains gateway connection settings

type GitHubFetchConfig added in v0.11.0

type GitHubFetchConfig struct {
	Enabled bool   `yaml:"enabled"`
	Token   string `yaml:"token"`
	BaseURL string `yaml:"base_url"`
}

GitHubFetchConfig contains GitHub-specific fetch settings

type GrepToolConfig added in v0.19.0

type GrepToolConfig struct {
	Enabled         bool   `yaml:"enabled"`
	Backend         string `yaml:"backend"`
	RequireApproval *bool  `yaml:"require_approval,omitempty"`
}

GrepToolConfig contains grep-specific tool settings

type OutputConfig

type OutputConfig struct {
	Format string `yaml:"format"`
	Quiet  bool   `yaml:"quiet"`
	Debug  bool   `yaml:"debug"`
}

OutputConfig contains output formatting settings

type ReadToolConfig added in v0.14.1

type ReadToolConfig struct {
	Enabled         bool  `yaml:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty"`
}

ReadToolConfig contains read-specific tool settings

type SafetyConfig added in v0.3.0

type SafetyConfig struct {
	RequireApproval bool `yaml:"require_approval"`
}

SafetyConfig contains safety approval settings

type TodoWriteToolConfig added in v0.20.0

type TodoWriteToolConfig struct {
	Enabled         bool  `yaml:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty"`
}

TodoWriteToolConfig contains TodoWrite-specific tool settings

type ToolWhitelistConfig

type ToolWhitelistConfig struct {
	Commands []string `yaml:"commands"`
	Patterns []string `yaml:"patterns"`
}

ToolWhitelistConfig contains whitelisted commands and patterns

type ToolsConfig

type ToolsConfig struct {
	Enabled      bool                `yaml:"enabled"`
	Bash         BashToolConfig      `yaml:"bash"`
	Read         ReadToolConfig      `yaml:"read"`
	Write        WriteToolConfig     `yaml:"write"`
	Edit         EditToolConfig      `yaml:"edit"`
	Delete       DeleteToolConfig    `yaml:"delete"`
	Grep         GrepToolConfig      `yaml:"grep"`
	Tree         TreeToolConfig      `yaml:"tree"`
	Fetch        FetchToolConfig     `yaml:"fetch"`
	WebSearch    WebSearchToolConfig `yaml:"web_search"`
	TodoWrite    TodoWriteToolConfig `yaml:"todo_write"`
	Safety       SafetyConfig        `yaml:"safety"`
	ExcludePaths []string            `yaml:"exclude_paths"`
}

ToolsConfig contains tool execution settings

type TreeToolConfig added in v0.16.0

type TreeToolConfig struct {
	Enabled         bool  `yaml:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty"`
}

TreeToolConfig contains tree-specific tool settings

type WebSearchToolConfig added in v0.14.1

type WebSearchToolConfig struct {
	Enabled         bool     `yaml:"enabled"`
	DefaultEngine   string   `yaml:"default_engine"`
	MaxResults      int      `yaml:"max_results"`
	Engines         []string `yaml:"engines"`
	Timeout         int      `yaml:"timeout"`
	RequireApproval *bool    `yaml:"require_approval,omitempty"`
}

WebSearchToolConfig contains web search-specific tool settings

type WriteToolConfig added in v0.17.0

type WriteToolConfig struct {
	Enabled         bool  `yaml:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty"`
}

WriteToolConfig contains write-specific tool settings

Jump to

Keyboard shortcuts

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