#!/usr/bin/env python3
"""
Zexus Development Mode Runner
Runs the interpreter directly from source without requiring installation.
This allows real-time testing of changes during development.

Usage:
    ./zx-dev run script.zx
    ./zx-dev check script.zx
    ./zx-dev --help
"""

import sys
import os

# Add the src directory to Python path so we can import zexus modules
script_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.join(script_dir, 'src')
sys.path.insert(0, src_dir)

# Now import and run the CLI
from zexus.cli.main import cli

if __name__ == '__main__':
    # Add a marker so the code knows it's running in dev mode
    os.environ['ZEXUS_DEV_MODE'] = '1'
    
    # Check for --debug flag
    if '--debug' in sys.argv:
        os.environ['ZEXUS_DEBUG'] = '1'
        print("🐛 [DEBUG MODE] Enabled")
    
    # Print dev mode indicator
    if '--help' not in sys.argv and len(sys.argv) > 1:
        print("🔧 [DEV MODE] Running from source")
    
    # Run the CLI with all arguments
    cli()
