Skip to main content

Module config

Module config 

Source
Expand description

Configuration file support for rledger CLI.

Provides layered configuration with the following precedence (highest to lowest):

  1. CLI arguments
  2. Environment variables (RLEDGER_FILE, RLEDGER_FORMAT, etc.)
  3. Project config (.rledger.toml in current directory, searching upward)
  4. User config (~/.config/rledger/config.toml or platform equivalent)
  5. System config (/etc/rledger/config.toml or 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§

CommandConfig
Generic command configuration.
CommandsConfig
Command-specific configuration.
Config
The main configuration struct.
DefaultConfig
Default configuration options.
DetailedMapping
Detailed price mapping for a commodity.
FallbackDetail
{source, ticker} form of a fallback chain entry.
FormatCommandConfig
Format command configuration.
LoadedConfig
Loaded configuration with source tracking.
OutputConfig
Output configuration options.
PriceConfig
Price fetching configuration.
ProfileConfig
Profile configuration (inherits from default and overrides).

Enums§

CommodityMapping
Mapping configuration for a commodity.
ConfigSource
Information about where a config value came from.
FallbackEntry
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.
PriceSourceConfig
Configuration for a custom price source.
SourceRef
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.