Documentation
¶
Index ¶
- Constants
- func CanonicalRepoPath(path string) string
- func WithConfig(ctx context.Context, config ContextConfig) context.Context
- type AlreadyInstalledConfig
- type ContextConfig
- type FailedInstallation
- type GlobalConfig
- func (gc *GlobalConfig) AddToAlreadyInstalled(itemName, itemType string)
- func (gc *GlobalConfig) AddToConfig(itemName, itemType, configType string)
- func (gc *GlobalConfig) AddToFailed(packageName, category, errorMessage string, attemptCount int)
- func (gc *GlobalConfig) AddToInstalled(itemName, itemType string)
- func (gc *GlobalConfig) Create() error
- func (gc *GlobalConfig) DisableShellFeature(featureName string)
- func (gc *GlobalConfig) EnableShellFeature(featureName string)
- func (gc *GlobalConfig) IsAlreadyInstalled(itemName, itemType string) bool
- func (gc *GlobalConfig) IsInstalledByDevgeta(itemName, itemType string) bool
- func (gc *GlobalConfig) IsShellFeatureEnabled(featureName string) bool
- func (gc *GlobalConfig) IsTracked(itemName, itemType, configType string) bool
- func (gc *GlobalConfig) Load() error
- func (gc *GlobalConfig) ReconcileShellFeatures()
- func (gc *GlobalConfig) RegenerateShellConfig() error
- func (gc *GlobalConfig) RemoveFromInstalled(itemName, itemType string)
- func (gc *GlobalConfig) Reset() error
- func (gc *GlobalConfig) Save() error
- type InstalledConfig
- type IntegrationsConfig
- type RecentRepo
- type ShellFeatures
- type WorktreeConfig
Constants ¶
const ConfigKey = "devgeta-config-context"
Variables ¶
This section is empty.
Functions ¶
func CanonicalRepoPath ¶
CanonicalRepoPath normalizes a repo path to one canonical string form so the same repo is never tracked under multiple representations: expand a leading "~", make it absolute, clean it, then best-effort resolve symlinks (falling back to the cleaned absolute path when a path doesn't exist yet or symlink resolution otherwise fails). Every source that feeds the repo-candidates provider (recent-repos store, cursor repo, zoxide results) must canonicalize through this same function to dedupe correctly.
func WithConfig ¶
func WithConfig(ctx context.Context, config ContextConfig) context.Context
Function to store the config in context
Types ¶
type AlreadyInstalledConfig ¶
type AlreadyInstalledConfig struct {
Packages []string `yaml:"packages"`
DesktopApps []string `yaml:"desktop_apps"`
Fonts []string `yaml:"fonts"`
Themes []string `yaml:"themes"`
TerminalTools []string `yaml:"terminal_tools"`
DevLanguages []string `yaml:"dev_languages"`
Databases []string `yaml:"databases"`
}
Used to store config that user already had installed before using this app
type ContextConfig ¶
type FailedInstallation ¶
type FailedInstallation struct {
PackageName string `yaml:"package_name"`
Category string `yaml:"category"` // "package" | "dev_language" | "database"
ErrorMessage string `yaml:"error_message"`
FailedAt time.Time `yaml:"failed_at"`
AttemptCount int `yaml:"attempt_count"`
}
FailedInstallation tracks packages that failed to install
type GlobalConfig ¶
type GlobalConfig struct {
AppPath string `yaml:"app_path"`
ConfigPath string `yaml:"config_path"`
AlreadyInstalled AlreadyInstalledConfig `yaml:"already_installed"`
CurrentFont string `yaml:"current_font"`
CurrentTheme string `yaml:"current_theme"`
Installed InstalledConfig `yaml:"installed"`
Shortcuts map[string]string `yaml:"shortcuts"`
Shell ShellFeatures `yaml:"shell"`
FailedInstallations []FailedInstallation `yaml:"failed_installations,omitempty"`
Worktree WorktreeConfig `yaml:"worktree"`
Integrations IntegrationsConfig `yaml:"integrations,omitempty"`
}
func (*GlobalConfig) AddToAlreadyInstalled ¶
func (gc *GlobalConfig) AddToAlreadyInstalled(itemName, itemType string)
func (*GlobalConfig) AddToConfig ¶
func (gc *GlobalConfig) AddToConfig(itemName, itemType, configType string)
func (*GlobalConfig) AddToFailed ¶
func (gc *GlobalConfig) AddToFailed(packageName, category, errorMessage string, attemptCount int)
AddToFailed adds a package to the failed installations list It stores the package name, category, error message, timestamp, and attempt count
func (*GlobalConfig) AddToInstalled ¶
func (gc *GlobalConfig) AddToInstalled(itemName, itemType string)
AddToInstalled adds an item to the installed config
func (*GlobalConfig) Create ¶
func (gc *GlobalConfig) Create() error
func (*GlobalConfig) DisableShellFeature ¶
func (gc *GlobalConfig) DisableShellFeature(featureName string)
DisableShellFeature disables a shell feature by name
func (*GlobalConfig) EnableShellFeature ¶
func (gc *GlobalConfig) EnableShellFeature(featureName string)
EnableShellFeature enables a shell feature by name
func (*GlobalConfig) IsAlreadyInstalled ¶
func (gc *GlobalConfig) IsAlreadyInstalled(itemName, itemType string) bool
func (*GlobalConfig) IsInstalledByDevgeta ¶
func (gc *GlobalConfig) IsInstalledByDevgeta(itemName, itemType string) bool
func (*GlobalConfig) IsShellFeatureEnabled ¶
func (gc *GlobalConfig) IsShellFeatureEnabled(featureName string) bool
IsShellFeatureEnabled checks if a shell feature is enabled
func (*GlobalConfig) IsTracked ¶
func (gc *GlobalConfig) IsTracked(itemName, itemType, configType string) bool
func (*GlobalConfig) Load ¶
func (gc *GlobalConfig) Load() error
func (*GlobalConfig) ReconcileShellFeatures ¶
func (gc *GlobalConfig) ReconcileShellFeatures()
ReconcileShellFeatures detects which tools are installed on the system and enables their corresponding shell features. This makes the config self-healing: even if shell feature booleans were lost, they are restored based on what's actually installed.
func (*GlobalConfig) RegenerateShellConfig ¶
func (gc *GlobalConfig) RegenerateShellConfig() error
func (*GlobalConfig) RemoveFromInstalled ¶
func (gc *GlobalConfig) RemoveFromInstalled(itemName, itemType string)
RemoveFromInstalled removes itemName from the installed tracking list for itemType.
func (*GlobalConfig) Reset ¶
func (gc *GlobalConfig) Reset() error
func (*GlobalConfig) Save ¶
func (gc *GlobalConfig) Save() error
type InstalledConfig ¶
type InstalledConfig struct {
Packages []string `yaml:"packages"`
DesktopApps []string `yaml:"desktop_apps"`
Fonts []string `yaml:"fonts"`
Themes []string `yaml:"themes"`
TerminalTools []string `yaml:"terminal_tools"`
DevLanguages []string `yaml:"dev_languages"`
Databases []string `yaml:"databases"`
}
Used to store what this app installed
type IntegrationsConfig ¶
type IntegrationsConfig struct {
RtkClaudeHook bool `yaml:"rtk_claude_hook,omitempty"`
}
IntegrationsConfig tracks explicit cross-app opt-ins that devgeta must preserve when re-rendering another app's config. RtkClaudeHook records that the user opted into rtk's command-rewriting hook (ADR-0004: the hook is never enabled automatically), so claude's settings.json template keeps the hook entry across every `dg configure claude --force`.
type RecentRepo ¶
RecentRepo tracks a repo root devgeta has created a worktree in, so the worktree TUI's repo picker can offer it again (most-recently-used first) even after every worktree under it has been removed.
type ShellFeatures ¶
type ShellFeatures struct {
IsMac bool `yaml:"is_mac"`
Mise bool `yaml:"mise"`
Zoxide bool `yaml:"zoxide"`
ZshAutosuggestions bool `yaml:"zsh_autosuggestions"`
ZshSyntaxHighlighting bool `yaml:"zsh_syntax_highlighting"`
Powerlevel10k bool `yaml:"powerlevel10k"`
ExtendedCapabilities bool `yaml:"extended_capabilities"`
LazyGit bool `yaml:"lazy_git"`
LazyDocker bool `yaml:"lazy_docker"`
Fzf bool `yaml:"fzf"`
Neovim bool `yaml:"neovim"`
Tmux bool `yaml:"tmux"`
Eza bool `yaml:"eza"`
Bat bool `yaml:"bat"`
Opencode bool `yaml:"opencode"`
Claude bool `yaml:"claude"`
}
ShellFeatures tracks which shell enhancements are enabled
type WorktreeConfig ¶
type WorktreeConfig struct {
DefaultAI string `yaml:"default_ai"` // "opencode" | "claude"; empty = fallback to "opencode"
RecentRepos []RecentRepo `yaml:"recent_repos,omitempty"` // MRU-ordered; new field, absent in old configs
SearchPaths []string `yaml:"search_paths,omitempty"` // dirs to scan for git repos for the worktree picker; empty = scanning disabled (the only off-switch)
ScanDepth int `yaml:"scan_depth,omitempty"` // max dir depth for the repo scan; 0 (or unset) = use the default of 4
DefaultLayout string `yaml:"default_layout,omitempty"` // default tmux window layout for `dg ws`'s create; empty = derive a single-pane layout from DefaultAI
}
WorktreeConfig stores worktree-specific settings
func (*WorktreeConfig) PrunedRecentRepos ¶
func (wc *WorktreeConfig) PrunedRecentRepos() []RecentRepo
PrunedRecentRepos returns RecentRepos with any entry whose Path no longer exists on disk removed. It is a pure read-time filter: it does not mutate the receiver or persist anything, so callers decide separately whether and when to save the pruned result.
func (*WorktreeConfig) UpsertRecentRepo ¶
func (wc *WorktreeConfig) UpsertRecentRepo(path string, now time.Time)
UpsertRecentRepo records path as the most-recently-used repo: if path is already present it is moved to the front with LastUsed bumped to now, otherwise it is prepended. The list is capped at maxRecentRepos entries, dropping the least-recently-used. path must already be canonicalized (see CanonicalRepoPath) so the same repo is never stored under two string forms.