Skip to content

feat: Implement basic CLI (agentgym train) #9

@Robbe1991

Description

@Robbe1991

Description

Implement command-line interface for AgentGym.

Acceptance Criteria

  • CLI entry point in src/agentgym/cli/main.py
  • agentgym --version command
  • agentgym train --scenario X --framework Y command
  • Beautiful terminal output using Rich
  • Help text and usage examples
  • Integration test showing full CLI usage

Technical Details

import typer
from rich.console import Console

app = typer.Typer()
console = Console()

@app.command()
def train(
    scenario: str = typer.Option(..., help="Scenario name"),
    framework: str = typer.Option("langchain", help="Framework to use"),
    episodes: int = typer.Option(10000, help="Number of episodes"),
):
    """Train an agent using reinforcement learning."""
    console.print(f"[bold]Training {framework} agent...[/bold]")

    # Create trainer
    config = TrainingConfig(
        scenario=scenario,
        framework=framework,
        episodes=episodes
    )
    trainer = Trainer(config)

    # Train
    result = trainer.train()

    # Display results
    console.print(f"[green]✓[/green] Training complete!")
    console.print(f"Tool reliability: {result.metrics.tool_reliability:.1%}")

References

Estimated Time

3-4 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions