Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements functionality to attach to running CLI tools in other tmux sessions, enabling session discovery and management across multiple multiplexer sessions. The feature allows users to find and connect to existing CLI tool instances running in different tmux or zellij sessions.
Key changes include:
- Complete rewrite of the CLI session management architecture with new state tracking
- Added support for discovering and attaching to running CLI tools across multiplexer sessions
- Replaced the old mux/terminal system with a unified session-based approach
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sk/cli/*.lua | New CLI tool configuration files defining commands and process patterns for various AI coding tools |
| lua/sidekick/util.lua | Enhanced utility functions to support string arrays in notifications and added state persistence |
| lua/sidekick/health.lua | Updated health check to use new tool configuration system |
| lua/sidekick/config.lua | Major config changes including new mux settings, tool management functions, and highlight groups |
| lua/sidekick/cli/ui/*.lua | New UI components for tool selection and prompt selection with rich formatting |
| lua/sidekick/cli/tool.lua | New tool abstraction layer with process matching capabilities |
| lua/sidekick/cli/terminal.lua | Refactored terminal management to work with new session system |
| lua/sidekick/cli/state.lua | New state management system for tracking CLI tool sessions and status |
| lua/sidekick/cli/session/*.lua | New session backend implementations for tmux and zellij multiplexers |
| lua/sidekick/cli/procs.lua | New process discovery and management system for finding running CLI tools |
| lua/sidekick/cli/init.lua | Completely rewritten CLI interface using new state-based architecture |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Owner
Author
|
@copilot can you update the description of this PR with the most relevant changes? |
This was
linked to
issues
Oct 7, 2025
This was referenced Oct 7, 2025
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Session Management and Multi-Backend Support
This PR introduces a new session management system that allows Sidekick
to discover and attach to running CLI tools across different backends.
User-Facing Changes
Attach to Running Sessions
Sidekick can now detect and attach to CLI tools already running in other
tmux/zellij sessions:
tmux/zellij windows
new one
Cross-Platform Process Discovery
Process detection now works across Linux, macOS, and BSD systems:
/procfilesystem (fastest)lsofandpscommandsOpenCode Integration (Experimental)
Added support for OpenCode as a
backend:
Internal Changes
Refactored Session Architecture
Sessionabstraction: Unified interface for terminal, tmux,zellij, and HTTP-based backends
running)
Procsmodule for finding running processesReorganized CLI Module Structure
lua/sidekick/cli/
├── init.lua # Public API (simplified)
├── state.lua # Session state management
├── procs.lua # Process discovery (NEW)
├── terminal.lua # Terminal backend
├── session/
│ ├── init.lua # Session abstraction (NEW)
│ ├── tmux.lua # Tmux backend (refactored)
│ └── zellij.lua # Zellij backend (refactored)
└── ui/
├── prompt.lua # Prompt selection UI (NEW)
└── select.lua # Tool selection UI (NEW)
Platform Detection
vim.uv.fs_stat("/proc/self")to detect/procavailabilityps,lsof)Utilities
Util.curl(): Simple HTTP client wrapper for communicating withHTTP-based backends
Breaking Changes
None. The public API remains backward compatible.
Technical Details
Session Discovery Flow
sessions()to return running instancesattach()creates the connectionsend()/submit()API works across all backendsBackend Interface
Backends implement:
sessions(): Discover running instancesattach(): Connect to a sessionsend(text): Send text to the sessionsubmit(): Submit/execute the current inputThis makes it trivial to add new backends (HTTP APIs, other terminal
multiplexers, etc.).