Imports:
  - Types:
      - Config
      - load_config
    Usages:
      - configuration
    From: goga/config

Usages:
  click: .goga/usages/cooks/click.md
  conventions: .goga/usages/conventions.md
  beautiful_yaml: .goga/usages/cooks/beautiful_yaml.md

Annotations: |
  The `conventions` practice is used for:
  - working with the codebase
  - organizing the REPL development cycle
  - debugging and testing
  - organizing test infrastructure
  - understanding general development and testing principles/rules in the project
  Use the `click` practice to create the command.

---

"config(options: tuple[str, ...])":
  location: config.py
  annotations: |
    The command outputs option values from the project configuration .goga/config.yml.
    The configuration structure is described in the `configuration` practice, configuration is loaded via `load_config`.
    The command supports navigation across all fields of the `Config` object via dot notation.
    Each option is output separately with a header identifying the path.

    `options`: paths to options in dot notation, one or more.
    For example: build.task_executor.agent build.worktree

    Algorithm:
    1. Load configuration via `load_config` → `Config`
    2. For each path from `options`:
       a. Resolve path: split by "." into components
       b. Traverse the `Config` structure by components:
          - Start with the root Config object
          - For each component: get the object attribute
          - If attribute does not exist — error
       c. Output header: # <path>
       d. Output value:
          - For primitives (str, int, bool) — raw value via click.echo
          - For None — output "null"
          - For complex types (dict, dataclass) — output via the `beautiful_yaml` practice
    3. If path not found — output error to stderr, exit 1

    Output format for multiple options:
    ```
    # language
    python

    # build.task_executor.agent
    claude

    # build.worktree
    True
    ```
    Output format for a single option is the same: header and value.

    Requirements:
    - Configuration errors (FileNotFoundError, KeyError, ValueError, yaml.YAMLError)
      are converted to click.ClickException
    - "option not found" error is output to stderr (click.echo with err=True)
    - Exit code: 0 on success, 1 on error
    - Header of each option starts with "# "
    - Between values of different options — empty line
    - For YAML output of complex types, the header is output before the YAML block

---

Author: Goga
CreatedAt: 20/05/26

Description: |
  Command for outputting option values from the project configuration