burme-coder-max / src /cli /main.py
amkyawdev's picture
Upload folder using huggingface_hub
a7d7463 verified
"""Main CLI Entry Point"""
import sys
import click
from rich.console import Console
from .commands import run_command, train_command, eval_command
from .interactive import InteractiveMode
console = Console()
@click.group()
@click.version_option(version="1.0.0")
def main():
"""🧑‍💻 Burme-Coder-Max - Myanmar AI Coding Agent"""
pass
@main.command()
@click.argument("instruction")
@click.option("--model", default="gpt-4", help="AI model to use")
@click.option("--verbose", is_flag=True, help="Verbose output")
def ask(instruction: str, model: str, verbose: bool):
"""Ask a coding question in Burmese or English"""
from src.core import CoderAgent
from src.animations import Spinner
from src.ui.thanking import ThankYou
agent = CoderAgent(model=model)
with Spinner("Thinking..."):
response = agent.generate_response(instruction)
console.print(response["response"])
if verbose:
console.print(f"\n[dim]Session: {response['session_id']}[/dim]")
console.print(f"[dim]Model: {response['model']}[/dim]")
ThankYou.show()
@main.command()
@click.option("--host", default="0.0.0.0", help="Host to bind")
@click.option("--port", default=5000, help="Port to bind")
def serve(host: str, port: int):
"""Start API server"""
console.print(f"[green]Starting server on {host}:{port}...[/green]")
console.print("[yellow]API server not yet implemented[/yellow]")
@main.command()
def interactive():
"""Start interactive mode"""
mode = InteractiveMode()
mode.start()
@main.command()
@click.option("--data", default="./data/trajectories", help="Training data directory")
@click.option("--epochs", default=10, help="Number of epochs")
def train(data: str, epochs: int):
"""Train the agent on trajectories"""
train_command(data, epochs)
@main.command()
@click.option("--data", default="./data/trajectories", help="Evaluation data")
def eval(data: str):
"""Evaluate agent performance"""
eval_command(data)
# Register subcommands
main.add_command(run_command)
main.add_command(train_command)
main.add_command(eval_command)
if __name__ == "__main__":
main()