RDFLESS-CONFIG(5)

NAME
rdfless-config - configuration file for rdfless

SYNOPSIS
~/.config/rdfless/config.toml
%APPDATA%\rdfless\config.toml

DESCRIPTION
rdfless uses a TOML configuration file to customize its behavior and appearance. The configuration file is optional; if it doesn't exist, rdfless will use built-in defaults. The configuration file supports three main sections: [colors], [output], and [theme].

CONFIGURATION SECTIONS

  [colors]
Defines the default color scheme used for syntax highlighting. Each color can be specified as:

•   A named color (e.g., "red", "blue", "green")

•   A bright color (e.g., "bright_red", "bright_blue")

•   A hex color code (e.g., "#FF0000", "#336699") Available color settings:

subject
    Color for RDF subjects (default: "blue")

predicate
    Color for RDF predicates/properties (default: "green")

object
    Color for RDF objects (default: "white")

literal
    Color for literal values (default: "red")

prefix
    Color for namespace prefixes (default: "yellow")

base
    Color for base URI declarations (default: "yellow")

graph
    Color for named graph identifiers (default: "yellow")

  [output]
Controls output formatting and paging behavior:

expand
    Boolean value controlling whether prefixes are expanded by default (default: false)

pager
    Boolean value controlling whether paging is enabled by default (default: false)

auto_pager
    Boolean value controlling automatic paging for large outputs (default: true)

auto_pager_threshold
    Integer value setting the line threshold for auto-paging. If 0, uses terminal height (default: 0)

  [theme]
Controls theme-specific color configurations and automatic theme detection:

auto_detect
    Boolean value controlling automatic terminal background detection (default: true)

  [theme.dark_theme]
Color configuration used when a dark terminal background is detected or when --dark-theme is specified:

subject
    Default: "blue"

predicate
    Default: "green"

object
    Default: "white"

literal
    Default: "red"

prefix
    Default: "yellow"

base
    Default: "yellow"

graph
    Default: "yellow"

  [theme.light_theme]
Color configuration used when a light terminal background is detected or when --light-theme is specified:

subject
    Default: "blue"

predicate
    Default: "#006400" (dark green)

object
    Default: "black"

literal
    Default: "#8B0000" (dark red)

prefix
    Default: "#B8860B" (dark goldenrod)

base
    Default: "#B8860B" (dark goldenrod)

graph
    Default: "#B8860B" (dark goldenrod)

NAMED COLORS
The following named colors are supported:

•   Basic colors: black, red, green, yellow, blue, magenta, cyan, white

•   Bright colors: bright_black, bright_red, bright_green, bright_yellow, bright_blue, bright_magenta, bright_cyan, bright_white

HEX COLORS
Hex color codes can be specified in the following formats:

•   6-digit format: "#RRGGBB" (e.g., "#FF0000" for red)

•   3-digit format: "#RGB" (e.g., "#F00" for red)

THEME DETECTION
When theme.auto_detect is enabled (default), rdfless attempts to detect the terminal background color and automatically selects appropriate colors:

•   Dark backgrounds use the theme.dark_theme configuration

•   Light backgrounds use the theme.light_theme configuration

•   If detection fails, falls back to the default [colors] configuration Theme detection can be overridden using the --dark-theme, --light-theme, or --no-auto-theme command-line options.

EXAMPLE CONFIGURATION
    # Example rdfless configuration file
    [colors]
    subject = "blue"
    predicate = "green"
    object = "white"
    literal = "#FF6B6B"
    prefix = "yellow"
    base = "yellow"
    graph = "magenta"
    [output]
    expand = false
    pager = false
    auto_pager = true
    auto_pager_threshold = 50
    [theme]
    auto_detect = true
    [theme.dark_theme]
    subject = "bright_blue"
    predicate = "bright_green"
    object = "white"
    literal = "bright_red"
    prefix = "bright_yellow"
    base = "bright_yellow"
    graph = "bright_magenta"
    [theme.light_theme]
    subject = "#0066CC"
    predicate = "#006400"
    object = "black"
    literal = "#CC0000"
    prefix = "#B8860B"
    base = "#B8860B"
    graph = "#8B008B"

FILE LOCATION
The configuration file is located at:

•   Linux/macOS: ~/.config/rdfless/config.toml

•   Windows: %APPDATA%\rdfless\config.toml The directory is created automatically if it doesn't exist when rdfless is first run.

PRECEDENCE
Configuration values are resolved in the following order (highest to lowest precedence):

1.  Command-line options (e.g., --expand, --dark-theme)

2.  Configuration file values

3.  Built-in defaults

ERROR HANDLING
If the configuration file contains syntax errors or invalid values:

•   Invalid TOML syntax will cause rdfless to report an error and exit

•   Invalid color names will fall back to white

•   Invalid boolean or numeric values will use defaults

SEE ALSO
rdfless(1) TOML specification: https://toml.io/

AUTHOR
Written by Lars Wilhelmsen.

COPYRIGHT
Copyright © 2025 Lars Wilhelmsen.
License BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause