closes #130 - CHANGELOG.md file for people who can view changelog from github --- `iris changelog` command: `iris changelog [version]` (e.g. iris changelog v0.5.1) `iris changelog -n 3` (see changelog of 3 latest releaseas) => `iris changelog` looks just like CHANGELOG.md, grouped headers and all. It only stops looking that way if we personally overwrite that release's description with something else => With 1-hour local cache (invalidated on updater-channel change), `--refresh` flag to bypass, graceful fallback to stale cache on GitHub rate-limiting --- - New auto update config ```toml # 0 = off (default, notify only), 1 = auto-install, 2 = always confirm first auto-update = 1 ``` - New just debug-changelog and just debug-autoupdate recipes (fully offline, mocked HTTP servers, no real network/config touched)
71 lines
1.4 KiB
Go
71 lines
1.4 KiB
Go
package config
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
func DefaultConfig() *Config {
|
|
return &Config{
|
|
Core: CoreConfig{
|
|
Version: 1,
|
|
Shell: "",
|
|
ShellLogin: false,
|
|
Mode: "last",
|
|
Debug: false,
|
|
ExpandAlias: true,
|
|
AutoExecute: false,
|
|
},
|
|
UI: UIConfig{
|
|
Style: "modern",
|
|
GhostText: true,
|
|
ShowHiddenFiles: false,
|
|
MaxSuggestions: 100,
|
|
MaxHeight: 15,
|
|
MaxWidth: 0, // 0 means no limit, fallback to terminal width
|
|
NerdFonts: true,
|
|
},
|
|
Git: GitConfig{
|
|
FilterActiveBranch: true,
|
|
DeduplicateBranches: true,
|
|
},
|
|
Updater: UpdaterConfig{
|
|
CheckOnStartup: true,
|
|
Channel: "stable",
|
|
CheckInterval: Duration(24 * time.Hour),
|
|
AutoUpdate: 0,
|
|
},
|
|
AI: AIConfig{
|
|
Enabled: false,
|
|
Provider: "",
|
|
DebounceMS: 500,
|
|
MinIntervalMS: 1000,
|
|
Providers: nil,
|
|
SuggestOnEmpty: SuggestOnEmptyConfig{
|
|
Enabled: false,
|
|
DebounceMS: 800,
|
|
MinIntervalMS: 5000,
|
|
},
|
|
},
|
|
Keybindings: KeybindingsConfig{
|
|
ToggleMode: "ctrl+r",
|
|
ToggleMenu: "shift+tab",
|
|
SelectSuggestion: "tab",
|
|
NavigateUp: "up",
|
|
NavigateDown: "down",
|
|
},
|
|
}
|
|
}
|
|
|
|
func DefaultState() *State {
|
|
return &State{
|
|
LastMode: "spec",
|
|
Updater: UpdaterState{
|
|
LastCheckTime: time.Time{},
|
|
SeenVersion: "",
|
|
AutoUpdateTarget: "",
|
|
AutoUpdateAttempt: 0,
|
|
DeclinedVersion: "",
|
|
},
|
|
}
|
|
}
|