Skip to content

use Rich table for agents list output#9

Open
ayaan-kapoor wants to merge 1 commit into
gumloop:mainfrom
ayaan-kapoor:feat/agents-list-table
Open

use Rich table for agents list output#9
ayaan-kapoor wants to merge 1 commit into
gumloop:mainfrom
ayaan-kapoor:feat/agents-list-table

Conversation

@ayaan-kapoor

Copy link
Copy Markdown

What

Replace the tab-separated output in gumloop agents list with a proper Rich table.

Why

The current output is hard to read when agent names or IDs are long — columns don't align and there's no visual separation. Rich is already a dependency and used throughout the CLI, so this is a zero-cost improvement.

Active agents now show in green, inactive ones are dimmed, making status easy to scan at a glance.

Before

ID    NAME    MODEL    TEAM    ACTIVE
agent_abc    Support Bot    auto    team_123    yes
agent_xyz    Draft Agent    gpt-4o    team_123    no

After

ID          NAME           MODEL   TEAM       ACTIVE
agent_abc   Support Bot    auto    team_123    yes
agent_xyz   Draft Agent    gpt-4o  team_123    no

(columns align, active/inactive colored)

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces the tab-separated console.print output in gumloop agents list with a properly formatted Rich Table, aligning columns and color-coding active/inactive status.

  • The Rich Table is configured with box=None and pad_edge=False to preserve the flat, shell-friendly look while gaining auto-aligned columns.
  • All server-supplied fields (agent.id, agent.name, agent.model_name, agent.team_id) are correctly passed through escape_markup(), closing a minor pre-existing markup-injection gap that the old unescaped console.print had. The hardcoded [green]yes[/green] / [dim]no[/dim] strings are intentionally not escaped, which is correct since Rich table columns default to markup=True.

Confidence Score: 5/5

Safe to merge — the change is purely cosmetic output formatting with no logic, data, or API contract changes.

The only changed code is the human-readable rendering path (skipped entirely on --json). User-supplied data is consistently escaped, the hardcoded markup for active status is correct given Rich's default markup=True on table columns, and the existing pagination / error-handling paths are untouched.

No files require special attention.

Important Files Changed

Filename Overview
src/gumloop/cli/commands/agents.py Replaces tab-separated console.print with a Rich Table in list_agents; all user-supplied fields are correctly escape_markup'd while hardcoded markup strings for active/inactive status are intentionally left as-is.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[list_agents called] --> B{json_output?}
    B -- yes --> C[print_json and return]
    B -- no --> D{response.agents empty?}
    D -- yes --> E[print 'No agents found.']
    D -- no --> F[Build Rich Table\nbox=None, pad_edge=False]
    F --> G[Add columns:\nID dim / NAME / MODEL / TEAM dim / ACTIVE center]
    G --> H[For each agent:\nescape_markup user fields\nhardcoded markup for active status]
    H --> I[table.add_row]
    I --> J[console.print table]
    E --> K{response.next_cursor?}
    J --> K
    K -- yes --> L[print next cursor hint]
    K -- no --> M[Done]
    L --> M
Loading

Reviews (1): Last reviewed commit: "use Rich table for agents list output" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant