google-gemini / google-gemini/gemini-cli
Support Cross-Workspace Session Listing via --list-all-sessions
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
# 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//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//workspace/another-project [another-project] (1 session):
1. Fix broken tests (1 day ago) [f8e7d6c5]
```
Contributor guide
Research direction
Start by tracing the existing --list-sessions command in the Gemini CLI and how it discovers workspaces and sessions. Define the behavior for --list-all-sessions and its --group-by-workspace, -g, or --group variants, then verify that flat chronological and grouped absolute-path views label workspaces and the active workspace as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100