Skip to content

Support XDG Base Directory Specification for configuration files #197

@izvyk

Description

@izvyk

Description

I suggest extending the genericcli/context module to support the XDG Base Directory Specification.

Currently, configuration files are loaded from a hardcoded directory in the user's home if no --config flag is given (e.g., ~/.metalctl/config.yaml). To align with modern Linux standards and keep home directories clean, the config loader should prioritize the following lookup order:

  1. XDG config path: $XDG_CONFIG_HOME/<app_name>/config.yaml
    (defaults to ~/.config/<app_name>/config.yaml if the environment variable is unset).

  2. Legacy path: ~/.<app_name>/config.yaml
    (for backward compatibility).

This change ensures compliance with the standard while keeping existing setups functional.

Note: needs #194 to be merged first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions