Skip to content

Support Cross-Workspace Session Listing via --list-all-sessions #28595

Description

@paasshme

Feature Request: Support Cross-Workspace Session Listing via --list-all-sessions

What would you like to be added?

I would like to add a new command-line option --list-all-sessions to the Gemini CLI, allowing developers to view their chat sessions across all registered workspaces.

This feature should support two distinct listing modes:

  1. Flat Chronological Timeline (Default Mode): Prints a globally ordered, descending timeline (newest first) of all chat sessions across all workspaces, with each session clearly labeled with its parent workspace slug/directory and marking the active workspace with an asterisk (*).
  2. Grouped Workspace View (Optional Mode): Triggered by a supplementary --group-by-workspace (or -g / --group) option, this mode groups and lists sessions under their respective workspace absolute paths.

Why is this needed?

Currently, --list-sessions only lists chat sessions belonging to the current directory's workspace. However, developers often work across multiple projects and workspaces. When trying to resume an old session or clean up disk space, it is difficult to remember which project has which sessions.

Having a global --list-all-sessions option allows developers to get a centralized, multi-project overview of their past work, helping them find and resume specific sessions across different contexts without changing directories.

Additional context

Proposed Flat Timeline Output (Default):

Latest Sessions Across All Workspaces:

  * 1. Researching Session Listing [gemini-cli] (10 minutes ago, current) [9a7c82de]
    2. Fix broken tests [another-project] (30 minutes ago) [f8e7d6c5]
  * 3. Hello World Prototype [gemini-cli] (1 hour ago) [1a2b3c4d]

Proposed Grouped Workspace Output (via --group):

All Workspaces Sessions:

Workspace: /home/<username>/workspace/gemini-cli (active) [gemini-cli] (2 sessions):
  1. Researching Session Listing Implementation (10 minutes ago, current) [9a7c82de]
  2. Hello World Prototype (1 hour ago) [1a2b3c4d]

Workspace: /home/<username>/workspace/another-project [another-project] (1 session):
  1. Fix broken tests (1 day ago) [f8e7d6c5]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalityeffort/medium2-3 days: UI state, async flow, cross-component refactorskind/enhancementpriority/p3Backlog - a good idea but not currently a priority.status/bot-triaged

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions