Skip to main content

Module ops

Module ops 

Source

Constants§

IDLE_SECS

Functions§

create_session
Create a named tmux session at wt_path and optionally send an initial command. Returns (tmux_name, display_name). Tmux name is prefixed with {proj_name}-{wt_slug}-; display_name is the user-visible part (what the user typed).
create_worktree
Create a new git worktree under repo_path for branch. Runs hooks (env copy, post_create) and returns the new worktree path. Returns a warning string if a hook failed (non-fatal).
delete_worktree
Remove a git worktree and kill any associated tmux sessions.
detect_default_branch
expand_path
load_workspace
refresh_workspace
Rebuild all worktrees + sessions for every project from live data. Calls list_worktrees per project synchronously — use for user-triggered refreshes.
refresh_workspace_with_worktrees
Like refresh_workspace but with pre-computed worktree entries — avoids subprocess calls on the caller’s thread. Used by the periodic background refresh path.
register_project
Register a new project at path. Returns the constructed Project and mutates config (caller must call config.save()).
rename_session
Rename a tmux session from old_name to new_name.
restore_cached_sessions
Recreate tmux sessions after a server restart (reboot/crash).
set_alias
Persist an alias for a branch in the global config. Caller must call config.save().
unregister_project
Remove a project by path from config. Caller must call config.save().
update_activity
Update session activity state from live tmux data. Returns true if any field changed.