"""CLI entry point for toolcraft - alternative approach."""

def main():
    """Run the Gradio app by launching it directly."""
    import sys
    import os
    from pathlib import Path
    
    # Find where the package is installed
    package_dir = Path(__file__).parent
    app_path = package_dir / "app.py"
    
    if not app_path.exists():
        print(f"Error: app.py not found at {app_path}")
        sys.exit(1)
    
    # Change to package directory
    os.chdir(package_dir)
    
    # Execute app.py directly
    with open(app_path) as f:
        code = compile(f.read(), app_path, 'exec')
        exec(code, {'__name__': '__main__', '__file__': str(app_path)})


if __name__ == "__main__":
    main()
