Repository: emcie-co/parlant
File: sdk/src/emcie/sdk/bin/emcie.py (Python)

Code before:
        type=str,
        help="Server address",
        metavar="ADDRESS[:PORT]",
        required=True,
    )
    @click.pass_context
    def cli(ctx: click.Context, server: str) -> None:
        if not ctx.obj:
            ctx.obj = Config(server_address=server)

    @cli.command(help="Generate shell completion code")
    @click.option("-s", "--shell", type=str, help="Shell program (bash, zsh, etc.)", required=True)
    def complete(shell: str) -> None:
        click.echo(click_completion.get_code(shell))

    @cli.group(help="Manage agents")
    def agent() -> None:
        pass

    @agent.command("list", help="List agents")
    @click.pass_context
    def agent_list(ctx: click.Context) -> None:
        Interface.list_agents(ctx)

    @agent.command("update", help="Update an agent's details")
    @click.option("-a", "--agent-id", type=str, help="Agent ID", metavar="ID", required=False)
    @click.option("-d", "--description", type=str, help="Agent description", required=False)
    @click.option(
        "-m", "--max-engine-iterations", type=int, help="Max engine iterations", required=False
    )
    @click.pass_context
    def agent_update(
        ctx: click.Context,
        agent_id: str,
        description: Optional[str],
        max_engine_iterations: Optional[int],
    ) -> None:
        agent_id = agent_id if agent_id else Interface.get_default_agent(ctx)
        assert agent_id

        Interface.patch_agent(ctx, agent_id, description, max_engine_iterations)

    @agent.command(
        "chat",
        help="Jump into a chat with an agent\n\n"
        "If AGENT_ID is omitted, the default agent will be selected.",
    )
    @click.argument("agent_id", required=False)
    @click.pass_context
    def agent_chat(ctx: click.Context, agent_id: Optional[str]) -> None:
        agent_id = agent_id if agent_id else Interface.get_default_agent(ctx)

Review comment (suggestion):
In all of the cases where we allow the user to specify the agent ID but don't require it, let's set the help to `Agent ID (defaults to the first agent)`

Code after:
        type=str,
        help="Server address",
        metavar="ADDRESS[:PORT]",
        required=True,
    )
    @click.pass_context
    def cli(ctx: click.Context, server: str) -> None:
        if not ctx.obj:
            ctx.obj = Config(server_address=server)

    @cli.command(help="Generate shell completion code")
    @click.option("-s", "--shell", type=str, help="Shell program (bash, zsh, etc.)", required=True)
    def complete(shell: str) -> None:
        click.echo(click_completion.get_code(shell))

    @cli.group(help="Manage agents")
    def agent() -> None:
        pass

    @agent.command("list", help="List agents")
    @click.pass_context
    def agent_list(ctx: click.Context) -> None:
        Interface.list_agents(ctx)

    @agent.command("update", help="Update an agent's details")
    @click.option(
        "-a",
        "--agent-id",
        type=str,
        help="Agent ID (defaults to the first agent)",
        metavar="ID",
        required=False,
    )
    @click.option("-d", "--description", type=str, help="Agent description", required=False)
    @click.option("--max-engine-iterations", type=int, help="Max engine iterations", required=False)
    @click.pass_context
    def agent_update(
        ctx: click.Context,
        agent_id: str,
        description: Optional[str],
        max_engine_iterations: Optional[int],
    ) -> None:
        agent_id = agent_id if agent_id else Interface.get_default_agent(ctx)
        assert agent_id

        Interface.patch_agent(ctx, agent_id, description, max_engine_iterations)

    @agent.command(
        "chat",
        help="Jump into a chat with an agent\n\n"
        "If AGENT_ID is omitted, the default agent will be selected.",