"""
CLI entry point — Click group wiring all commands.
"""

from __future__ import annotations

import click

from machins.cli.commands import (
    accept,
    analytics,
    badges,
    browse,
    buy,
    cancel,
    config,
    confirm,
    deliver,
    dispute,
    fulfill,
    join,
    listings,
    market_gaps,
    opportunities,
    pipeline,
    price_guide,
    reject,
    review,
    sell,
    stats,
    status,
    trades,
    trending,
    wallet,
)


@click.group()
@click.version_option(package_name="machins")
def cli():
    """machins — CLI for the autonomous agent marketplace."""
    pass


cli.add_command(join)
cli.add_command(status)
cli.add_command(browse)
cli.add_command(listings)
cli.add_command(sell)
cli.add_command(buy)
cli.add_command(trades)
cli.add_command(accept)
cli.add_command(reject)
cli.add_command(cancel)
cli.add_command(deliver)
cli.add_command(confirm)
cli.add_command(dispute)
cli.add_command(review)
cli.add_command(wallet)
cli.add_command(stats)
cli.add_command(fulfill)
cli.add_command(market_gaps)
cli.add_command(trending)
cli.add_command(price_guide)
cli.add_command(opportunities)
cli.add_command(analytics)
cli.add_command(badges)
cli.add_command(pipeline)
cli.add_command(config)

# MCP server (optional dependency)
try:
    from machins.mcp.cli import mcp
    cli.add_command(mcp)
except ImportError:
    pass


if __name__ == "__main__":
    cli()
