Skip to content

Support loading a yaml configuration file #8

@yalefresne

Description

@yalefresne

Goal

Support loading a configuration file from the path ~/.config/dvopsctl.yaml in the user's home directory when no config path is explicitly provided.

Context

Currently, the dvopsctl CLI requires an explicit path or defaults to a fixed location. To improve developer experience and follow XDG Base Directory conventions, we want to support loading config from ~/.config/dvopsctl.yaml.

This behavior should only apply if no other config path is passed via CLI flags or environment variables.

Acceptance Criteria

  • Implement logic to resolve ~/.config/dvopsctl.yaml using os.UserConfigDir() or similar
  • If a path is passed via flag or environment variable, it should override the default
  • If no config file is found in any location, return a clear error message
  • Write unit tests using testing package that:
    • Mock or simulate the presence of a file at ~/.config/dvopsctl.yaml
    • Assert the file is loaded correctly as default
    • Assert a user-provided path takes priority
    • Assert proper error is returned if no config exists
  • Update CLI help text and documentation to describe the default config path behavior

Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions