#!/usr/bin/env python3
"""Thin wrapper — delegates to oracle.cli query subcommand."""
import sys, os
sys.path.insert(0, os.path.dirname(__file__))

args = sys.argv[1:]
# Map old query commands to new CLI format
if args and args[0] in ("top", "search", "recent", "by-tag", "stats", "snapshot"):
    cli_args = ["query"] + args
elif args and args[0].startswith("-"):
    cli_args = ["query", "top"] + args
else:
    cli_args = ["query", "top"] + args

from oracle.cli import main as cli_main
sys.argv = ["oracle"] + cli_args
cli_main()
