#!/usr/bin/env python3
"""Harmless CLI adapter used by the AgentGenii documentation walkthrough.

It reads command-line arguments only, writes one JSON object to stdout, and
does not read or write files, make network requests, or load configuration.
"""

from __future__ import annotations

import argparse
import json


def main() -> None:
    parser = argparse.ArgumentParser(prog="demo-echo", allow_abbrev=False)
    commands = parser.add_subparsers(dest="command", required=True)
    say = commands.add_parser("say", allow_abbrev=False)
    say.add_argument("--message", required=True)
    args = parser.parse_args()
    print(json.dumps({"message": args.message}, sort_keys=True))


if __name__ == "__main__":
    main()
