Expand description
Configuration file support for rledger CLI.
Provides layered configuration with the following precedence (highest to lowest):
- CLI arguments
- Environment variables (
RLEDGER_FILE,RLEDGER_FORMAT, etc.) - Project config (
.rledger.tomlin current directory, searching upward) - User config (
~/.config/rledger/config.tomlor platform equivalent) - System config (
/etc/rledger/config.tomlor platform equivalent)
§Philosophy
This config system only handles CLI convenience options that don’t affect
accounting behavior. Options that affect accounting (like operating_currency,
booking_method) should be set via beancount’s in-file option directives.
§Example Configuration
[default]
file = "~/finances/main.beancount"
[output]
format = "text"
color = true
[profiles.business]
file = "~/work/accounting/main.beancount"
[aliases]
bal = "report balances"Structs§
- Command
Config - Generic command configuration.
- Commands
Config - Command-specific configuration.
- Config
- The main configuration struct.
- Default
Config - Default configuration options.
- Detailed
Mapping - Detailed price mapping for a commodity.
- Fallback
Detail {source, ticker}form of a fallback chain entry.- Format
Command Config - Format command configuration.
- Loaded
Config - Loaded configuration with source tracking.
- Output
Config - Output configuration options.
- Price
Config - Price fetching configuration.
- Profile
Config - Profile configuration (inherits from default and overrides).
Enums§
- Commodity
Mapping - Mapping configuration for a commodity.
- Config
Source - Information about where a config value came from.
- Fallback
Entry - One entry in a fallback chain. Accepts either a bare source name
or
{source = "...", ticker = "..."}so per-source tickers can be preserved through the chain. - Price
Source Config - Configuration for a custom price source.
- Source
Ref - Reference to one or more price sources.
Functions§
- config_
search_ paths - Get all config file paths that would be searched.
- find_
project_ config - Find project config by searching upward from current directory.
- find_
project_ config_ from - Find project config by searching upward from a given directory.
- system_
config_ path - Get the system config file path.
- user_
config_ dir - Get the user config directory path.
- user_
config_ path - Get the user config file path.