#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK

import sys
from pathlib import Path

# Get the base directory (parent of bin/)
script_path = Path(__file__).resolve()
basedir = script_path.parent.parent

# Add basedir to Python path
sys.path.insert(0, str(basedir))

# Save original argv before modifying (for argcomplete)
sys._orig_argv = sys.argv.copy()

# Insert basedir as sys.argv[1] (the module expects it there)
sys.argv.insert(1, str(basedir))

# Import and run the main module
from aib import main

if __name__ == "__main__":
    sys.exit(main.main())
