"""
Main entry point for the AI Coding Agent
"""
from src.core.agent import CodingAgent
from src.workspace.manager import WorkspaceManager
from src.ai.llm_interface import LLMInterface
from src.tasks.task_manager import TaskManager
import argparse
import os
from dotenv import load_dotenv

def main():
    # Load environment variables
    load_dotenv()
    
    # Parse command line arguments
    parser = argparse.ArgumentParser(description="AI Coding Agent")
    parser.add_argument("--workspace", type=str, help="Path to workspace directory")
    parser.add_argument("--model", type=str, default="gpt-4", help="AI model to use")
    args = parser.parse_args()
    
    # Initialize components
    workspace = WorkspaceManager(args.workspace)
    llm = LLMInterface(model_name=args.model)
    task_manager = TaskManager()
    
    # Create agent instance
    agent = CodingAgent(
        workspace=workspace,
        llm=llm,
        task_manager=task_manager
    )
    
    # Start the agent
    agent.run()

if __name__ == "__main__":
    main()
