"""abreka goal — view the research goal."""

from __future__ import annotations

import click
from rich.console import Console
from rich.markdown import Markdown

from abreka.config import find_abreka_dir, load_goal


@click.command("goal")
def goal_cmd():
    """View the research goal (abreka/goal.md)."""
    abreka_dir = find_abreka_dir()
    content = load_goal(abreka_dir)
    if not content.strip():
        click.echo("No research goal set. Edit abreka/goal.md to define one.")
        return
    console = Console()
    console.print(Markdown(content))
