Skip to main content

list_sessions

Function list_sessions 

Source
pub fn list_sessions(
    store: &SessionStore,
    tags: &[String],
    tag_all: bool,
    json: bool,
    output: &Output,
) -> Result<()>
Expand description

List sessions with optional tag filtering, pagination, and JSON output.

Loads only headers and footers for efficiency. Sessions are sorted by started_at descending (most recent first).

§Tag filtering

  • If tags is non-empty and tag_all is false: sessions matching ANY tag are shown
  • If tags is non-empty and tag_all is true: sessions matching ALL tags are shown

§Pagination

In interactive terminals, shows 20 sessions at a time with a “Show more?” prompt.

§Errors

Returns an error if reading sessions from the store fails.