Skip to content

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented Oct 1, 2025

Note

Adds a Textual-based TUI to clai, enabled with --tui, with new UI components, styling, minor CLI output tweaks, and dependency updates.

  • CLI:
    • Add --tui flag to launch a Textual-based TUI; when set, run CLAIApp and exit after app closes.
    • Centralize title/color formatting via title() and wrap_color(); adjust version/list-models output.
    • Fix import paths and keep existing interactive/streaming behavior when not using TUI.
  • TUI:
    • Introduce pydantic_ai/_cli/tui.py implementing CLAIApp, MainScreen, Conversation, Prompt, streaming responses, history navigation, and slash commands (/markdown, /multiline, /exit).
    • Add pydantic_ai/_cli/clai.tcss for TUI styling.
  • Docs:
    • Update clai/README.md help text to include --tui.
  • Dependencies:
    • Add textual to CLI extras and lock dependencies; related markdown/linkify packages included; bump pygments.

Written by Cursor Bugbot for commit 9bd88c6. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

elif agent:
return f'{wrap_color(name_version, "green")} using custom agent {wrap_color(agent, "magenta")}'
else:
return f'{wrap_color(name_version, "green")} with {wrap_color(model, "magenta")}'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Title Function Misbehaves with Custom Agents

The title() function changes the display logic for custom agents, now always showing the model name when an agent is active, even if the model wasn't explicitly set via --model. This differs from previous behavior. Also, the function's else branches don't gracefully handle model=None, potentially displaying "None" literally.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link

github-actions bot commented Oct 1, 2025

Docs Preview

commit: 9bd88c6
Preview URL: https://eef5c95a-pydantic-ai-previews.pydantic.workers.dev

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