Repository navigation
feat(tui): --sidebar-section shows a command's output in the sidebar - #4585
ALLiDoizCode wants to merge 1 commit into
Conversation
Projects that run an agent beside services of their own have no place in the TUI to show them. --sidebar-section "Title=command" adds a section below Tools whose body is the command's output, run at startup and again every 5 seconds with a 5 second timeout. The output is plain text, cut to the sidebar's width and to 12 lines; a section with no output is hidden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jonathan Green <dev.jonathan.green@gmail.com>
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push. Commits that are not verified: See GitHub’s guide on signing commits for setup instructions. I’ve added |
aheritier
left a comment
There was a problem hiding this comment.
In addition of signing your commits please remove claude code as co-author. You should give a try to Docker Agent it's pretty nice :)
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push.\n\nCommits that are not verified: |
What
A new
runflag,--sidebar-section "Title=command", adds a section to the TUI's sidebar, below Tools, whose body is the output of a shell command.Why
The sidebar's sections are fixed: Session, Token Usage, Agent, Tools, Todos, Plans. A project that runs an agent beside services of its own has no place in the TUI to show their state, so the person at the keyboard asks the agent, or leaves the TUI, to learn whether they are up.
We hit this in spaceturtle, where the agent runs a node with apps behind it and the person wants to see which are running and which wait for approval. We carry this as a patch on v1.150.0, next to #4578, and would rather not.
How
pkg/tui/components/sidebar/command_sections.go: the section's state, its run and its rendering. It follows the git-branch watcher's shape: a sidebar-private message that the chat page already forwards to the sidebar.Initruns on every tab switch, so the refresh chain starts once per sidebar.sidebar.go: the section is appended after Tools, and the cache is invalidated only when the output changes.chat,tui,cmd/root:WithSidebarSectionsand the flag. A value that is notTitle=commandis an error before the TUI starts.Testing
go testonpkg/tui/...andcmd/root,golangci-lint runon the changed packages andgo run ./lint .pass locally. I did not run the whole oftask test.Open questions
🤖 Generated with Claude Code