Documentation
¶
Overview ¶
Package config loads and validates limitping's TOML configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir returns limitping's config directory, honoring $XDG_CONFIG_HOME and falling back to ~/.config/limitping.
func WriteDefault ¶
WriteDefault writes a commented default config to Path(). It refuses to overwrite an existing file unless force is true.
Types ¶
type Config ¶
type Config struct {
// WeeklyThreshold: skip pinging when the weekly window's utilization
// (0..1) is at or above this value, until the weekly window resets.
WeeklyThreshold float64 `toml:"weekly_threshold"`
// ResetBuffer: wait this long after a window's reset time before pinging,
// to be sure the window has actually rolled over.
ResetBuffer Duration `toml:"reset_buffer"`
// Notify: emit macOS notifications on ping success/failure/skip.
Notify bool `toml:"notify"`
// UsageDisplay controls the text status percentage: "used" preserves the raw
// provider usage value; "remaining" shows the complement users see in some UIs.
UsageDisplay string `toml:"usage_display"`
Claude ProviderConfig `toml:"claude"`
Codex ProviderConfig `toml:"codex"`
}
Config is the full configuration.
type Duration ¶
Duration is a time.Duration that (un)marshals from TOML as a string like "10s" so the config file stays human-friendly.
func (Duration) MarshalText ¶
func (*Duration) UnmarshalText ¶
type ProviderConfig ¶
type ProviderConfig struct {
Enabled bool `toml:"enabled"`
Prompt string `toml:"prompt"`
ExtraArgs []string `toml:"extra_args"`
Model string `toml:"model"`
ReasoningEffort string `toml:"reasoning_effort"`
AlignStart string `toml:"align_start"`
// ContinuePrompt is the message injected into a proxied session
// (`limitping continue <provider>`) when the 5h limit recovers.
// Empty falls back to "continue".
ContinuePrompt string `toml:"continue_prompt"`
// AutoRedeem lets `watch` and `continue` spend a banked reset credit that is
// about to lapse. Codex-only, and off by default: redeeming is irreversible.
AutoRedeem bool `toml:"auto_redeem"`
}
ProviderConfig holds the per-provider knobs. ReasoningEffort applies to Codex-backed providers and is ignored by Claude.
Click to show internal directories.
Click to hide internal directories.