Skip to content

feat: add agent commands support in TUI#612

Merged
dgageot merged 4 commits intodocker:mainfrom
Deepam02:feat/agent-commands-in-tui
Oct 29, 2025
Merged

feat: add agent commands support in TUI#612
dgageot merged 4 commits intodocker:mainfrom
Deepam02:feat/agent-commands-in-tui

Conversation

@Deepam02
Copy link
Copy Markdown
Contributor

@Deepam02 Deepam02 commented Oct 25, 2025

Fixes #603

Agent commands can be invoked by typing /command in chat
Commands now appear in the command palette (Ctrl+P) under "Agent Commands" category

Fixes docker#603

Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
@Deepam02 Deepam02 requested a review from a team as a code owner October 25, 2025 16:30
Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
Comment thread pkg/tui/tui.go
func (a *appModel) buildCommandCategories() []dialog.CommandCategory {
return []dialog.CommandCategory{
categories := []dialog.CommandCategory{
{
Copy link
Copy Markdown
Contributor Author

@Deepam02 Deepam02 Oct 25, 2025

Choose a reason for hiding this comment

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

Should I break this method into smaller parts or keep it as is since the logic is straightforward?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be fine for now. Am on my phone now, hard to review, will take a closer look tomorrow

@Deepam02
Copy link
Copy Markdown
Contributor Author

@rumpl have you had a chance to review this pr?

@rumpl
Copy link
Copy Markdown
Member

rumpl commented Oct 28, 2025

@Deepam02 when the prompt for the command is too long the lines wrap, could we trim the command prompt so that it takes only one line?
Screenshot 2025-10-28 at 21 24 12

Comment thread pkg/tui/page/chat/chat.go Outdated
case editor.SendMsg:
cmd := p.processMessage(msg.Content)
// Resolve agent commands (if any)
content := p.app.ResolveCommand(msg.Content)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could the editor do the resolve? It kinda feels like it would be its job and not here, so basically the editor sends a message, and we don't care if the user typed it or if it was extracted from a command

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done! I moved the command resolution into the editor component. Now the editor resolves commands before sending the message.

Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
@dgageot dgageot merged commit 4d96f2c into docker:main Oct 29, 2025
5 checks passed
@Deepam02 Deepam02 deleted the feat/agent-commands-in-tui branch November 29, 2025 07:05
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.

commands should also be /commands

3 participants