Documentation
¶
Index ¶
- Variables
- func CheckAgentCommand(inst *Instance) error
- func GetClaudeProjectDir(projectPath string) string
- func GetClaudeStatusLine(lines []string, stripANSIFunc func(string) string) string
- type AgentConfig
- type AgentPatterns
- type AgentSession
- func ListAgentSessions(projectPath string) ([]AgentSession, error)
- func ListAmazonQSessions(projectPath string) ([]AgentSession, error)
- func ListCodexSessions(projectPath string) ([]AgentSession, error)
- func ListGeminiSessions(projectPath string) ([]AgentSession, error)
- func ListOpenCodeSessions(projectPath string) ([]AgentSession, error)
- type AgentType
- type ConversationMessage
- type DiffStats
- type FollowedWindow
- type Group
- type HistoryEntry
- type HistoryIndex
- type Instance
- func (i *Instance) Attach() error
- func (i *Instance) CloseWindow(windowIdx int) error
- func (i *Instance) DetectActivity() SessionActivity
- func (i *Instance) DetectActivityForWindow(windowIdx int) SessionActivity
- func (i *Instance) DetectAggregatedActivity() SessionActivity
- func (i *Instance) ForkSession() (string, error)
- func (i *Instance) GetAgentConfig() AgentConfig
- func (i *Instance) GetAllFollowedAgents() []FollowedWindow
- func (i *Instance) GetCurrentWindowIndex() int
- func (i *Instance) GetFollowedWindow(index int) *FollowedWindow
- func (i *Instance) GetFullDiff() *DiffStats
- func (i *Instance) GetLastLine() string
- func (i *Instance) GetLastLineForWindow(windowIdx int, agent AgentType) string
- func (i *Instance) GetPreview(lines int) (string, error)
- func (i *Instance) GetSessionDiff() *DiffStats
- func (i *Instance) GetSuggestion() string
- func (i *Instance) GetWindowCount() int
- func (i *Instance) GetWindowList() []WindowInfo
- func (i *Instance) IsAlive() bool
- func (i *Instance) IsWindowFollowed(index int) bool
- func (i *Instance) NewAgentWindow(name string, agent AgentType, customCmd string) (int, error)
- func (i *Instance) NewForkedTab(name string, sessionID string) error
- func (i *Instance) NewWindow() error
- func (i *Instance) NewWindowWithName(name string) error
- func (i *Instance) NextWindow() error
- func (i *Instance) PrevWindow() error
- func (i *Instance) RenameCurrentWindow(name string) error
- func (i *Instance) ResetBaseCommit()
- func (i *Instance) ResizePane(width, height int) error
- func (i *Instance) RespawnWindow(windowIdx int) error
- func (i *Instance) RespawnWindowWithResume(windowIdx int, resumeID string) error
- func (i *Instance) SelectWindow(index int) error
- func (i *Instance) SendKeys(keys string) error
- func (i *Instance) SendPrompt(text string) error
- func (i *Instance) SendText(text string) error
- func (i *Instance) Start() error
- func (i *Instance) StartWithResume(resumeID string) error
- func (i *Instance) Stop() error
- func (i *Instance) StopWindow(windowIdx int) error
- func (i *Instance) TmuxSessionName() string
- func (i *Instance) ToggleWindowFollow(index int) bool
- func (i *Instance) UpdateDetachBinding(previewWidth, previewHeight int)
- func (i *Instance) UpdateStatus()
- func (i *Instance) WindowName() string
- type Project
- type ProjectsData
- type SessionActivity
- type Settings
- type Status
- type Storage
- func (s *Storage) AddGroup(name string) (*Group, error)
- func (s *Storage) AddInstance(instance *Instance) error
- func (s *Storage) AddProject(name string) (*Project, error)
- func (s *Storage) GetActiveProjectID() string
- func (s *Storage) GetGroups() ([]*Group, error)
- func (s *Storage) GetInstance(id string) (*Instance, error)
- func (s *Storage) GetInstanceByName(name string) (*Instance, error)
- func (s *Storage) GetProject(id string) (*Project, error)
- func (s *Storage) GetProjectSessionCount(projectID string) int
- func (s *Storage) ImportDefaultSessions(projectID string) (int, error)
- func (s *Storage) IsProjectLocked(projectID string) (bool, int)
- func (s *Storage) Load() ([]*Instance, error)
- func (s *Storage) LoadAll() ([]*Instance, []*Group, error)
- func (s *Storage) LoadAllWithSettings() ([]*Instance, []*Group, *Settings, error)
- func (s *Storage) LoadProjects() (*ProjectsData, error)
- func (s *Storage) LockProject(projectID string) error
- func (s *Storage) RemoveGroup(id string) error
- func (s *Storage) RemoveInstance(id string) error
- func (s *Storage) RemoveProject(id string) error
- func (s *Storage) RenameGroup(id, name string) error
- func (s *Storage) RenameProject(id, name string) error
- func (s *Storage) Save(instances []*Instance) error
- func (s *Storage) SaveAll(instances []*Instance, groups []*Group, settings *Settings) error
- func (s *Storage) SaveProjects(projectsData *ProjectsData) error
- func (s *Storage) SaveSettings(settings *Settings) error
- func (s *Storage) SaveWithGroups(instances []*Instance, groups []*Group) error
- func (s *Storage) SetActiveProject(projectID string) error
- func (s *Storage) SetInstanceGroup(instanceID, groupID string) error
- func (s *Storage) ToggleGroupCollapsed(id string) error
- func (s *Storage) UnlockProject()
- func (s *Storage) UpdateInstance(instance *Instance) error
- type StorageData
- type WindowInfo
Constants ¶
This section is empty.
Variables ¶
var AgentConfigs = map[AgentType]AgentConfig{ AgentClaude: { Command: "claude", SupportsResume: true, SupportsAutoYes: true, AutoYesFlag: "--dangerously-skip-permissions", ResumeFlag: "--resume", }, AgentGemini: { Command: "gemini", SupportsResume: true, SupportsAutoYes: false, ResumeFlag: "--resume", }, AgentAider: { Command: "aider", SupportsResume: false, SupportsAutoYes: true, AutoYesFlag: "--yes", }, AgentCodex: { Command: "codex", SupportsResume: true, SupportsAutoYes: true, AutoYesFlag: "--full-auto", ResumeFlag: "resume", ResumeIsSubcommand: true, }, AgentAmazonQ: { Command: "q", SupportsResume: true, SupportsAutoYes: true, AutoYesFlag: "--trust-all-tools", ResumeFlag: "chat --resume", ResumeIsSubcommand: true, }, AgentOpenCode: { Command: "opencode", SupportsResume: true, SupportsAutoYes: false, ResumeFlag: "--session", }, AgentCursor: { Command: "cursor", SupportsResume: false, SupportsAutoYes: false, }, AgentCustom: { Command: "", SupportsResume: false, SupportsAutoYes: false, }, }
AgentConfigs maps agent types to their configurations
Functions ¶
func CheckAgentCommand ¶
CheckAgentCommand verifies that the agent command exists in PATH
func GetClaudeProjectDir ¶
func GetClaudeStatusLine ¶ added in v0.4.0
GetClaudeStatusLine handles Claude Code's special UI with horizontal separator lines. If the input area (between two horizontal lines) has only 1 line (the prompt), it returns the content above the top separator instead of the prompt line.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Command string // Base command to run
SupportsResume bool // Whether agent supports session resume
SupportsAutoYes bool // Whether agent has auto-approve flag
AutoYesFlag string // The flag for auto-approve (e.g., "--dangerously-skip-permissions")
ResumeFlag string // The flag for resume (e.g., "--resume")
ResumeIsSubcommand bool // If true, resume is a subcommand (e.g., "codex resume") not a flag
}
AgentConfig contains configuration for each agent type
type AgentPatterns ¶ added in v0.6.0
type AgentPatterns struct {
WaitingPatterns []string // Patterns that indicate waiting for user input
BusyPatterns []string // Patterns that indicate agent is working
Spinners []string // Spinner characters
}
AgentPatterns holds detection patterns for a specific agent
type AgentSession ¶ added in v0.3.5
type AgentSession struct {
SessionID string `json:"session_id"`
FirstPrompt string `json:"first_prompt"`
LastPrompt string `json:"last_prompt"`
MessageCount int `json:"message_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AgentType AgentType `json:"agent_type"`
}
AgentSession is a generic session structure for any agent type
func ListAgentSessions ¶ added in v0.3.5
func ListAgentSessions(projectPath string) ([]AgentSession, error)
func ListAmazonQSessions ¶ added in v0.3.5
func ListAmazonQSessions(projectPath string) ([]AgentSession, error)
ListAmazonQSessions lists all Amazon Q sessions for the given project path Note: Amazon Q automatically saves conversations by working directory and resumes with "q chat --resume" without needing session IDs
func ListCodexSessions ¶ added in v0.3.5
func ListCodexSessions(projectPath string) ([]AgentSession, error)
ListCodexSessions lists all Codex sessions for the given project path
func ListGeminiSessions ¶ added in v0.3.5
func ListGeminiSessions(projectPath string) ([]AgentSession, error)
ListGeminiSessions lists all Gemini sessions for the given project path
func ListOpenCodeSessions ¶ added in v0.3.5
func ListOpenCodeSessions(projectPath string) ([]AgentSession, error)
ListOpenCodeSessions lists all OpenCode sessions for the given project path
type AgentType ¶
type AgentType string
AgentType represents the type of AI agent
const ( AgentClaude AgentType = "claude" AgentGemini AgentType = "gemini" AgentAider AgentType = "aider" AgentCodex AgentType = "codex" AgentAmazonQ AgentType = "amazonq" AgentOpenCode AgentType = "opencode" AgentCursor AgentType = "cursor" AgentCustom AgentType = "custom" AgentTerminal AgentType = "terminal" // Plain shell/terminal window )
type ConversationMessage ¶ added in v0.7.5
type ConversationMessage struct {
Role string // "user" or "assistant"
Content string // Message content
Timestamp time.Time // Message timestamp
}
ConversationMessage represents a single message in a conversation
type DiffStats ¶ added in v0.6.5
type DiffStats struct {
Added int // Number of added lines
Removed int // Number of removed lines
Content string // Raw diff content
Error error // Error if diff failed
}
DiffStats contains git diff statistics and content
type FollowedWindow ¶ added in v0.6.0
type FollowedWindow struct {
Index int `json:"index"`
Agent AgentType `json:"agent"`
Name string `json:"name"` // Tab name for display
CustomCommand string `json:"custom_command"` // For custom agents
AutoYes bool `json:"auto_yes"` // YOLO mode for this tab
ResumeSessionID string `json:"resume_session_id"` // Resume session ID for this tab
Notes string `json:"notes,omitempty"` // User notes for this tab
}
FollowedWindow represents a tmux window tracked as an agent
type Group ¶
type Group struct {
ID string `json:"id"`
Name string `json:"name"`
Collapsed bool `json:"collapsed"`
Color string `json:"color,omitempty"` // Group name color
BgColor string `json:"bg_color,omitempty"` // Background color
FullRowColor bool `json:"full_row_color,omitempty"` // Extend background to full row
}
Group represents a session group for organizing sessions
type HistoryEntry ¶ added in v0.7.5
type HistoryEntry struct {
ID string
Agent AgentType
Content string // Full conversation or command (for search)
Snippet string // Highlighted excerpt for display
Path string // Project path (if applicable)
Timestamp time.Time
Score int // Relevance score for sorting
SessionFile string // Full path to session file (for Claude - to load conversation)
SessionID string // Claude session ID (for resume)
}
HistoryEntry represents a single searchable history item from any agent
func (*HistoryEntry) LoadConversation ¶ added in v0.7.5
func (e *HistoryEntry) LoadConversation() ([]ConversationMessage, error)
LoadConversation loads the full conversation from a session file
type HistoryIndex ¶ added in v0.7.5
type HistoryIndex struct {
// contains filtered or unexported fields
}
HistoryIndex manages the searchable history across all agents
func NewHistoryIndex ¶ added in v0.7.5
func NewHistoryIndex() *HistoryIndex
NewHistoryIndex creates a new history index
func (*HistoryIndex) FuzzySearch ¶ added in v0.7.5
func (h *HistoryIndex) FuzzySearch(query string) []HistoryEntry
FuzzySearch performs fuzzy matching with typo tolerance
func (*HistoryIndex) IsLoaded ¶ added in v0.7.5
func (h *HistoryIndex) IsLoaded() bool
IsLoaded returns true if history has been loaded
func (*HistoryIndex) Load ¶ added in v0.7.5
func (h *HistoryIndex) Load() error
Load loads history from all available sources
func (*HistoryIndex) Search ¶ added in v0.7.5
func (h *HistoryIndex) Search(query string) []HistoryEntry
Search searches the history index for matching entries Falls back to fuzzy search if no exact matches found
func (*HistoryIndex) SetInstances ¶ added in v0.7.5
func (h *HistoryIndex) SetInstances(instances []*Instance)
SetInstances sets the live instances for terminal search
type Instance ¶
type Instance struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Status Status `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AutoYes bool `json:"auto_yes"`
ResumeSessionID string `json:"resume_session_id,omitempty"` // Claude session ID to resume
Color string `json:"color,omitempty"` // Foreground color
BgColor string `json:"bg_color,omitempty"` // Background color
FullRowColor bool `json:"full_row_color,omitempty"` // Extend background to full row
GroupID string `json:"group_id,omitempty"` // Session group ID
Agent AgentType `json:"agent,omitempty"` // Agent type (claude, gemini, aider, custom)
CustomCommand string `json:"custom_command,omitempty"` // Custom command for AgentCustom
Notes string `json:"notes,omitempty"` // User notes/comments for this session
FollowedWindows []FollowedWindow `json:"followed_windows,omitempty"` // Windows tracked as agents (window 0 is main agent)
BaseCommitSHA string `json:"base_commit_sha,omitempty"` // Git HEAD commit at session start (for diff)
Favorite bool `json:"favorite,omitempty"` // Whether session is marked as favorite
}
func NewInstance ¶
func (*Instance) CloseWindow ¶ added in v0.6.0
CloseWindow closes a tmux window by index and removes it from FollowedWindows
func (*Instance) DetectActivity ¶ added in v0.4.0
func (i *Instance) DetectActivity() SessionActivity
DetectActivity analyzes tmux pane content to determine session activity This always checks window 0 (the main agent window)
func (*Instance) DetectActivityForWindow ¶ added in v0.6.0
func (i *Instance) DetectActivityForWindow(windowIdx int) SessionActivity
DetectActivityForWindow analyzes a specific tmux window to determine activity
func (*Instance) DetectAggregatedActivity ¶ added in v0.6.0
func (i *Instance) DetectAggregatedActivity() SessionActivity
DetectAggregatedActivity checks all followed windows and returns highest priority activity Priority: Waiting > Busy > Idle
func (*Instance) ForkSession ¶ added in v0.7.5
ForkSession creates a fork of the current Claude session using --fork-session Returns the new session ID
func (*Instance) GetAgentConfig ¶
func (i *Instance) GetAgentConfig() AgentConfig
GetAgentConfig returns the agent configuration for this instance
func (*Instance) GetAllFollowedAgents ¶ added in v0.6.0
func (i *Instance) GetAllFollowedAgents() []FollowedWindow
GetAllFollowedAgents returns info about all followed agents (including main window 0)
func (*Instance) GetCurrentWindowIndex ¶ added in v0.6.0
GetCurrentWindowIndex returns the current (active) window index (0-based)
func (*Instance) GetFollowedWindow ¶ added in v0.6.0
func (i *Instance) GetFollowedWindow(index int) *FollowedWindow
GetFollowedWindow returns the FollowedWindow for a given index, or nil if not followed
func (*Instance) GetFullDiff ¶ added in v0.6.5
GetFullDiff returns all uncommitted changes (staged + unstaged)
func (*Instance) GetLastLine ¶
GetLastLine returns the last non-empty line of output (for status display)
func (*Instance) GetLastLineForWindow ¶ added in v0.6.0
GetLastLineForWindow returns the last meaningful line from a specific window
func (*Instance) GetSessionDiff ¶ added in v0.6.5
GetSessionDiff returns diff since session start (BaseCommitSHA)
func (*Instance) GetSuggestion ¶ added in v0.4.0
GetSuggestion extracts the autocomplete suggestion from the agent's prompt area
func (*Instance) GetWindowCount ¶ added in v0.6.0
GetWindowCount returns the number of tmux windows in the session
func (*Instance) GetWindowList ¶ added in v0.6.0
func (i *Instance) GetWindowList() []WindowInfo
GetWindowList returns information about all windows in the session
func (*Instance) IsWindowFollowed ¶ added in v0.6.0
IsWindowFollowed checks if a window index is being tracked as an agent
func (*Instance) NewAgentWindow ¶ added in v0.6.0
NewAgentWindow creates a new tmux window running the specified agent
func (*Instance) NewForkedTab ¶ added in v0.7.5
NewForkedTab creates a new tab with a forked Claude session
func (*Instance) NewWindow ¶ added in v0.6.0
NewWindow creates a new tmux window in the session's directory
func (*Instance) NewWindowWithName ¶ added in v0.6.0
NewWindowWithName creates a new tmux window with a specific name
func (*Instance) NextWindow ¶ added in v0.6.0
NextWindow switches to the next tmux window
func (*Instance) PrevWindow ¶ added in v0.6.0
PrevWindow switches to the previous tmux window
func (*Instance) RenameCurrentWindow ¶ added in v0.6.0
RenameCurrentWindow renames the current tmux window
func (*Instance) ResetBaseCommit ¶ added in v0.6.5
func (i *Instance) ResetBaseCommit()
ResetBaseCommit clears the base commit SHA (useful for "reset diff" feature)
func (*Instance) ResizePane ¶
ResizePane resizes the tmux pane to the specified dimensions
func (*Instance) RespawnWindow ¶ added in v0.6.0
RespawnWindow restarts a dead window's process
func (*Instance) RespawnWindowWithResume ¶ added in v0.6.5
RespawnWindowWithResume restarts a window's process with a specific resume session ID
func (*Instance) SelectWindow ¶ added in v0.6.0
SelectWindow switches to the specified window index
func (*Instance) SendPrompt ¶ added in v0.3.5
SendPrompt sends a prompt text followed by Enter key
func (*Instance) SendText ¶ added in v0.3.5
SendText sends text literally (not interpreted as key names)
func (*Instance) StartWithResume ¶
func (*Instance) StopWindow ¶ added in v0.6.0
StopWindow kills the process in a tmux window (keeps window due to remain-on-exit)
func (*Instance) TmuxSessionName ¶
func (*Instance) ToggleWindowFollow ¶ added in v0.6.0
ToggleWindowFollow toggles the follow status of a window
func (*Instance) UpdateDetachBinding ¶
UpdateDetachBinding updates Ctrl+Q to resize to preview size before detaching
func (*Instance) UpdateStatus ¶
func (i *Instance) UpdateStatus()
func (*Instance) WindowName ¶ added in v0.6.5
WindowName returns the display name for the main tmux window (agent type)
type Project ¶ added in v0.3.0
type Project struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path,omitempty"`
CreatedAt time.Time `json:"created_at"`
Color string `json:"color,omitempty"`
}
Project represents a workspace containing sessions and groups
func NewProject ¶ added in v0.3.0
NewProject creates a new project with the given name
type ProjectsData ¶ added in v0.3.0
type ProjectsData struct {
Projects []*Project `json:"projects"`
LastProject string `json:"last_project,omitempty"`
}
ProjectsData contains the list of projects and metadata
type SessionActivity ¶ added in v0.4.0
type SessionActivity int
SessionActivity represents the activity state of a session
const ( ActivityIdle SessionActivity = iota // No activity, no prompt ActivityBusy // Agent is working ActivityWaiting // Agent needs user input/permission )
type Settings ¶
type Settings struct {
CompactList bool `json:"compact_list"`
HideStatusLines bool `json:"hide_status_lines"`
ShowAgentIcons bool `json:"show_agent_icons,omitempty"`
SplitView bool `json:"split_view,omitempty"`
MarkedSessionID string `json:"marked_session_id,omitempty"`
Cursor int `json:"cursor,omitempty"`
SplitFocus int `json:"split_focus,omitempty"`
}
Settings stores UI preferences
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func (*Storage) AddInstance ¶
func (*Storage) AddProject ¶ added in v0.3.0
AddProject creates a new project
func (*Storage) GetActiveProjectID ¶ added in v0.3.0
GetActiveProjectID returns the currently active project ID
func (*Storage) GetInstanceByName ¶
func (*Storage) GetProject ¶ added in v0.3.0
GetProject returns a project by ID
func (*Storage) GetProjectSessionCount ¶ added in v0.3.0
GetSessionCount returns the number of sessions in a project This requires loading the project's sessions file
func (*Storage) ImportDefaultSessions ¶ added in v0.3.0
ImportDefaultSessions moves sessions from default storage to a project
func (*Storage) IsProjectLocked ¶ added in v0.3.0
IsProjectLocked checks if a project is already running
func (*Storage) LoadAllWithSettings ¶
LoadAllWithSettings loads instances, groups, and settings
func (*Storage) LoadProjects ¶ added in v0.3.0
func (s *Storage) LoadProjects() (*ProjectsData, error)
LoadProjects loads the list of projects
func (*Storage) LockProject ¶ added in v0.3.0
LockProject creates a lock file for the current project
func (*Storage) RemoveGroup ¶
RemoveGroup removes a group (sessions become ungrouped)
func (*Storage) RemoveInstance ¶
func (*Storage) RemoveProject ¶ added in v0.3.0
RemoveProject removes a project and its data
func (*Storage) RenameGroup ¶
RenameGroup renames a group
func (*Storage) RenameProject ¶ added in v0.3.0
RenameProject renames a project
func (*Storage) SaveProjects ¶ added in v0.3.0
func (s *Storage) SaveProjects(projectsData *ProjectsData) error
SaveProjects saves the list of projects
func (*Storage) SaveSettings ¶
SaveSettings saves only the settings (preserves instances and groups)
func (*Storage) SaveWithGroups ¶
SaveWithGroups saves instances and groups (preserves settings)
func (*Storage) SetActiveProject ¶ added in v0.3.0
SetActiveProject switches to a different project
func (*Storage) SetInstanceGroup ¶
SetInstanceGroup assigns an instance to a group
func (*Storage) ToggleGroupCollapsed ¶
ToggleGroupCollapsed toggles the collapsed state of a group
func (*Storage) UnlockProject ¶ added in v0.3.0
func (s *Storage) UnlockProject()
UnlockProject removes the lock file
func (*Storage) UpdateInstance ¶
type StorageData ¶
type WindowInfo ¶ added in v0.6.0
type WindowInfo struct {
Index int
Name string
Active bool
Followed bool // Whether this window is tracked as an agent
Agent AgentType // Agent type if followed
Dead bool // Whether the window's pane has exited (command finished)
}
WindowInfo contains information about a tmux window